fix(ci): create remote-tracking ref for fork PRs in autofix verify gate - #7281
Conversation
The verification gate compares origin/${BRANCH}...${BRANCH} to detect
new commits, but fork PRs fetch via URL into FETCH_HEAD without creating
the remote-tracking ref. The git-diff fatal error is misread as "branch
changed", failing the gate when the agent correctly wrote no-action.md.
|
Thanks for the PR! Template: the body uses Problem: observed bug with evidence. The Direction: aligned. This is a CI infrastructure bug fix for the autofix pipeline. No product direction concern. Size: not applicable — Approach: minimal and correct. One Moving on to code review. 🔍 中文说明感谢贡献! 模板: PR 正文使用了 问题: 已观测到的 bug,附有证据。验证门控(第 2448 行)对 fork PR 执行 方向: 对齐。这是 autofix 流水线的 CI 基础设施修复,无产品方向疑虑。 规模: 不适用—— 方案: 最小且正确。在 fork checkout 后添加一行 进入代码审查 🔍 — Qwen Code · qwen3.7-max Reviewed at |
Code ReviewIndependent proposal (before reading the diff): the verification gate at line 2448 uses PR's approach matches exactly. One line added after the fork checkout, with a clear comment explaining the purpose.
No critical issues. No AGENTS.md violations. Real-Scenario TestingThis is a CI workflow change — the fix runs inside GitHub Actions on the autofix runner, not in a local terminal. Tmux testing is not applicable here. Verification is through:
中文说明代码审查独立方案(阅读 diff 前):验证门控(第 2448 行)使用 PR 的方案完全一致。 在 fork checkout 后添加一行,附有清晰的注释说明目的。
无关键问题,无 AGENTS.md 违规。 真实场景测试这是 CI 工作流变更——修复在 GitHub Actions 的 autofix runner 内运行,不在本地终端。Tmux 测试不适用。验证通过以下方式:
— Qwen Code · qwen3.7-max Reviewed at |
|
Confidence: 5/5 — clean across every stage; minimal, correct fix for a real CI bug. This is exactly what a good infrastructure fix looks like. The problem is real and well-documented (linked CI failure), the root cause is correctly identified (missing remote-tracking ref for fork PRs), and the fix is the minimal one-line change that makes the fork checkout path produce the same ref state that same-repo checkouts already have. My independent proposal was identical — The only minor note is the template heading mismatch ( Approving. ✅ 中文说明置信度:5/5 — 各阶段均通过;最小化、正确的 CI bug 修复。 这正是一个好的基础设施修复应有的样子。问题真实且有据可查(已关联 CI 失败记录),根因正确定位(fork PR 缺少远程跟踪 ref),修复方案是一行最小改动,使 fork checkout 路径产生与同仓库 checkout 一致的 ref 状态。 我的独立方案完全一致——在 fork checkout 后使用 唯一的小问题是模板标题不匹配( 批准。✅ — Qwen Code · qwen3.7-max Reviewed at |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship. ✅
|
Released in v0.20.1. |
|
[API Error: Connection error. (cause: fetch failed)] ❌ failed |
Motivation
The autofix
review-addressverification gate fails on every fork PR. The gate runsgit diff --quiet "origin/${BRANCH}...${BRANCH}"to detect whether the agent produced new commits, but fork branches are fetched via URL intoFETCH_HEADand checked out locally — the remote-tracking reforigin/${BRANCH}is never created. The resultingfatal: ambiguous argumentis misread as "branch changed", and the gate then fails becauseaddress-summary.mdis absent (the agent correctly wroteno-action.md).Observed in run 29718309973, job 88279014933 for PR #7265 (
fix/wake-repaintfromwenshao/qwen-code).Changes
Add
git update-ref "refs/remotes/origin/${BRANCH}" "${BRANCH}"immediately after the fork checkout, so the verification gate's no-change detection works identically for fork and same-repo branches.How to verify
Trigger an autofix
review-addressrun against any fork PR where the agent writesno-action.md. The gate should detect "no new commits" and exit withoutcome=noopinstead of failing.