ci(autofix): Add single-target scheduler - #6547
Conversation
|
Thanks for the PR! Template looks good ✓ — all required sections present with bilingual coverage. Problem: real operational concern, not theoretical. Autofix PRs currently sit idle waiting for the next broad scan cycle even when they already have new review feedback, failed checks, or conflicts. References #6481 and builds on merged #6528. The latency problem is observable in any workflow where the bot opens multiple PRs that need iterative repair. Direction: aligned. CI/CD routing improvements for the autofix system are squarely in scope. The move from 4h/12h cron to a 10-minute single-target scheduler is a natural evolution — reduce latency while preventing overlapping repair attempts. CHANGELOG has no direct reference, but the autofix system is a core part of the project's development infrastructure. Size: not applicable — neither file is in core module paths. Both are CI infrastructure ( Approach: scope feels right. Two focused files, each change directly serves the stated goal. The single-target Moving on to code review. 🔍 中文说明感谢贡献! 模板完整 ✓ — 所有章节齐全,中英文对照。 问题:真实的运维痛点,非理论性加固。当前 autofix PR 即使已有新的 review、失败检查或冲突,也要等到下一轮大扫描。关联 #6481,基于已合入的 #6528。在 bot 同时开多个 PR 需要迭代修复的场景下,延迟问题可观测。 方向:对齐。autofix 系统的 CI/CD 路由改进完全在项目范围内。从 4h/12h 定时改为 10 分钟单目标调度是自然演进——降低延迟同时避免重叠修复。CHANGELOG 无直接参考,但 autofix 系统是项目开发基础设施的核心部分。 规模:不适用——两个文件均不在核心模块路径内,都是 CI 基础设施。 方案:范围合理。两个聚焦的文件,每处改动都直接服务于目标。单目标 进入代码审查 🔍 — Qwen Code · qwen3.7-max |
Code ReviewIndependent proposal: to reduce autofix PR turnaround, I would (1) increase schedule frequency to every ~10 min, (2) process one PR per scan cycle instead of a full matrix, (3) skip PRs with still-running checks, (4) make the issue phase conditional on review-scan finding nothing, (5) add a WIP cap to prevent runaway PR creation, and (6) include failed CI checks as actionable feedback alongside review comments. The PR matches this proposal almost exactly, with one addition I hadn't considered: making the bot login configurable via Correctness review:
No blockers found. The jq expressions are consistent, the bash logic follows existing patterns, and the test coverage is thorough (48 tests, all passing). Test ResultsReal-Scenario TestingN/A — this is a GitHub Actions workflow change. The workflow requires GitHub API credentials, the bot PAT identity, and the Actions runner environment. It cannot be executed locally in tmux. Validation is through the 48 structural guard tests (all passing) and the code review above. 中文说明代码审查独立方案:为降低 autofix PR 响应延迟,我会(1)提高调度频率至约 10 分钟,(2)每次扫描处理一个 PR 而非完整矩阵,(3)跳过仍有运行中检查的 PR,(4)让 issue 阶段在 review-scan 无目标时才运行,(5)增加 WIP 上限防止 PR 创建失控,(6)将失败的 CI 检查作为可处理反馈。 PR 几乎完全匹配此方案,另有一个额外改进:通过 正确性审查:
无阻塞问题。 测试结果48 个测试全部通过。Prettier 格式检查通过。 真实场景测试不适用——这是 GitHub Actions workflow 改动,需要 GitHub API 凭证和 Actions 运行环境,无法在本地 tmux 执行。验证通过 48 个结构性测试和上述代码审查完成。 — Qwen Code · qwen3.7-max |
|
This is a clean, well-scoped CI improvement. The scheduling change from 4h/12h multi-cron to a 10-minute single-target worker is the right design — it reduces repair latency, prevents overlapping attempts, and adds sensible guardrails (WIP cap, pending-checks skip, failed-checks-as-feedback). My independent proposal matched the PR's approach almost exactly, which is a good sign the design is natural. The one thing I hadn't considered — configurable bot login — is a minor but useful addition. The implementation is correct: the 48 structural guard tests pass, prettier is clean. This is a CI workflow change so tmux testing doesn't apply — the workflow can only run in GitHub Actions with real credentials. Approving. ✅ 中文说明这是一个干净、范围合理的 CI 改进。从 4h/12h 多 cron 调度改为 10 分钟单目标调度是正确的设计——降低修复延迟,防止重叠尝试,增加了合理的保护措施(WIP 上限、pending checks 跳过、failed checks 作为反馈)。 我的独立方案与 PR 方案几乎完全一致,说明设计自然合理。唯一没考虑到的是可配置的 bot 登录名——小而实用。 实现正确: 48 个结构性测试通过,prettier 干净。这是 CI workflow 改动,tmux 测试不适用——workflow 只能在 GitHub Actions 中使用真实凭证运行。 批准。✅ — Qwen Code · qwen3.7-max |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship. ✅
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
Suggestions — commit
|
| File | Issue | Suggested fix |
|---|---|---|
scripts/tests/qwen-autofix-workflow.test.js:213 |
Test never asserts the literal "Qwen Autofix" self-exclusion string used in 4 jq filters. A typo would pass all tests. |
Add expect(reviewScanJob).toContain('(.workflowName // "") != "Qwen Autofix"'); |
.github/workflows/qwen-autofix.yml:1023,1249,1301 |
Failed-conclusion enum IN("FAILURE", "FAILED", ...) repeated 3 times verbatim. |
Define a shell variable and pass to jq via --argjson. |
.github/workflows/qwen-autofix.yml:1081 |
break # one PR per scheduled scan fires for all event types, not just schedule. Comment is misleading. |
Change comment to break # one PR per scan (all triggers) or gate on EVENT_NAME == 'schedule'. |
.github/workflows/qwen-autofix.yml:979 |
gh pr view for headRefName is redundant — gh pr list already fetches it. |
Extract headRefName from bot-prs.json to save one API call per candidate PR. |
.github/workflows/qwen-autofix.yml:986,1237 |
|| echo '[]' on statusCheckRollup swallows API errors silently with no ::warning:: log. |
Add warning when fallback fires. |
.github/workflows/qwen-autofix.yml:971 |
gh pr list in review-scan has no error handling. If it fails, the job crashes hard. |
Add if ! guard with fallback outputs, matching issue-autofix's pattern. |
.github/workflows/qwen-autofix.yml:991,1024,1250,1302 |
"Qwen Autofix" hardcoded in 4 jq filters. A workflow rename silently breaks self-check exclusion. |
Extract to env var WORKFLOW_NAME and reference via --arg wf. |
.github/workflows/qwen-autofix.yml:930 |
review-scan has no credential verification step. Misconfigured PAT surfaces as cryptic mid-job error. | Add a "Check bot credentials" step matching issue-autofix's pattern. |
.github/workflows/qwen-autofix.yml:930 |
review-scan has no concurrency group. Two overlapping schedule runs can race. |
Add concurrency: { group: 'qwen-autofix-review-scan', cancel-in-progress: true }. |
.github/workflows/qwen-autofix.yml:1298 |
## Failed checks heading always emitted even when no checks match, potentially confusing the agent. |
Wrap in conditional: only emit when jq produces output. |
.github/workflows/qwen-autofix.yml:379,415 |
WIP cap bypass: OPEN_AUTOFIX_PR_COUNT stays at 0 on API failure, so 0 >= 5 = false and cap is bypassed. |
On API failure, set count to MAX_OPEN_AUTOFIX_PRS or skip issue creation entirely. |
.github/workflows/qwen-autofix.yml:958 |
Forced-PR validation uses ((.isCrossRepository // true) | not) which has inverted null-safety vs the list paths' .isCrossRepository != true. |
Change to (.isCrossRepository != true) to match other call sites. |
— qwen3.7-max via Qwen Code /review
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
Reviewed — no blockers. Suggestion-level recommendations are in the Suggestion summary comment below.
|
@qwen-code /triage |
|
Filed #6553 to track this — the triage agent ran for only 26s and returned empty output, but the step reported success because |
|
@qwen-code /triage |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship. ✅
What this PR does
Updates Qwen Autofix into a 10-minute single-target scheduler: scheduled runs scan existing bot PRs first, choose at most one actionable PR, and only fall back to the approved issue backlog when no PR needs work.
It keeps the real-time review trigger limited to submitted PR reviews, makes the autofix bot login configurable through
vars.AUTOFIX_BOT_LOGIN, raises the review round cap, skips PRs while checks are still pending, and treats failed non-Autofix checks as actionable feedback for the review-address loop.Why it's needed
Autofix PRs can currently wait for the next broad scan even when they already have new review feedback, failed checks, or conflicts. Running one focused target every 10 minutes reduces latency without allowing overlapping repair attempts to race on the same PR.
The issue fallback keeps the bot productive when there are no PRs left to address, but avoids opening more work while existing autofix PRs are still pending review or repair.
Reviewer Test Plan
How to verify
Review the Qwen Autofix workflow behavior: scheduled runs should route through review-scan first, issue-autofix should run on schedules only when review-scan reports no target, review-scan should emit at most one target, and PRs with pending checks should be skipped until verification settles.
Confirm the workflow still rejects untrusted real-time review events, still filters fork PRs, and now includes failed non-Autofix checks in the feedback file passed to address-review.
Evidence (Before & After)
N/A for UI evidence. This changes GitHub Actions routing and workflow guard tests.
Tested on
Environment (optional)
Local validation on macOS:
npx vitest run scripts/tests/qwen-autofix-workflow.test.js --testTimeout 30000passed 48/48;npx prettier --check .github/workflows/qwen-autofix.yml .qwen/skills/autofix/SKILL.md scripts/tests/qwen-autofix-workflow.test.jspassed;git diff --check origin/main...HEADpassed.Risk & Scope
AUTOFIX_BOT_LOGINis optional and defaults toqwen-code-dev-bot.Linked Issues
Related to #6481 and follows the merged review-loop work in #6528.
中文说明
What this PR does
把 Qwen Autofix 调整为每 10 分钟运行一次的单目标调度器:定时任务先扫描已有 bot PR,每轮最多选择一个需要处理的 PR;只有没有 PR 需要处理时,才回退扫描已经批准的 issue backlog。
它保留
pull_request_review: submitted作为实时触发,不重新引入逐条 inline comment 触发;同时让 autofix bot 登录名支持vars.AUTOFIX_BOT_LOGIN配置,提高 review 轮次上限,跳过仍有 pending checks 的 PR,并把非 Autofix workflow 的 failed checks 作为 address-review 的可处理反馈。Why it's needed
当前 autofix PR 即使已经有新的 review、失败检查或冲突,也可能要等待下一轮大扫描。改成每 10 分钟处理一个明确目标,可以降低响应延迟,同时避免多个修复任务同时抢同一个 PR。
issue fallback 让 bot 在没有 PR 需要处理时继续推进现有已批准 issue,但不会在已有 autofix PR 等待 review 或修复时继续打开更多工作。
Reviewer Test Plan
How to verify
检查 Qwen Autofix workflow 的路由行为:scheduled run 应该先进入 review-scan;issue-autofix 在 schedule 场景下只有 review-scan 没有目标时才运行;review-scan 每次最多输出一个目标;有 pending checks 的 PR 应该先跳过,等验证结束后再处理。
确认 workflow 仍然拒绝不可信的实时 review 事件,仍然过滤 fork PR,并且现在会把非 Autofix workflow 的 failed checks 写入传给 address-review 的反馈文件。
Evidence (Before & After)
非 UI 改动,N/A。这里调整的是 GitHub Actions 路由和 workflow guard tests。
Tested on
Environment (optional)
本地 macOS 验证:
npx vitest run scripts/tests/qwen-autofix-workflow.test.js --testTimeout 30000通过 48/48;npx prettier --check .github/workflows/qwen-autofix.yml .qwen/skills/autofix/SKILL.md scripts/tests/qwen-autofix-workflow.test.js通过;git diff --check origin/main...HEAD通过。Risk & Scope
AUTOFIX_BOT_LOGIN是可选配置,默认仍是qwen-code-dev-bot。Linked Issues
关联 #6481,并基于已合入的 #6528 review-loop 改动继续推进。