msdevflow 0.8.6 → 0.8.7
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.
package/package.json
CHANGED
|
@@ -90,10 +90,10 @@ PR 里程碑严格继承已核验目标 Issue:Issue 有里程碑时,PR 必
|
|
|
90
90
|
|
|
91
91
|
已经关联同一 number 时跳过编辑;关联了不同里程碑时必须展示当前值和目标 Issue 值,并在 guided 模式重新确认后才可覆盖。目标 Issue 为 `none` 但已有 PR 带里程碑时,只有当前 schema/help 明确提供并验证了清空语义才可在确认后清空,否则返回 `blocked: milestone-conflict`;不得猜测 `--milestone 0`。创建或编辑结果不确定时先回读同一 PR,不重复创建或盲目重试。
|
|
92
92
|
|
|
93
|
-
随后逐字回读标题和完整正文,验证末尾恰好存在一次尾签,再验证 canonical、source、head、base、Issue 关联、PR 为 open,以及 PR 里程碑的 number/title 与目标 Issue 精确一致;目标 Issue 为 `none` 时验证 PR 也未关联里程碑。PR 回读验证固定使用 Skill 随附脚本,不现场拼接 python/PowerShell JSON
|
|
93
|
+
随后逐字回读标题和完整正文,验证末尾恰好存在一次尾签,再验证 canonical、source、head、base、Issue 关联、PR 为 open,以及 PR 里程碑的 number/title 与目标 Issue 精确一致;目标 Issue 为 `none` 时验证 PR 也未关联里程碑。PR 回读验证固定使用 Skill 随附脚本,不现场拼接 python/PowerShell JSON 解析;调用时用 `MSDEVFLOW_GITCODE_COMMAND` 传入本次 run 固定的 `<gitcode-command>`,与 run 内其他命令保持一致:
|
|
94
94
|
|
|
95
95
|
```bash
|
|
96
|
-
python <skill-scripts-dir>/gitcode_verify.py verify-pr <canonical> <pr-number> \
|
|
96
|
+
MSDEVFLOW_GITCODE_COMMAND=<gitcode-command> python <skill-scripts-dir>/gitcode_verify.py verify-pr <canonical> <pr-number> \
|
|
97
97
|
--title <exact-title> --body-file <body-file> --issue <issue-number> --milestone <issue-milestone-or-omit>
|
|
98
98
|
```
|
|
99
99
|
|
|
@@ -135,18 +135,18 @@ Suggested next action: ci(CI 协议未确定时)| feedback(已有意见)
|
|
|
135
135
|
4. 分类当前改动、连带失败、canonical 基线、基础设施、权限或证据不足;
|
|
136
136
|
5. guided 模式确认修复;`autonomous-ci` 只在已授权最小范围内自动修改、验证、新 commit、push 和重触发;
|
|
137
137
|
6. 新 push 后获取新 head,旧 head 结果失效;
|
|
138
|
-
7. 轮询和回读固定使用 Skill 随附脚本,不每轮现场生成 python
|
|
138
|
+
7. 轮询和回读固定使用 Skill 随附脚本,不每轮现场生成 python 内联解析;统一用 `MSDEVFLOW_GITCODE_COMMAND` 传入本次 run 固定的 `<gitcode-command>`:
|
|
139
139
|
|
|
140
140
|
```bash
|
|
141
141
|
# 触发评论发布后逐字回读(说明评论按 body-file,机器命令按 --contains)
|
|
142
|
-
python <skill-scripts-dir>/gitcode_verify.py verify-comment <canonical> <pr-number> --body-file <note-file>
|
|
143
|
-
python <skill-scripts-dir>/gitcode_verify.py verify-comment <canonical> <pr-number> --contains "compile"
|
|
142
|
+
MSDEVFLOW_GITCODE_COMMAND=<gitcode-command> python <skill-scripts-dir>/gitcode_verify.py verify-comment <canonical> <pr-number> --body-file <note-file>
|
|
143
|
+
MSDEVFLOW_GITCODE_COMMAND=<gitcode-command> python <skill-scripts-dir>/gitcode_verify.py verify-comment <canonical> <pr-number> --contains "compile"
|
|
144
144
|
|
|
145
145
|
# 监控 CI:输出 ci/pipeline 标签与机器人评论摘要(机器人登录名按 ci-and-review.md 识别结果固定)
|
|
146
|
-
python <skill-scripts-dir>/gitcode_verify.py poll-ci <canonical> <pr-number> --comment-author <bot-login>
|
|
146
|
+
MSDEVFLOW_GITCODE_COMMAND=<gitcode-command> python <skill-scripts-dir>/gitcode_verify.py poll-ci <canonical> <pr-number> --comment-author <bot-login>
|
|
147
147
|
|
|
148
148
|
# 持续监控直到 passed/failed 或超时:自适应间隔,running 时逐步拉长到 --max-interval
|
|
149
|
-
python <skill-scripts-dir>/gitcode_verify.py watch-ci <canonical> <pr-number> --timeout 60
|
|
149
|
+
MSDEVFLOW_GITCODE_COMMAND=<gitcode-command> python <skill-scripts-dir>/gitcode_verify.py watch-ci <canonical> <pr-number> --timeout 60
|
|
150
150
|
```
|
|
151
151
|
|
|
152
152
|
8. openLiBing detail/log 返回 401/403 时,按 [openlibing-ci.md](openlibing-ci.md) 使用 setup 创建的受管 Python 运行时和其中的 Playwright,并用已有的系统 Chrome/Edge 或 Playwright Chromium 打开可见浏览器;action 内不调用 pip,也不自动下载浏览器。受管运行时不可用时要求运行 `npx msdevflow@latest setup`;用户完成 GitCode 登录/授权且固定 run 验证成功后恢复当前 CI 诊断,浏览器不可用时输出 OAuth 链接并停止为 `blocked: browser-required`;
|
|
@@ -11,6 +11,7 @@ import argparse
|
|
|
11
11
|
import json
|
|
12
12
|
import os
|
|
13
13
|
import re
|
|
14
|
+
import shutil
|
|
14
15
|
import subprocess
|
|
15
16
|
import sys
|
|
16
17
|
import tempfile
|
|
@@ -18,22 +19,38 @@ from pathlib import Path
|
|
|
18
19
|
|
|
19
20
|
SIGNATURE = "——msdevflow"
|
|
20
21
|
DEFAULT_LIMIT = 100
|
|
22
|
+
GITCODE_COMMAND = os.environ.get("MSDEVFLOW_GITCODE_COMMAND", "gitcode")
|
|
21
23
|
|
|
22
24
|
if os.name == "nt":
|
|
23
25
|
sys.stdout.reconfigure(encoding="utf-8")
|
|
24
26
|
sys.stderr.reconfigure(encoding="utf-8")
|
|
25
27
|
|
|
26
28
|
|
|
29
|
+
def invocation(arguments: list[str]) -> list[str]:
|
|
30
|
+
selected = shutil.which(GITCODE_COMMAND)
|
|
31
|
+
if not selected:
|
|
32
|
+
print(f"gitcode command not found: {GITCODE_COMMAND}", file=sys.stderr)
|
|
33
|
+
raise SystemExit(3)
|
|
34
|
+
if os.name == "nt" and Path(selected).suffix.lower() in {".cmd", ".bat"}:
|
|
35
|
+
# .cmd wrappers cannot be exec'd directly by subprocess.
|
|
36
|
+
return [
|
|
37
|
+
"powershell.exe", "-NoProfile", "-Command",
|
|
38
|
+
"& { $exe = $args[0]; $rest = @($args | Select-Object -Skip 1); & $exe @rest; exit $LASTEXITCODE }",
|
|
39
|
+
selected, *arguments,
|
|
40
|
+
]
|
|
41
|
+
return [selected, *arguments]
|
|
42
|
+
|
|
43
|
+
|
|
27
44
|
def run_gitcode(args: list[str]) -> dict:
|
|
28
45
|
result = subprocess.run(
|
|
29
|
-
|
|
46
|
+
invocation(args),
|
|
30
47
|
capture_output=True,
|
|
31
48
|
text=True,
|
|
32
49
|
encoding="utf-8",
|
|
33
|
-
timeout=
|
|
50
|
+
timeout=180,
|
|
34
51
|
)
|
|
35
52
|
if result.returncode != 0:
|
|
36
|
-
print(f"
|
|
53
|
+
print(f"{GITCODE_COMMAND} {' '.join(args)} failed: exit {result.returncode}", file=sys.stderr)
|
|
37
54
|
print(result.stderr[-2000:], file=sys.stderr)
|
|
38
55
|
raise SystemExit(3)
|
|
39
56
|
return json.loads(result.stdout)
|