Repository navigation
ci(commands): add independent rerun and cancel - #393
Conversation
|
To use Codex here, create an environment for this repo. |
SigureMo
left a comment
There was a problem hiding this comment.
有点奇怪,我们 ci 目录有必要存在吗?是否可以用自定义 actions 目录?
879ff73 to
41569df
Compare
|
关于 review 中提到的
This reply was automatically generated by
@codex.
|
This comment was marked as spam.
This comment was marked as spam.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Nyanpasu 审查看板审查状态: ✅ 已通过 审查版本: bb59f3e 目标分支: codex/ci-control 审查通过:本 head 为 rebase 后的同内容提交——本 PR 自身 4 个文件与上一轮已批准的 4435b13 字节一致(diff 为空),基线层增量仅为贡献者文档(CONTRIBUTING.md 与 how-to-contribute),不涉及代码、配置或本 PR 的行为。CI 正在运行(Pre-commit 已通过,其余进行中;同一字节内容在上一 head 曾全部通过)。F1 保持已解决。深度阶段沿用既有独立设计对比与必要性审计结论。
审查发现待处理
已解决或已取代
提交范围 · 接收 4 · 建议移出 0 · 待确认 0接收 4 个文件 · 建议移出 0 个文件 · 待确认 0 个文件。移出与待确认部分暂停深审,不代表审查通过。
精简审查与验证依据
生产代码的必要性与替代方案
Powered by Nyanpasu with glm-5.3[1m] xhigh, please check the suggestions carefully.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2ff596e to
3730bf0
Compare
rai-studio-bot
left a comment
There was a problem hiding this comment.
常规审查完成 · 深度审查进行中
已完整审查本 PR 相对直接基线 codex/ci-control 的全部 4 个新增文件(workflow、composite action 与两个 .mjs 模块,共 260 行),并用模拟 GitHub 客户端完成 20 项端到端场景验证,覆盖权限检查、源评论去重、fork run 匹配、写入前 head 校验、rerun/cancel 的 API 操作选择,以及新加入的并发存活 run 选择逻辑(含最新 run 被 cancel 时回退到可重跑 run 的场景)。未发现阻塞问题;仅有一个 P3 级文案瑕疵,见行内评论。环境核对:ubuntu-slim 为有效托管 runner 标签,github-script@v8(node24)支持所用 JSON import 属性,共享配置中的 job 名称与三个目标 workflow 的实际 job 名称一致。独立设计参考与生产/测试必要性审计仍在进行,结论将在深度审查完成后更新。
审查看板:#393 (comment)
rai-studio-bot
left a comment
There was a problem hiding this comment.
审查完成 · 无阻塞问题(1 个 P3 建议待处理)
常规与深度审查均已完成。相对直接基线 codex/ci-control 的 4 个新增文件经全量审查,并以模拟 GitHub 客户端完成 21 项端到端场景验证(权限、源评论去重、fork 匹配、写入前 head 校验、rerun/cancel 的 API 操作选择、并发存活 run 选择),未发现 P1/P2 缺陷;唯一行内发现为 F1(P3,非阻塞的文案瑕疵,已附单行建议)。深度阶段使用仅基于需求与基线树独立推导的最小设计参考进行对比:两个设计在核心机制上独立收敛(写入前先落盘带源评论 ID 的回复作为去重账本、按 head_sha 关联 run、目标集合由共享配置派生、作者或 write 权限授权),未发现可删除的冗余机制;作者实现在写入前 head 复核、Bot 评论过滤与 run 选择上更严格。生产与测试必要性审计结论及证据见看板。待 F1 处理或明确拒绝后,可给出通过结论。
审查看板:#393 (comment)
rai-studio-bot
left a comment
There was a problem hiding this comment.
审查通过 ✅
F1(P3,per-run 错误回复的双句点)已在 fec92d7 按建议修复,并同步处理了同一评论中提到的 no-run 提示文案(现按指令命名);本地 mock 复验输出均为单句点、job 名保持代码样式,13 项基础场景与 7 项 run 选择场景重跑无回归,确认回复见原线程。相对直接基线 codex/ci-control 的 4 个新增文件已在本轮与此前两轮完成全量审查与端到端场景验证;深度阶段(独立最小设计参考对比、生产与测试必要性审计)无新增发现,相关结论与证据见看板。F1 线程的 resolve 按钮请由有权限的维护者点击(本账号无该权限)。
CI 备注:本 head 必需检查 Tests (Python 3.12) 失败于 tests/engine/rewards/test_custom_reward_worker.py——该测试模块在无关分支(feat/task5-spec-metrics,2026-09-29)同样失败过,同一套件在本 PR 上一 head 及 Python 3.10/3.11 均通过,与本 PR 仅改 .github/ 下文件的 diff 无关,属既有 flaky 测试,可直接重跑。
审查看板:#393 (comment)
a94f8f1 to
9210eed
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
1 similar comment
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
rai-studio-bot
left a comment
There was a problem hiding this comment.
审查通过 ✅
本 head 的 4 个文件与此前已完整审查并验证的内容字节一致:9210eed6 相对已批准的 fec92d7a 仅为 oxfmt 格式化变更(经 diff 归一化配对、语法检查与行为冒烟确认语义不变),其间的基线层重组(defer repository-wide formatting)不影响本 PR——pre-commit 的 oxfmt 钩子仍覆盖 ci-commands 文件,共享 config.json 未变。PR 描述编辑仅补充既有行为的文档说明(run 选择逻辑、栈位置 2/6、并发重复场景的真实数据验证),需求未变。CI 8 项检查全部通过(含上轮 flaky 的 Python 3.12)。F1 保持已解决(fec92d7a 修复,格式化后行为不变;线程待维护者点击 resolve)。完整审查证据(20+ 项模拟场景、独立最小设计对照、生产与测试必要性审计)见看板。
审查看板:#393 (comment)
9210eed to
4435b13
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
1 similar comment
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
rai-studio-bot
left a comment
There was a problem hiding this comment.
审查通过 ✅
本 head 相对已批准状态的增量仅为 index.mjs help 文案两行,用于说明基线层新的层级 target 命名。已验证与基线新配置(ci/pre-commit 等 7 处改名)完全兼容:复合键正确解析为 job 目标并触发对应 job 重跑、job 目标按文案所述拒绝 /cancel、help 表格按新键渲染、旧扁平名按预期报 Unknown target。CI 8 项检查全部通过。此前各轮的完整审查证据(20+ 项模拟场景、独立最小设计对照、生产与测试必要性审计、F1 修复验证)见看板;F1 保持已解决。
审查看板:#393 (comment)
- Resolve allowlisted workflows and exact matrix jobs against the current PR head. - Support failed-job and whole-workflow reruns, and explicit workflow cancellation. - Reject stale heads and avoid automatically retrying ambiguous API writes. Co-authored-by: Codex <[email protected]>
# ♻️ Refactor - Separate permission checks and command dispatch from the comment lifecycle. - Select Actions API operations with pure functions and keep writes at one boundary. - Parse commands from the first line without account-specific attribution handling. - Keep public help focused on contributor operations. # ✅ Validation - Check permissions, deduplication, fork run selection, head changes and ambiguous API writes with temporary smoke checks. - Pass all pre-commit hooks without adding test files. Co-authored-by: Codex <[email protected]>
# 🐛 Bug Fix - Prefer active runs on the current PR head, then the newest non-cancelled run. - Keep the newest cancelled run as a fallback when no surviving run exists. - Prevent a higher-numbered cancelled duplicate from hiding an active or failed run. Co-authored-by: Codex <[email protected]>
# 🐛 Bug Fix - Normalize trailing periods before appending per-run retry guidance. - Name the invoked command when no workflow run matches the current head. Co-authored-by: RAI Studio Bot <[email protected]> Co-authored-by: Codex <[email protected]>
# 🎨 Style - Format the rerun/cancel action with the repository-wide oxfmt settings introduced in the base PR. - Keep the command behavior unchanged and verify both ESM files with node --check. - Run all pre-commit hooks successfully. Co-authored-by: Codex <[email protected]>
# 📝 Documentation - Explain workflow/job target names in command help. - Distinguish the CI workflow from all workflows and retain workflow-only cancellation. Co-authored-by: Codex <[email protected]>
4435b13 to
bb59f3e
Compare
This comment was marked as spam.
This comment was marked as spam.
1 similar comment
This comment was marked as spam.
This comment was marked as spam.
rai-studio-bot
left a comment
There was a problem hiding this comment.
审查通过 ✅
本 head 是 rebase 后的同内容提交:本 PR 自身的 4 个文件与上一轮已批准并验证的 4435b138 字节一致(diff 为空),基线层增量仅为贡献者文档,不涉及代码、共享配置或本 PR 的行为。CI 正在运行(Pre-commit 已通过;其余进行中,同一字节内容在上一 head 曾全部通过,无失败记录)。此前各轮的完整审查证据(20+ 项模拟场景、独立最小设计对照、生产与测试必要性审计、F1 修复验证)见看板;F1 保持已解决。
审查看板:#393 (comment)
## What <!-- What changes does this PR introduce? --> 集中维护 CI team 与 target 映射,并接入 oxfmt mirror 和共享格式化配置。在 `.github/` 的 CODEOWNERS 中追加 `@SigureMo`,保留原有负责人。 ## Why <!-- Why are these changes needed? Link related issues with "Fixes #123" or "Relates to #456". --> 后续各功能有独立入口,仅共享必要的数据配置,使维护者能直接看懂配置和各层职责。 ## How <!-- How do the changes work? Describe the technical approach. --> - `.github/ci/config.json` 仅包含 `ciTeam` 和 workflow/job target 映射,JavaScript 原生读取 JSON。workflow 使用 `ci`、`gpu-unit`、`integration`;job 使用 `ci/pre-commit`、`ci/cpu-310` 等 `workflow/job` 名称,不保留旧短名称别名。 - CI team 为 `SigureMo`、`NINGBENZHE`、`Yangruipis`,使用实际 GitHub login 大小写。 - 保留 `ShigureLab/[email protected]` 和 JavaScript/JSON 类型选择;clang-format 通过 `exclude_types: [javascript, json]` 排除这两类文件。 - oxfmt 配置移到根目录 `.oxfmtrc.json`,参考 [yutto 的格式化选项](https://github.com/yutto-dev/yutto/blob/main/docs/vite.config.ts):100 列、两空格缩进、单引号、ES5 尾逗号、无分号、箭头参数始终加括号,并关闭 package.json 排序。 - 暂时排除既有 `acquire-devices` action 与 `docs/` 的 oxfmt 格式化;这 9 个既有文件的风格 diff 已移到栈顶专门的格式化层 #398,由该层移除临时路径排除,统一格式化 JS/TS、JSON、样式表和 GraphQL,暂不处理 YAML/TOML。 - 本层只包含共享配置、格式化工具配置和 CODEOWNERS,共 4 个文件;指令入口在 #393,bypass 在 #394,欢迎与指南在 #395,skill 在 #396,全仓格式化在 #398。 原生 gh-stack 第 1/6 层,base 为 `main`。 ## Testing <!-- How were the changes tested? Include commands, test results, or screenshots. --> 本层通过全量 `pre-commit run --all-files`;既有 action 和 docs 文件与 `main` 保持一致,格式化 diff 单独位于栈顶。未新增测试文件。 未在本地运行 `pytest tests/`:本次涉及 CI 自动化及文档,未改动训练代码。 - [x] `pre-commit run --all-files` passes - [ ] Tests pass (`pytest tests/`) - [ ] New tests added (if applicable) - [ ] Documentation updated (if applicable) ## Type of Change - [ ] Bug fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Refactoring (no functional changes) - [ ] Performance improvement - [x] CI/CD or build changes ## Screenshots / Logs <!-- If applicable, add screenshots or log output to help explain the changes. --> <div align="right"> <sup>This PR is co-authored with @codex (gpt-6-astra, reasoning: xhigh).</sup> </div> --------- Co-authored-by: Codex <[email protected]> Co-authored-by: RAI Studio Bot <[email protected]>
## What <!-- What changes does this PR introduce? --> 通过 `ShigureLab/ci-bypass@v2` 判断 CI team 的标签或评论豁免,并在 synchronize 时独立清理 bypass 标签。 ## Why <!-- Why are these changes needed? Link related issues with "Fixes #123" or "Relates to #456". --> 将豁免判断集中到可复用 workflow,由 ci-bypass 处理规则匹配与授权检查,CI workflow 根据结果决定是否运行测试。 ## How <!-- How do the changes work? Describe the technical approach. --> - 可复用 `check-bypass.yml` 在 `ubuntu-slim` 上运行,CPU、GPU unit 和 integration workflow 分别传入 target。 - 从共享 JSON 读取三人 CI team,支持 workflow/all 标签和 `/bypass` 评论,理由可选。 - 使用 `ShigureLab/ci-bypass@v2`,不锁定具体 commit。 - 独立 synchronize workflow 分页获取并移除 `ci-bypass:` 标签。历史 bypass 评论仍遵循上游规则。 - Gate 失败时运行原测试;只在 gate 成功且明确输出 `can-skip=true` 时跳过测试,workflow 取消后不继续启动测试。 原生 gh-stack 第 3/6 层,base 为 #393。豁免与维护操作记录在 #396 的 skill 参考页。 ## Testing <!-- How were the changes tested? Include commands, test results, or screenshots. --> 全量 pre-commit 和 actionlint 已通过。 未在本地运行 `pytest tests/` 或 GPU/NPU 训练:本次涉及 CI 自动化与文档。欢迎/评论指令的真实 GitHub 交互需进入默认分支后验证。 - [x] `pre-commit run --all-files` passes - [ ] Tests pass (`pytest tests/`) - [ ] New tests added (if applicable) - [ ] Documentation updated (if applicable) ## Type of Change - [ ] Bug fix (non-breaking change that fixes an issue) - [x] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Refactoring (no functional changes) - [ ] Performance improvement - [x] CI/CD or build changes ## Screenshots / Logs <!-- If applicable, add screenshots or log output to help explain the changes. --> <div align="right"> <sup>This PR is co-authored with @codex (gpt-6-astra, reasoning: xhigh).</sup> </div> --------- Co-authored-by: Codex <[email protected]>
## What <!-- What changes does this PR introduce? --> 新增专门的格式化层,把既有文件的风格调整从 #392 移到栈顶,并使用无 Node 运行时的 oxfmt mirror 统一格式化 JS/TS、JSON 和样式表,暂不处理 YAML/TOML。 ## Why <!-- Why are these changes needed? Link related issues with "Fixes #123" or "Relates to #456". --> CI 基础设施改动与全仓风格调整分开审查;同时补齐 TypeScript、样式表和 JSON 配置的格式化覆盖。 ## How <!-- How do the changes work? Describe the technical approach. --> - 保留 `ShigureLab/[email protected]` 和根目录 `.oxfmtrc.json` 的现有风格。 - 使用 `types_or: [text]` 把格式识别交给 standalone oxfmt,避免 pre-commit 类型识别漏掉 `.mts`、`.jsonc`、`.gql` 及特殊配置文件名。`--no-error-on-unmatched-pattern` 允许仅包含不支持格式的批次,受支持文件的语法错误仍然会失败。 - 移除 #392 的临时路径排除,覆盖 JS/JSX、TS/TSX、JSON/JSONC/JSON5、CSS/SCSS/Less、GraphQL;现有 `transfer_queue/` 全局排除继续生效。 - 使用 `exclude_types: [yaml, toml]` 暂时排除 YAML/TOML;这些文件的风格调整均已撤回,`.pre-commit-config.yaml` 只保留必要的 hook 配置修改。 - HTML、Vue、Markdown 不在当前 standalone 版本的支持范围内;Markdown 沿用现有 mdformat。 - clang-format 继续按语言排除 JavaScript/JSON,避免重复格式化。 - 本层共修改 14 个文件;完整栈中 oxfmt 实际匹配 22 个文件。 原生 gh-stack 第 6/6 层,base 为 #396;前五层仍为 #392 → #393 → #394 → #395 → #396。 ## Testing <!-- How were the changes tested? Include commands, test results, or screenshots. --> - 全量 `pre-commit run --all-files --show-diff-on-failure` 通过,重复运行后无新增 diff。 - 在不含 Node 的 PATH 下实测 16 种启用的扩展名;HTML/Vue/Markdown 确认为不支持。 - 实际 pre-commit 文件选择覆盖 `.mts`、`.jsonc`、`.gql`;oxfmt 全仓 `--check` 通过,且忽略不匹配文件的选项不会掩盖 TypeScript 语法错误。 - 验证全部已跟踪 YAML/TOML 均被 hook 排除,内容与父层一致(必要的 hook 配置修改除外);5 个 JSON 文件解析值一致,7 个 JS/TS 文件经 esbuild 规范化后的输出一致。 - `vitepress build docs` 与 `node docs/fix-chunk-names.js` 通过。 未运行训练单测及多节点 GPU/NPU 集成测试:本层仅调整格式化配置和代码风格,本地也不具备相应集成测试硬件;未新增测试文件。 - [x] `pre-commit run --all-files` passes - [ ] Tests pass (`pytest tests/`) - [ ] New tests added (if applicable) - [ ] Documentation updated (if applicable) ## Type of Change - [ ] Bug fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [x] Refactoring (no functional changes) - [ ] Performance improvement - [x] CI/CD or build changes ## Screenshots / Logs <!-- If applicable, add screenshots or log output to help explain the changes. --> <div align="right"> <sup>This PR is co-authored with @codex (gpt-6-astra, reasoning: xhigh).</sup> </div> --------- Co-authored-by: Codex <[email protected]>

