ai-project-manage-cli 7.1.23 → 7.1.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3284,9 +3284,33 @@ async function ensureWebIdePullRequests(cfg, taskId, workdir) {
3284
3284
  ]
3285
3285
  };
3286
3286
  }
3287
+ let projectBaseBranch = "";
3288
+ try {
3289
+ const baseline = await api.cli.projectBaseBranch({ taskId });
3290
+ projectBaseBranch = baseline.baseBranch?.trim() ?? "";
3291
+ } catch (err) {
3292
+ const tip = `\u8BFB\u53D6\u9879\u76EE\u57FA\u7EBF\u5206\u652F\u5931\u8D25: ${err instanceof Error ? err.message : err}`;
3293
+ console.warn(`[apm] WebIDE PR\uFF1A${tip}`);
3294
+ return {
3295
+ ...empty(),
3296
+ failed: 1,
3297
+ tips: [tip],
3298
+ items: [{ label: "\u5DE5\u4F5C\u533A", outcome: "failed", detail: tip }]
3299
+ };
3300
+ }
3301
+ if (!projectBaseBranch) {
3302
+ const tip = "\u9879\u76EE\u672A\u914D\u7F6E\u57FA\u7840\u5206\u652F\uFF0C\u65E0\u6CD5\u6309\u57FA\u7EBF\u5339\u914D\u5E73\u53F0\u4ED3\u5E93";
3303
+ console.warn(`[apm] WebIDE PR\uFF1A${tip}`);
3304
+ return {
3305
+ ...empty(),
3306
+ failed: 1,
3307
+ tips: [tip],
3308
+ items: [{ label: "\u5DE5\u4F5C\u533A", outcome: "failed", detail: tip }]
3309
+ };
3310
+ }
3287
3311
  const expectedHead = `feat/task-${taskId}`;
3288
3312
  console.log(
3289
- `[apm] WebIDE PR\uFF1A\u51C6\u5907\u68C0\u67E5 ${repoRoots.length} \u4E2A\u4ED3\u5E93\uFF08\u671F\u671B\u7279\u6027\u5206\u652F ${expectedHead}\uFF09`
3313
+ `[apm] WebIDE PR\uFF1A\u51C6\u5907\u68C0\u67E5 ${repoRoots.length} \u4E2A\u4ED3\u5E93\uFF08\u671F\u671B\u7279\u6027\u5206\u652F ${expectedHead}\uFF0C\u9879\u76EE\u57FA\u7EBF ${projectBaseBranch}\uFF09`
3290
3314
  );
3291
3315
  let ensured = 0;
3292
3316
  let skipped = 0;
@@ -3339,10 +3363,13 @@ async function ensureWebIdePullRequests(cfg, taskId, workdir) {
3339
3363
  });
3340
3364
  continue;
3341
3365
  }
3342
- const matched = await api.cli.matchRepository({ url: originUrl });
3366
+ const matched = await api.cli.matchRepository({
3367
+ url: originUrl,
3368
+ baseBranch: projectBaseBranch
3369
+ });
3343
3370
  const repositoryId = matched.repositoryId?.trim();
3344
3371
  if (!repositoryId) {
3345
- const tip = `${label}\uFF1A\u5E73\u53F0\u672A\u767B\u8BB0\u4ED3\u5E93 ${originUrl}`;
3372
+ const tip = `${label}\uFF1A\u5E73\u53F0\u672A\u627E\u5230\u4ED3\u5E93\uFF08remote=${originUrl}\uFF0C\u57FA\u7EBF=${projectBaseBranch}\uFF09`;
3346
3373
  console.warn(`[apm] WebIDE PR\uFF1A\u8DF3\u8FC7 ${tip}`);
3347
3374
  tips.push(tip);
3348
3375
  skipped += 1;
@@ -3350,6 +3377,7 @@ async function ensureWebIdePullRequests(cfg, taskId, workdir) {
3350
3377
  label,
3351
3378
  outcome: "skipped",
3352
3379
  headBranch,
3380
+ baseBranch: projectBaseBranch,
3353
3381
  detail: tip
3354
3382
  });
3355
3383
  continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-project-manage-cli",
3
- "version": "7.1.23",
3
+ "version": "7.1.25",
4
4
  "description": "命令行工具:后续用于调用平台后端 API 完成运维与自动化操作",
5
5
  "type": "module",
6
6
  "private": false,
@@ -30,6 +30,7 @@
30
30
  - reply.md:当需要回复消息时需要读取这个文档,记住回复规则
31
31
  - write_doc.md:当需要写文档时需要读取这个文档,记住写文档的规则
32
32
  - webide_git_commit.md:WebIDE 开发/修码时读取,按规范分轮 commit,结束前 push
33
+ - webide_sql_change.md:WebIDE 开发/修码时读取;若有数据表或 SQL 变更,须在 AppendMessage 中醒目提示
33
34
  - webide_testcase.md:WebIDE 生成测试用例时读取,按规范编写并提交用例
34
35
  - webide_merge.md:WebIDE 验收通过后读取;直接调用 MergeWebIdePullRequests 合并代码
35
36
 
@@ -1,6 +1,6 @@
1
1
  ## WebIDE Git 提交规范
2
2
 
3
- 适用场景:WebIDE 开发阶段(`skip-plan` / `start-develop`)及修码复测(`fix-and-retest`)中涉及代码改动时。
3
+ 适用场景:WebIDE 开发阶段(`skip-plan` / `start-develop`)及修码(`fix-and-retest` / `report-defect`)中涉及代码改动时。
4
4
 
5
5
  ### 分轮提交
6
6
 
@@ -0,0 +1,26 @@
1
+ ## WebIDE 数据表 / SQL 变更提示
2
+
3
+ 适用场景:WebIDE 开发(`skip-plan` / `start-develop`)与修码(`fix-and-retest` / `report-defect`)。
4
+
5
+ ### 何时必须提示
6
+
7
+ 本轮若涉及任一情况,结束前的 **AppendMessage 必须单独醒目提示**:
8
+
9
+ - 数据表结构变更(建表、改字段、删字段、索引、约束等)
10
+ - 需在目标库执行的 SQL(DDL / DML、数据修复脚本)
11
+ - 后端新增或修改了 migration、Mapper/XML、手写 SQL 脚本等可落地的 SQL 产物
12
+
13
+ ### AppendMessage 怎么写
14
+
15
+ 在回复中增加小节(标题可用「数据表 / SQL 变更」),至少包含:
16
+
17
+ 1. **涉及表**:表名列表与变更类型(如新增列、建表)
18
+ 2. **SQL 产物路径**:仓库内相关文件路径(若有)
19
+ 3. **待执行 SQL**:完整、可复制执行的语句,放在 ` ```sql ` 代码块中,按执行顺序列出;禁止用 `...` 省略表名/字段名
20
+ 4. **执行提醒**:明确告知用户需在对应环境数据库执行(若本轮未自动执行)
21
+
22
+ 多仓时注明 SQL 属于哪个仓库(如后端仓)。
23
+
24
+ ### 无变更时
25
+
26
+ 未触及数据表与 SQL 时,**不要**硬凑该小节。