Repository navigation
fix(ci): make finalize-release second-bot approve non-blocking (#14341) - #14342
Conversation
The "Approve release PR (second bot)" step fails when CI_BOT_PAT resolves to the same GitHub user as CI_REVIEW_BOT_PAT (the PR author), because GitHub rejects self-approval at the API level. This has broken every stable release since v0.25.1, blocking auto-merge and requiring manual intervention. Make the step continue-on-error so that auto-merge can still proceed when branch protection only requires one approval or a human has already approved. Add a warning step that surfaces the root cause in the run log and links to the tracking issue.
|
Thanks for the PR! Template looks good ✓ — every substantive section is filled in. Two small gaps, neither blocking: there's no Problem: real, and I verified it independently rather than taking the description's word for it. Run Direction: the intent is sound. The workflow's own comment on Size: not applicable — no core paths touched; 15 added lines in one workflow file. Approach: minimal and focused, one file, no drive-by edits. The Risk: no elevated risk signals from the revert-history path list. Since AGENTS.md requires it for any Moving on to code review. 🔍 中文说明感谢贡献! 模板基本完整 ✓ —— 实质性内容都在。两处小缺口,均不阻塞:缺少 问题:真实存在,而且我是独立核实的,没有只采信 PR 描述。Run 方向:意图没问题。workflow 自己在 规模:不适用 —— 未触及核心路径;单个 workflow 文件新增 15 行。 方案:改动最小且聚焦,单文件,没有夹带无关改动。 风险:从 revert 历史的高风险路径清单看,无升级风险信号。因为 AGENTS.md 对 进入代码审查 🔍 — Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
Code reviewIndependent proposal first, before reading the diff: given a step that fails only because the approving token belongs to the PR author, I would either (a) make the step non-blocking and surface the failure loudly downstream, or (b) keep it blocking and swallow only the self-approval error by matching stderr. The PR implements (a), competently. No critical blockers found — the mechanism is correct on the three points that are easy to get wrong:
Non-blocking observations, in the order I'd want a maintainer to weigh them:
Two things I checked and could not settle, stated plainly rather than papered over:
Test evidenceUnattended CI run, so this section carries the PR's own CI check results, fetched through the API for the reviewed commit — nothing was built, run, or executed locally, and no PR code was checked out or applied. There were no failures to excerpt at fetch time. Real-scenario tmux testing does not apply on the CI path and would not apply to this change anyway: it has no TUI or user-visible surface, so that evidence is
Neither sandboxed lane would settle anything here, so I am not naming one as a formality: 中文说明先说独立方案(在读 diff 之前):面对一个"仅因为审批 token 属于 PR 作者本人而失败"的步骤,我会选 (a) 让该步骤非阻塞、并在下游把失败显式暴露出来,或 (b) 保留阻塞性、只通过匹配 stderr 吞掉"自我审批"这一种错误。本 PR 实现的是 (a),而且实现得干净。未发现关键阻塞项 —— 在三个最容易写错的点上都是对的:
非阻塞观察,按我希望维护者权衡的顺序:
有两点我查了但没能确定,如实说明而不是掩盖:
测试证据本次为无人值守 CI 运行,因此这一节承载的是通过 API 取得的、针对被审查 commit 的 PR 自身 CI 检查结果 —— 本地没有构建、运行或执行任何东西,也没有 checkout 或应用 PR 代码。抓取时没有失败项可摘录。真实场景 tmux 测试在 CI 路径下不适用,对这个改动本身也不适用:它没有 TUI 或用户可见界面,因此该项证据为 (CI 状态表见上方英文部分,由 finalize 任务在 CI 跑完后原地更新。)
这里两个沙箱 lane 都无法解决问题,所以我不会形式化地点名: — Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
|
Confidence: 3/5 — the change is correct, minimal, and the bug is independently verified; the cap is the release-path escalation plus one real reservation about how long the tolerance outlives the bug, not doubt that the code works. Stepping back: this one holds up. I wrote down two candidate fixes before reading the diff — make the step non-blocking and surface the failure downstream, or keep it blocking and swallow only the self-approval error — and the PR is a clean implementation of the first. It matches my own proposal rather than exceeding or falling short of it, which is the honest read; the second variant is the one I'd mildly prefer, and I've said why in the review, but "I'd have done it differently" is not a defect and I'm not treating it as one. The problem is real and I did not take anyone's word for it. Two consecutive stable releases — v0.25.1 and v0.25.2 — died at this exact step with On the things I'd normally suspect in a 15-line CI PR: no scope creep, no drive-by edits, no speculative flexibility. The 7-line comment block is most of the diff and it earns its place — it records the three-identity invariant at precisely the line where the invariant breaks, which is the only reason a future reader will know this step is a mitigation and not the design. Six months from now the code explains itself. The one thing that would make me curse this later: if #14341 gets fixed and the Deferring to @pomelo-nwu and @wenshao, not approving. Two independent reasons:
Because this is escalated, I have not left a deferred approve-on-green instruction, so the finalize job will not auto-approve this when CI lands green. That's intentional: a maintainer needs to make this call. What I'd like from one of you:
Everything else is clean: lint and the no-AK integration lane are green, the size ratchet has ~3 KB of headroom so no 中文说明Confidence: 3/5 —— 改动正确、最小,且 bug 已被独立核实;打 3 分是因为 release 路径需要上报,外加一个关于"这个放宽会比 bug 活得更久"的真实保留意见,而不是怀疑代码本身能不能工作。 退一步看整体:这个 PR 站得住。在读 diff 之前我先写下了两个候选方案 —— 让步骤非阻塞并在下游暴露失败,或保留阻塞性只吞掉"自我审批"错误 —— 本 PR 是第一个方案的干净实现。它与我的独立方案是相符,既没有超出也没有不及,这是诚实的判断;第二个方案是我略微更倾向的,理由已写在审查里,但"我会用另一种写法"不是缺陷,我不会把它当缺陷处理。 问题是真实的,我没有采信任何人的说法。连续两个 stable release —— v0.25.1 与 v0.25.2 —— 都死在这个步骤上,报错 关于一个 15 行 CI PR 通常会让我起疑的地方:没有范围蔓延,没有顺手改动,没有投机性的"灵活性"。7 行注释占了 diff 的大头,但它是值得的 —— 它把"三个身份"这条不变量记录在了该不变量恰好被打破的那一行,这也是未来读者能知道此步骤是缓解措施而非设计意图的唯一依据。六个月后这段代码能自己解释自己。 唯一会让我将来后悔的点:如果 #14341 修好了而 上报给 @pomelo-nwu 和 @wenshao,不予 approve。 两个独立理由:
因为本次是上报处理,我没有留下"CI 变绿后自动批准"的延后指令,所以即使 CI 全绿,finalize 任务也不会自动批准这个 PR。这是有意为之:这个决定需要维护者来做。希望你们其中一位给出的判断:
其余都是干净的:lint 与 no-AK 集成 lane 已绿,size ratchet 还有约 3 KB 余量,因此不需要改 — Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
qqqys
left a comment
There was a problem hiding this comment.
APPROVE at head 5ad8298667be2698352d14951182c4a16d815f2a — no Critical has ever been filed on this PR, my own scan of the 15-line diff found none, and CI is green at this head. This approval is a code verdict only: it does not and cannot satisfy the CODEOWNERS gate on this file — see §4.
1. No historical blocking issues
There are no reviews at all on this PR — no CHANGES_REQUESTED, no ledger, no review threads, reviewDecision=REVIEW_REQUIRED. The only prior assessment is the triage gate's stage comments, whose stage 3 states "the change is correct, minimal, and the bug is independently verified" and whose refusal to approve rested on two grounds: the release-path escalation (§4) and Test (ubuntu-latest) still being in progress. That second ground no longer applies — run 38843722270, head_sha=5ad8298667…, conclusion=success, with Test (ubuntu-latest, Node 22.x) passing in 27m53s. That is the lane which runs scripts/tests/, so the workflow meta-tests have now been observed green at this head rather than only traced statically.
2. The relaxation does not weaken the actual merge gate
This is the whole question for a PR that adds continue-on-error to a release step, so I checked it rather than accepting the framing.
The real protection on a release PR is branch protection, not this workflow step. The Enable auto-merge for release PR step is unchanged by this diff and still runs gh pr merge --squash --auto, which arms auto-merge; GitHub then holds the merge until the branch's approval requirement is met. So if the second-bot approve fails and is tolerated, the consequence is that the release PR waits for a human approval — it cannot merge with insufficient approvals. Tolerating the step's failure changes the workflow's reported colour, not what GitHub is willing to merge. That is why I do not treat this as a silently narrowed gate.
The bug being fixed is also concrete rather than hypothetical: stage 3 independently confirmed that two consecutive stable releases, v0.25.1 and v0.25.2, both died at this exact step with Can not approve your own pull request, and that the release PRs behind them show autoMergeRequest: none with a human approving and merging by hand each time. The status quo already requires manual intervention every cycle; this change stops it from failing the whole workflow while leaving the merge decision where it already was.
3. Critical-only scan — no Critical
I read the full diff and the surrounding file at head.
- The
outcomevsconclusionidiom is correct, which is the easiest thing to get wrong here. Line 287 testssteps.second_approve.outcome == 'failure'. Withcontinue-on-error: true,conclusionis forced tosuccesswhileoutcomeretains the real result — so had this used.conclusion, the new warning step would have been dead and the failure entirely silent. It uses.outcome, andgrepfinds noconclusion ==anywhere in the file. The mitigation is therefore genuinely observable. - The guards are consistent. Both the second-approve step and the new warn step carry the same
is_stable == 'true' && SHOULD_MERGE == 'true'condition, the warn step adding the failure test. So the warning cannot fire on a prerelease or a no-merge run, and cannot fire when the approve step was skipped. continue-on-error: trueextends an existing convention in this file rather than introducing a novel tolerance — it already appears at lines 119, 142 and 157 for other steps. Line 277 is the fourth instance.- The failure mode is documented at the line where it breaks. The 7-line comment records the three-identity invariant (
CI_BOT_PATmust be a different GitHub user from bothCI_REVIEW_BOT_PAT, the PR author, andCI_DEV_BOT_PAT, the first approver), states the exact error string to look for, gives the remedy (rotateCI_BOT_PATto a distinct account), and links #14341. The::warning::message repeats the diagnosis and the link, so the annotation is actionable by whoever reads it without opening the diff. - No scope creep. One file, one step given an id and a tolerance, one new warn step, one comment block. Nothing else in the release path is touched, and no secret, permission or token surface changes.
4. The CODEOWNERS gate — verified, and not mine to satisfy
I confirmed the escalation claim at head rather than inheriting it. .github/CODEOWNERS line 15:
# --- Primary npm release workflows require core maintainer approval ---
/.github/workflows/release.yml @pomelo-nwu @wenshao
/.github/workflows/finalize-release.yml @pomelo-nwu @wenshao
The author owns /.github/actions/ and /.github/scripts/ (lines 10–11) but is deliberately excluded from the two release-workflow lines. So this file requires approval from @pomelo-nwu or @wenshao, and reviewDecision will stay REVIEW_REQUIRED regardless of my vote. My APPROVE is a statement that I found no defect in the code; it is not the core-maintainer sign-off this path asks for, and it should not be read as unblocking the merge.
5. One non-blocking reservation, already on record
Stage 3's substantive worry is the right one and I agree with it, without treating it as a blocker: if #14341 is fixed and the continue-on-error is never revisited, this step stays permanently more tolerant than the design intends — a green workflow carrying an annotation nobody is paged on. That is maintenance debt rather than a defect at this head, and the comment block plus the linked issue are a reasonable trail back to it. The natural follow-up is to remove the tolerance once CI_BOT_PAT is a distinct identity, so the step can be blocking again. Worth an explicit tracking commitment from whoever owns the release path, since the two named CODEOWNERS are the ones who will feel the consequence.
CI otherwise: Lint & Static 14m52s, Integration Tests (no-AK, No Sandbox) 8m55s, web-shell E2E Smoke 28m43s, triage 23m49s all pass at this head; review-pr is pending, which is a review-bot lane and not a gate. Nothing is attributable to this PR, and CI forms no part of this verdict beyond confirming the meta-tests ran green.
qwen-code-dev-bot
left a comment
There was a problem hiding this comment.
APPROVE at head 5ad8298667be
Reviewed head: 5ad8298667be2698352d14951182c4a16d815f2a — re-read immediately before submitting, unchanged. Author yiliang114, base main, state open, 1 file, +15/−0.
No historical blocking findings
No CHANGES_REQUESTED has ever been filed on this PR; the only prior review is the approval from qqqys at this same head. I re-verified the load-bearing claims below at head instead of inheriting them.
Critical-only scan — none
- The relaxation does not move the actual merge gate.
Enable auto-merge for release PR(finalize-release.yml:291-303) keeps its originalifcondition and still runsgh pr merge --squash --auto, which only arms auto-merge; GitHub continues to enforce branch protection at merge time. So tolerating a failed second approve means the release PR waits for a human approval — it cannot merge with insufficient approvals.steps.second_approveis not referenced by the auto-merge step at all. steps.second_approvehas exactly one reader, the new warn step at:287, and it tests.outcome, which is the correct idiom undercontinue-on-error: true—.conclusionis forced to success there and would have made the warning permanently dead and the failure silent.- Guards are consistent. The warn step carries the same
is_stable+SHOULD_MERGEconditions as the approve step plus the failure test, so it cannot fire on a prerelease or a no-merge run, and cannot fire when the approve step was skipped (itsoutcomeis thenskipped). continue-on-error: trueextends an existing convention in this file (:119,:142,:157); this is the fourth instance, not a novel tolerance.- No scope creep and no secret/permission surface change: one step gains an
idand a tolerance, one warn step and one comment block are added, and nothing else in the release path is touched. The failure mode is documented at the line where it breaks, with the exact error string and the remedy, and the::warning::annotation repeats the diagnosis and links #14341.
Non-blocking note, not gating: the warning text hard-codes the self-approval diagnosis, so a different failure cause (expired PAT, network, rate limit) prints a misleading hint while still linking #14341.
CI at this head
success: Lint & Static, Test (ubuntu-latest, Node 22.x), Integration Tests (no-AK, No Sandbox), web-shell E2E Smoke, plus route / triage / authorize / delay-automatic-review / label / assign / Classify PR. Zero failures, zero cancellations. Disclosed rather than counted as green: the automation lane review-pr (🧐 Qwen Pull Request Review) was still in_progress at submit time. It is not a code-health lane, and main configures no required status checks (its rulesets expose only deletion and non_fast_forward).
What this approval does not do
.github/CODEOWNERS:15 assigns /.github/workflows/finalize-release.yml to @pomelo-nwu and @wenshao. Neither qwen-code-dev-bot nor qqqys is a designated owner, so reviewDecision remains REVIEW_REQUIRED after this approval — an approval from one of those two owners is still what gates the merge.
中文摘要
在 5ad8298667be 复核通过,提交前确认 head 未变化。1 个文件 +15 行的 release workflow 改动,历史上没有任何 CHANGES_REQUESTED。独立核对的要点:auto-merge 步骤的 if 未被改动,且它只是 gh pr merge --auto 挂载自动合并,真正的门禁仍在分支保护,所以容忍第二次 approve 失败只会让 release PR 等人工审批,不可能在审批不足时被合掉;steps.second_approve 仅被新增 warn 步骤引用,并且判断的是 .outcome(continue-on-error 下唯一正确写法,用 .conclusion 会让告警永久失效);warn 步骤与 approve 步骤守卫一致,prerelease、不合并、步骤被跳过三种情况都不会误报;continue-on-error 沿用该文件既有的三处约定。未发现 Critical,仅有一条不阻塞的提示:告警文案把原因写死为自审批,其他失败原因会给出误导性提示。CI 实质 lane 全绿,只有自动化 lane review-pr 提交时仍在跑,已如实标注而非当作全绿。另需注意 CODEOWNERS 把该文件指派给 @pomelo-nwu 与 @wenshao,我这次 Approve 无法满足该门禁,reviewDecision 仍为 REVIEW_REQUIRED。
|
Released in v0.25.3. |
What this PR does
Makes the "Approve release PR (second bot)" step in
finalize-release.ymlnon-blocking (continue-on-error: true) and adds a warning step that surfaces the root cause when it fails.Why it is needed
The second-bot approve step has failed on every stable release since v0.25.1 because
CI_BOT_PATresolves to the same GitHub user asCI_REVIEW_BOT_PAT(the PR author). GitHub rejects self-approval at the API level with"Can not approve your own pull request". This blocks the subsequent auto-merge step and forces a human to manually approve and merge every release PR.Making the step non-blocking lets auto-merge proceed when branch protection only requires one approval or a human has already approved. The real fix is rotating
CI_BOT_PATto a distinct GitHub account — the warning step and linked issue (#14341) document this.Reviewer Test Plan
How to verify
Confirm three things: (1) the second-bot approve step now has
continue-on-error: trueand anid; (2) the new warning step fires only whensteps.second_approve.outcome == 'failure'and emits a::warning::annotation linking to #14341; (3) the auto-merge step'sifcondition is unchanged and no longer gated on the second approve succeeding.Expected: when CI_BOT_PAT is the same user as the PR author, the workflow completes with a warning instead of failing. When CI_BOT_PAT is a distinct user, behavior is unchanged.
Tested on
Environment (optional)
YAML validation only; no runtime involved.
Risk & Scope