What
通过独立 action 和 workflow 提供
/rerun、/cancel、/help,操作当前 PR 的 CI。Why
使权限、运行状态判断、API 操作与评论回复各自清晰,贡献者可以直接在 PR 中操作 CI。
How
index.mjs分离首行指令解析、公开帮助、权限检查与评论回复流程。runs.mjs分离 run 筛选、状态判断、job 查询和 API 操作选择;写入前统一核对 PR head。/rerun默认重跑当前 head 最新失败或超时 workflow 中失败的 job,也支持精确指定 workflow 或workflow/job;ci只选择 pre-commit/CPU workflow,all选择全部已配置 workflow。/help展示相同命名和范围,取消仅接受 workflow target。GITHUB_TOKEN;只加载默认分支代码,按源评论 ID 去重,写入超时后不自动重复操作。原生 gh-stack 第 2/6 层,依赖 #392 的共享 JSON。
Testing
全量 pre-commit 和 actionlint 已通过。临时 Node 冒烟检查覆盖首行解析、公开帮助、权限、去重、fork run 匹配、API 操作选择、head 变化和不明确写入结果。另以真实运行数据验证 6 个并发重复运行场景,包括被取消的高编号 run 与活跃、失败、成功 run 共存,以及全部取消时的显式重跑。另通过 27 个临时指令场景检查:7 个新 job target 精确重跑、7 个旧短名称拒绝、7 个 job 取消请求拒绝,以及 workflow/all/default/help 的范围。未提交测试文件。
未在本地运行
pytest tests/或 GPU/NPU 训练:本次涉及 CI 自动化与文档。欢迎/评论指令的真实 GitHub 交互需进入默认分支后验证。pre-commit run --all-filespassespytest tests/)Type of Change
Screenshots / Logs