-
Notifications
You must be signed in to change notification settings - Fork 2.9k
fix(review): keep the blocker in a COMMENT body every softening path reaches #9416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2143,20 +2143,24 @@ function composeReviewBody( | |
| event = 'COMMENT'; | ||
| } | ||
|
|
||
| // Presubmit downgrades apply after the caps and only when the verdict | ||
| // they name is the one on the table. | ||
| // Presubmit downgrades apply after the caps and only when the verdict they | ||
| // name was the one on the table — `baseEvent` is the row before every cap, | ||
| // so a softening cap that ran first cannot erase the presubmit's reasons. | ||
| let downgraded = false; | ||
| let downgradedFrom: 'Approve' | 'Request changes' | null = null; | ||
| if (event === 'APPROVE' && downgradeApprove) { | ||
| if ( | ||
| (event === 'APPROVE' || (baseEvent === 'APPROVE' && event === 'COMMENT')) && | ||
| downgradeApprove | ||
| ) { | ||
| event = 'COMMENT'; | ||
| downgraded = true; | ||
| downgradedFrom = 'Approve'; | ||
| } else if ( | ||
| (event === 'REQUEST_CHANGES' || | ||
| (baseEvent === 'REQUEST_CHANGES' && criticalsUnverified)) && | ||
| (baseEvent === 'REQUEST_CHANGES' && event === 'COMMENT')) && | ||
| downgradeRequestChanges | ||
| ) { | ||
| // The unverified-blockers cap softened the event first, but the presubmit | ||
| // A softening cap moved the event first, but the presubmit | ||
| // still ruled: without this arm its reasons (self-PR, failing CI) would | ||
|
Comment on lines
+2163
to
2164
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion] The derived treatment this diff gives the RC presubmit arm is not carried to the sibling arm directly above it: Witness (probe in the real vitest harness): Applying the derived gate flips the capped arm to Suggested fix (two locations — arm 1's condition, plus a regression test pairing a capped zero-finding run with if (
(event === 'APPROVE' ||
(baseEvent === 'APPROVE' && event === 'COMMENT')) &&
downgradeApprove
) {
downgraded = true;
downgradedFrom = 'Approve';
}中文说明本 diff 给 RC presubmit 分支的推导式处理没有传导到它正上方的姊妹分支: 证据(真实 vitest 探针):cap 组 建议修复(两处——分支 1 的条件,外加一个把「带 cap 的零发现运行 + if (
(event === 'APPROVE' ||
(baseEvent === 'APPROVE' && event === 'COMMENT')) &&
downgradeApprove
) {
downgraded = true;
downgradedFrom = 'Approve';
}— qwen3.8-max via Qwen Code /review (v0.21.13) |
||
| // silently vanish from the body whenever both held. The verdict line | ||
| // keeps the unverified sentence — the more fundamental defect — and the | ||
|
|
@@ -3289,10 +3293,20 @@ function composeReviewBody( | |
| clauses.push(...continuityBlock); | ||
|
|
||
| // 7. Body Criticals — on a COMMENT that stands where a REQUEST_CHANGES | ||
| // would have been: the presubmit carve-out, and the unverified-blockers | ||
| // cap. Either way the body copy is the ONLY copy of an unanchorable | ||
| // would have been. The body copy is the ONLY copy of an unanchorable | ||
| // blocker, and softening the event must never erase it. | ||
| if (downgradedFrom === 'Request changes' || criticalsUnverified) { | ||
| // | ||
| // DERIVED, not enumerated. The condition was a list of the two | ||
| // softening flags known when it was written — the presubmit carve-out | ||
| // and `criticalsUnverified` — and a third path shipped past it: the | ||
| // findings-file `— [unverified]` tag softens a Request changes at the | ||
| // event line above while setting NEITHER flag, so a run whose coverage | ||
| // was proven posted a 239-character body carrying the opener and the | ||
| // tag disclosure and no blocker at all. `baseEvent` is the row before | ||
| // every cap and downgrade, so this comparison asks the question the | ||
| // clause is actually about, and answers it for softening paths that do | ||
| // not exist yet. | ||
| if (baseEvent === 'REQUEST_CHANGES' && event === 'COMMENT') { | ||
| clauses.push(...bodyCriticalBlock); | ||
|
Comment on lines
+3309
to
3310
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion] This widening falsifies the pre-existing comment at compose-review.test.ts:6734-6737, which still asserts the pre-fix behavior: "(clause 7 rides on Witness: probe — a tag-route body with a 70k-char blocker reaches the trim cut ( Suggested fix: rewrite that comment paragraph to the post-fix semantics, e.g. 中文说明本次放宽使 compose-review.test.ts:6734-6737 处的既有注释失真:该注释仍断言修复前的行为 ——「(clause 7 rides on 证据:探针 —— 修复后,携带 7 万字符阻断项的 tag 路径正文会到达裁剪切口( 建议修复:将该注释段落改写为修复后的语义,例如: — qwen3.8-max via Qwen Code /review (v0.21.13) |
||
| } | ||
|
Comment on lines
+3309
to
3311
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion] The presubmit recovery arm ( Witness: probe — PROBE-A (tag path): Suggested fix: 中文说明presubmit 恢复分支(约 2153-2157 行)仍只枚举 证据:探针 —— PROBE-A(tag 路径): 建议修复:改为 — qwen3.8-max via Qwen Code /review (v0.21.13) |
||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Suggestion] The test pins only one of the two flags its comment claims absent: it never asserts
criticalsUnverifiedis false. All five assertions are satisfiable withcriticalsUnverified === true(both cap names are pushed independently, compose-review.ts ~2040-2043), and the sibling test 'softens a Request changes whose blockers are non-deterministic' (~line 7058) pins exactly this premise under the same harness. — Failure scenario: a future drift flippingcriticalsUnverifiedtrue in this fixture (digest keying inverificationGaps/recordStep45, thecoveredPlantranscript shape) leaves the test green — and would also leave it green against the reverted old condition (that flag satisfies|| criticalsUnverified) → the 239-character-body bug this PR fixes regresses with no red test.Witness: probe — reverted condition +
criticalsUnverifiedflipped true passes all five original assertions; adding the suggested assertion turns it red (expected [ 'unreviewed-dimension', …(2) ] to not include 'criticals-unverified'); with the PR's code it passes.中文说明
该测试只钉住了其注释声称缺席的两个标志之一:它从未断言
criticalsUnverified为 false。当criticalsUnverified === true时全部五条断言仍可满足(两个 cap 名称是独立推入的,见 compose-review.ts 约 2040-2043 行),而姊妹测试「softens a Request changes whose blockers are non-deterministic」(约 7058 行)在同一夹具下恰好钉住了这一前提。失败场景:未来某次漂移使该夹具中criticalsUnverified变为 true(verificationGaps/recordStep45的摘要键控、coveredPlan的 transcript 形态)时,测试仍然为绿 —— 而且对回退后的旧条件同样为绿(该标志满足|| criticalsUnverified)→ 本 PR 修复的 239 字符正文问题会在没有任何红色测试的情况下回归。证据:探针 —— 回退条件并把
criticalsUnverified翻为 true 后,原有五条断言全部通过;加上建议的断言后变红(expected [ 'unreviewed-dimension', …(2) ] to not include 'criticals-unverified');在 PR 代码下该断言通过。— qwen3.8-max via Qwen Code /review (v0.21.13)