ci: allow longer PR review timeout retries - #5961
Conversation
a59dc36 to
19d7bc1
Compare
19d7bc1 to
885309c
Compare
|
Thanks for the PR! Template looks good ✓ On direction: solid, pragmatic CI improvement. Large PRs blowing past the review budget is a real problem maintainers hit, and giving them an explicit On approach: scope is tight — two files, each change maps directly to the stated goal. The timeout parsing loop is straightforward, the 180-minute cap leaves headroom under the 200-minute job limit, and the differentiated fallback comments (timeout vs. generic failure) are a nice touch. One thing I want to verify in code review: the shift from Moving on to code review. 🔍 中文说明感谢贡献! 模板完整 ✓ 方向:务实的 CI 改进。大 PR 超出评审预算是维护者实际遇到的问题,给出一个明确、可审计的 方案:范围紧凑——两个文件,每处改动都直接服务于目标。超时解析循环清晰,180 分钟上限在 200 分钟 job 限制内留有余量,区分超时和通用失败的 fallback 评论是不错的设计。代码审查需要确认一处:从 进入代码审查 🔍 — Qwen Code · qwen3.7-max |
Code ReviewRead the PR description first, then wrote my own proposal before looking at the diff: My independent proposal: Parse Comparison with the PR: the PR's approach matches this almost exactly. The token parsing is clean (case statement, no regex), the validation ladder (format → length → range) is solid, and the Two things I looked at more closely:
No critical blockers. No AGENTS.md violations. No over-abstraction or scope creep — each change maps to the stated goal. Pre-existing prettier issue on the workflow YAML (also present on main) is not introduced by this PR. Testingtmux real-scenario testing is N/A for a workflow YAML change — there's no user-facing behavior to drive. Ran the unit tests instead. Unit tests (worktree with PR applied): All 16 tests pass, including the 2 new tests added by this PR:
Prettier on changed test file: passes. Workflow YAML has a pre-existing formatting issue (same on main), not introduced here. — Qwen Code · qwen3.7-max |
|
This is a clean, well-scoped CI improvement and I'm happy to approve. The problem is real (large PRs blow past the review budget with no obvious retry path), the solution is minimal (two files, every edit maps to the goal), and the tests cover the new behavior without over-specifying implementation details. My independent proposal before reading the diff was essentially the same approach — the PR didn't miss a simpler path. The one thing I watched closely was dropping the 5-minute buffer on Shipping this. ✅ 中文说明这是一个干净、范围明确的 CI 改进,可以通过审查。 问题是真实的(大 PR 超出评审预算且没有明显的重试途径),方案是最小的(两个文件,每处改动都服务于目标),测试覆盖了新行为而没有过度指定实现细节。在读 diff 之前我的独立方案基本一致——PR 没有遗漏更简的路径。 唯一仔细看过的是去掉 放行 ✅ — Qwen Code · qwen3.7-max |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship. ✅
Manual timeout verificationRun: https://github.com/QwenLM/qwen-code/actions/runs/28325897701 Inputs: Result: passed for the manual timeout override path. The run completed |
| steps.context.outputs.pr_number != '' | ||
| env: | ||
| GH_TOKEN: '${{ secrets.CI_BOT_PAT }}' | ||
| FAILURE_KIND: "${{ steps.review.outputs.failure_kind || '' }}" |
There was a problem hiding this comment.
[Suggestion] The fallback step's if condition (line 630) uses failure(), but when the job-level timeout-minutes: 200 fires, GitHub Actions cancels the job — setting the conclusion to cancelled, not failure. This means failure() evaluates to false and no fallback comment is posted at all, leaving the PR with no bot feedback.
The 20-minute buffer (200 − 180) makes this unlikely in the common case, but it can happen if earlier steps (checkout, npm install, context resolution) consume enough time.
Consider adding || cancelled() to the condition:
| FAILURE_KIND: "${{ steps.review.outputs.failure_kind || '' }}" | |
| if: >- | |
| failure() && cancelled() && |
Note: when using cancelled(), the step runs in a partially-torn-down environment, so you may want to guard gh pr comment with a short timeout or retry.
— qwen3.7-max via Qwen Code /review
doudouOUC
left a comment
There was a problem hiding this comment.
Clean implementation with thorough validation. The timeout parsing is injection-resistant and the differentiated fallback comments are a nice UX improvement. No blocking issues found.
— qwen3.7-max via Qwen Code /review
What this PR does
Adds an explicit timeout override for maintainer-triggered
@qwen-code /reviewcomments. Maintainers can now retry a large PR review with@qwen-code /review --timeout=180or@qwen-code /review timeout=180, while the default review timeout stays at 120 minutes.When a review times out, the fallback PR comment now uses a clearer bold heading and tells maintainers exactly how to rerun the review with a longer timeout. Non-timeout failures still get a generic failure comment without suggesting that more time will help.
Why it's needed
Large PRs can exceed the normal review budget. The current fallback only says the review timed out, which leaves maintainers to infer the next action. This keeps automatic reviews bounded by default while giving maintainers an explicit, auditable way to spend more runner time when a large PR is worth another pass.
Reviewer Test Plan
How to verify
Comment
@qwen-code /review --timeout=180on an open PR and confirm the review step acceptstimeout_minutes=180, giving Qwen 180 minutes while the GitHub Actions job is capped at 200 minutes to leave fallback-comment time. To verify fallback behavior, force the review step to hit the timeout path and confirm the PR comment includes@qwen-code /review --timeout=180.Evidence (Before & After)
Before: timed-out reviews posted a generic italic fallback comment with no retry command. After: timed-out reviews post a bold timeout heading and include the longer-timeout retry command.
Tested on
Environment (optional)
npx vitest run scripts/tests/qwen-resolve-workflow.test.js --config scripts/tests/vitest.config.tspassed.npx prettier --check scripts/tests/qwen-resolve-workflow.test.jspassed.git diff --checkpassed. Localactionlint .github/workflows/qwen-code-pr-review.ymlstill reports the existingenvironment.deployment: falsekey on current main, so it was not used as a passing signal for this change.Manual timeout verification
A workflow_dispatch dry-run was dispatched on PR head SHA
885309cdfa59c797e13d192775c7cbc5e3a35b9dwithtimeout_minutes=121: https://github.com/QwenLM/qwen-code/actions/runs/28325897701. Result: the run completedResolve PR contextand reachedreview-pr / Run review, staying in the actual review step for more than 8 minutes instead of failing the previous 120-minute timeout validation. This verifies that the manual timeout override path accepts a maintainer-provided value above the default 120 minutes; the full dry-run conclusion remains available in the linked run.Risk & Scope
--timeout=180.Linked Issues
中文说明
这个 PR 做了什么
为 maintainer 通过
@qwen-code /review评论触发的评审增加显式超时参数。现在可以用@qwen-code /review --timeout=180或@qwen-code /review timeout=180重新触发大 PR 评审,默认 review 超时时间仍保持 120 分钟。当评审超时时,fallback PR 评论会使用更清晰的加粗标题,并明确告诉 maintainer 如何用更长超时时间重新触发。非超时失败仍然只显示通用失败信息,不误导用户以为增加时间一定有帮助。
为什么需要
大 PR 可能超过默认评审预算。现有 fallback 只说明评审超时,maintainer 需要自己推断下一步怎么做。这个改动保持自动评审默认受限,同时给 maintainer 一个明确、可审计的方式,在确实值得重跑的大 PR 上投入更多 runner 时间。
Reviewer Test Plan
如何验证
在打开的 PR 上评论
@qwen-code /review --timeout=180,确认 review step 接受timeout_minutes=180,也就是 Qwen 可以跑 180 分钟,同时 GitHub Actions job 上限是 200 分钟,保留 fallback 评论收尾时间。要验证 fallback 行为,可以强制 review step 进入 timeout 路径,并确认 PR 评论包含@qwen-code /review --timeout=180。证据(Before & After)
Before:评审超时后只发布一条通用斜体 fallback 评论,没有重跑命令。After:评审超时后发布加粗 timeout 标题,并包含更长超时时间的重跑命令。
测试平台
环境
npx vitest run scripts/tests/qwen-resolve-workflow.test.js --config scripts/tests/vitest.config.ts通过。npx prettier --check scripts/tests/qwen-resolve-workflow.test.js通过。git diff --check通过。本地actionlint .github/workflows/qwen-code-pr-review.yml仍会报告当前 main 已存在的environment.deployment: falsekey,因此没有把它作为本次变更的通过信号。手动 timeout 验证
已在 PR head SHA
885309cdfa59c797e13d192775c7cbc5e3a35b9d上 dispatch 一次 workflow_dispatch dry-run,传入timeout_minutes=121:https://github.com/QwenLM/qwen-code/actions/runs/28325897701。结果:run 已成功完成Resolve PR context并进入review-pr / Run review,在真实 review step 中持续运行超过 8 分钟,而不是被旧的 120 分钟上限校验挡掉。这验证了手动 timeout override 路径可以接受高于默认 120 分钟的 maintainer 指定值;完整 dry-run conclusion 可在链接的 workflow run 中查看。风险和范围
--timeout=180时,review runner 会被占用更久。关联 Issue