Repository navigation
Conversation
…owner cleared it on When an engineering or design owner removed the advisory label after the push that made the current head, a later event at that head (ready for review, a reopen) leaves it off and says so in the job summary. A push after the removal, a non-owner's removal, or an unreadable timeline adds it as before.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report
Generated by PR Enrichment workflow | View current CI run |
There was a problem hiding this comment.
This pull request is not ready for approval: it needs an owner decision on behaviour no spec records, and it has an ordering defect to fix.
No current spec decides whether an engineering or design owner's manual removal of needs:design-review keeps review-signal from adding it back on later events at the same head, so approval needs an engineering owner to provide or identify the governing spec for that behaviour. An engineering owner records the decision by commenting /approve-spec <full head SHA> on the pull request, and the author may do so as an engineering owner.
Blocking findings:
ownerRemovedLabelAtHeadtreats a regular push of a commit dated before an owner's removal as the head that owner cleared, because GitHub lists pushed commits in the timeline by committer date rather than push time, so the label stays off a head no owner has seen (.github/scripts/review-signal-decision.cjs:145-160, reproduced on #11740's timeline).- The description's "a push after the removal adds it as before" and "a removal never carries to another commit" are proven only for push-ordered timelines, so fix the ordering so they hold or narrow the wording.
Comparing the removal's time with the head's push time, for example the head's earliest review-required status, and adding a test whose head commit is listed before an earlier removal would close the defect.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim: an owner's removal at the current head keeps the label off at later events on that head — verified by the new decision and workflow tests and a replay of #11539's timeline.
- Claim: a push or force push after the removal adds the label again — false for a regular push of a commit dated before the removal (replay of #11740's ordering); true for a force push.
- Claim: a removal by someone who is not an owner does not count — verified by tests.
- Claim: an unreadable timeline adds the label with a warning — verified by test and
review-signal.yml:688-690. - Claim: the reason is written to the job log and the job summary — verified at
review-signal.yml:692-695; the summary write is not exercised by tests. - Claim: the helper loads from the trusted workflow commit — verified at
review-signal.yml:305-319. - Claim: design-affecting detection, the design-owner review, the code gate,
review-requiredand the owner lists are unchanged — verified from the diff. - Claim: on #11539 a ready-for-review event re-added the label an owner had removed at the same head — verified from its timeline.
- Claim: 118 tests pass and the 6 new behaviour cases fail without this change — verified.
- Claim: actionlint and prettier pass — prettier verified; actionlint not run in this review.
- Claim: one extra paged API read, only for a design-affecting pull request without the label, and no job or required-check change — verified from the diff.
- Claim: no current spec decides when the label is added back — verified.
- Claim: the open security pull request does not touch the label step — verified from its patch.
- File
.github/scripts/review-signal-decision.cjs— first blocking finding. - File
.github/workflows/review-signal.yml— clear apart from the helper's effect. - File
.github/scripts/review-signal-decision.test.mjs— second blocking finding (push-ordered timelines only). - File
.github/scripts/review-signal-workflow.test.mjs— second blocking finding (push-ordered timelines only).
…ne's commit order A pushed commit appears in the timeline at its committer date, so a commit made before an owner's removal and pushed after it sorted before the removal. The head's arrival is now the earliest trusted review-required status on it; with none, the removal does not count.
There was a problem hiding this comment.
This pull request is not ready for approval yet: it needs an owner decision on behaviour no spec records, and two findings to fix.
No current spec decides whether an engineering or design owner's manual removal of needs:design-review keeps review-signal from adding it back on later events at the same head, so approval needs an engineering owner to provide or identify the governing spec for that behaviour. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner.
Blocking findings:
- A head that returns to an earlier commit (A, then B, then a force push back to A) is dated from that commit's first
review-requiredstatus, so an owner's removal made while B was the head keeps the label off A and the job summary says it was removed "at this head", contrary to the description's "never carries to another commit" (.github/scripts/review-signal-decision.cjs:143-160); date the head from the later of that status and the newesthead_ref_force_pushedevent for it, with an A → B → A test, or narrow the wording. - The description's Evidence section says #11740 had a removal at 17:14, but that event is the workflow adding
needs:spec-owner-review, so reword it as a case modelled on #11740's ordering.
The commit-date ordering defect from the previous review is fixed: a commit made before a removal and pushed after it now gets the label again.
Claims and files checked
Review mode: incremental; reason: none
- Claim: an owner's removal after the current head arrived keeps the label off at later events on that head, with the reason in the job log and summary — verified by the new decision and workflow tests,
review-signal.yml:695-702, and a replay of the motivating pull request's timeline. - Claim: the head's arrival is its earliest trusted
review-requiredstatus, which review-signal writes for every new head — verified atreview-signal-decision.cjs:143-147; draft heads are gated when pushed. - Claim: the label is added when the head arrived after the removal, a non-owner removed it, the head has no trusted status yet, or a read fails (with a warning) — verified by tests and
review-signal.yml:692-694. - Claim: a removal never carries to another commit — false for a head that returns to an earlier commit (first finding).
- Claim: the decision is a pure helper loaded from the trusted workflow commit — verified at
review-signal.yml:305-319. - Claim: design-affecting detection, the design-owner review, the code gate,
review-requiredand the owner lists are unchanged — verified from the diff. - Claim: on the motivating pull request a ready-for-review event re-added a label an owner had removed at the same head — verified from its timeline.
- Claim: the commit-date case matches another pull request's timeline with a removal at 17:14 — partly false (second finding); the ordering itself is real.
- Claim: the commit-date case fails on the earlier version of this change — verified by reading that version.
- Claim: 118 tests pass and the 6 new behaviour cases fail with
main's workflow and helper — verified. - Claim: actionlint and prettier pass — prettier verified; actionlint not run in this review.
- Claim: two extra paged API reads, only for a design-affecting pull request without the label, and no job or required-check change — verified at
review-signal.yml:669-684. - Claim: no current spec decides when the label is added back — verified.
- Claim: the open security pull request does not touch the label step — verified from its patch.
- File
.github/scripts/review-signal-decision.cjs— first finding. - File
.github/workflows/review-signal.yml— clear apart from the helper's effect; its comment at lines 670-673 shares the first finding's wording. - File
.github/scripts/review-signal-decision.test.mjs— clear; its comment at lines 511-512 shares the second finding's wording. - File
.github/scripts/review-signal-workflow.test.mjs— clear.
| .map(status => Date.parse(status.created_at ?? '')) | ||
| .filter(Number.isFinite); | ||
| if (arrivals.length === 0) return {removedAtHead: false, by: null}; | ||
| const arrived = Math.min(...arrivals); |
There was a problem hiding this comment.
Statuses belong to the commit, not to its latest arrival. If the head goes A, then B, then a force push back to A, this takes A's first review-required status, so an owner's removal made while B was the head counts for A and the label stays off a commit no owner cleared then (the job summary also says "removed it at this head"). The previous version handled this because the force push sorted after the removal. Consider dating the head as the later of this value and the newest head_ref_force_pushed timeline event whose commit_id is the head (it carries created_at), with an A → B → A test.
# Conflicts: # .github/scripts/review-signal-workflow.test.mjs
There was a problem hiding this comment.
This pull request is not ready for approval yet: it needs an owner decision on behaviour no spec records, and two findings to fix.
No current spec decides whether an engineering or design owner's manual removal of needs:design-review keeps review-signal from adding it back on later events at the same head, so approval needs an engineering owner to provide or identify the governing spec for that behaviour. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner.
Blocking findings:
- A head that returns to an earlier commit (A, then B, then a force push back to A) is dated from that commit's first
review-requiredstatus, so an owner's removal made while B was the head keeps the label off A and the job summary says it was removed "at this head", contrary to the description's "never carries to another commit" (.github/scripts/review-signal-decision.cjs:143-147); date the head from the later of that status and the newesthead_ref_force_pushedevent for it, with an A → B → A test, or narrow the wording. - The description's Evidence section and the test comment at
.github/scripts/review-signal-decision.test.mjs:511-512say #11740 had an owner's removal at 17:14, but that event is the workflow addingneeds:spec-owner-review, so reword both as a case modelled on #11740's commit ordering.
Also worth a look, not blocking: an owner who adds the label back is not honoured, because only removals are read (.github/scripts/review-signal-decision.cjs:150-159).
Claims and files checked
Review mode: full; reason: merge-touches-pr-files
- Claim: on the motivating pull request, marking it ready re-added a label an owner had removed at the same head — verified from its timeline.
- Claim: before adding the label, the step reads the timeline and the head's statuses as inert data, with no pull-request code run — verified at
review-signal.yml:735-742. - Claim: after an owner's removal at the current head the label is not added back, and the job log and summary say why — verified at
review-signal.yml:753-760and by the workflow test. - Claim: the head's arrival is its earliest trusted
review-requiredstatus, which review-signal writes for every new head — verified atreview-signal-decision.cjs:143-147andreview-signal.yml:867. - Claim: the label is still added after a newer head, a non-owner's removal, with no trusted status, or when a read fails (with a warning) — verified by tests and
review-signal.yml:750-752. - Claim: the decision is a pure helper loaded from the trusted workflow commit — verified at
review-signal-decision.cjs:142andreview-signal.yml:306-320. - Claim: a removal never carries to another commit — false for a head that returns to an earlier commit (first finding).
- Claim: design detection, the design-owner review, the code gate,
review-requiredand the owner lists are unchanged — verified from the diff. - Claim: the commit-date test case matches another pull request's timeline with a removal at 17:14 — false (second finding).
- Claim: the commit-date case fails on an earlier version of this change that ordered by the timeline — verified from that version's helper.
- Claim: the new behaviour cases fail with the base's workflow and helper and all tests pass — verified: 6 fail on the base, 122 pass at the head (the count grew with tests merged from the base branch).
- Claim: prettier passes on the workflow — verified; actionlint was not run.
- Claim: CI cost is two paged reads only for a design-affecting pull request without the label, with no job, runner or required-check change — verified at
review-signal.yml:727. - Claim: no current spec decides when this label is added back — verified.
- Claim: the overlapping open pull request does not touch the label step — verified against that pull request's base.
- File
.github/workflows/review-signal.yml: clear, apart from the summary wording in the first finding. - File
.github/scripts/review-signal-decision.cjs: first finding; non-blocking note on re-adds. - File
.github/scripts/review-signal-decision.test.mjs: second finding (test comment). - File
.github/scripts/review-signal-workflow.test.mjs: clear.
| // As on a real timeline: a commit dated 17:05, pushed at 17:19, after an | ||
| // owner removed the label at 17:14 on the head before it. |
| for (const event of events) { | ||
| if (event.event !== 'unlabeled' || event.label?.name !== label) continue; | ||
| const login = event.actor?.login?.toLowerCase(); | ||
| const at = Date.parse(event.created_at ?? ''); | ||
| if (!login || !owners.includes(login) || !Number.isFinite(at)) continue; | ||
| if (at > removedAt) { | ||
| removedAt = at; | ||
| by = login; | ||
| } | ||
| } |
There was a problem hiding this comment.
Non-blocking: only unlabeled events are read, so if an engineering owner removes the label, a design owner adds it back and the author then removes it, the next same-head event still sees the first removal and leaves the label off. Counting a removal only when no later owner labeled event for the label follows it would keep the owner's latest choice.
Who this helps
Design owners and authors waiting on a pull request.
needs:design-reviewis advisory: it routes a design-affecting change to design owners and never blocks a merge. When a design owner (or an engineering owner) removes it because they have seen the change, the next pull-request event at the same head puts it straight back, because the label is recomputed from the diff on every event. #11539 shows it: the label was removed at head 9b4100d at 21:59Z on 11/14, and marking the pull request ready for review at 02:16Z on 11/15 added it again on that same head. The next commit came at 02:44Z. Someone then removes it again by hand.What changes
.github/workflows/review-signal.yml, the "Detect signals and route" step: before addingneeds:design-review, it reads the pull request's timeline and the current head's commit statuses (inert API data; no pull-request code runs). When an engineering or design owner removed the label after the current head reached the pull request, it does not add it back, and it writes the reason in the job log and the job summary: "#N: needs:design-review not added back: @owner removed it at this head (sha)."review-requiredstatus on it, which review-signal itself writes for every new head (trusted creator only).review-requiredstatus yet (its arrival is unknown);.github/scripts/review-signal-decision.cjs: the decision is a pure function,ownerRemovedLabelAtHead({events, headStatuses, label, owners}), loaded from the trusted workflow commit like the rest of the helper. A removal counts only if it came after the head's firstreview-requiredstatus, so it never carries to another commit.review-required, and the owner lists (vars.ENGOWNERS,vars.DESIGNOWNERS).Evidence
review-signal-decision.test.mjs,ownerRemovedLabelAtHead:review-requiredstatus the removal does not count; a status another account wrote does not date the head; the earliest gate status dates the head.review-signal-workflow.test.mjs, the real step against stub GitHub APIs on a theme-token change:review-signal-decision,review-signal-workflowandci-tooling-routing. Withmain's workflow and decision script, the 6 new behavior cases fail.actionlintandprettierpass on the workflow.CI impact: two extra GitHub API reads (the timeline and the head's statuses, paged) in the existing review-signal job, only for a design-affecting pull request that does not already carry the label. No job, runner or required check changes. Time to green: unchanged.
Specs
No current record decides when this advisory label is added back:
architecture:knowledge-contractsgoverns engineering and design reviews (they count only at the current head) and the review gate, not this label. This change stays within the exact-head rule: a removal counts only at the head it was made on. A record for this, and for carrying a removal to later heads that change nothing visual, is proposed separately.Overlap check
Searched open pull requests for
review-signal.yml,review-signal-decision.cjsand their tests: #11757 (a community security pull request, conflicting withmain) rewrites the workflow's header and trigger sections. This change edits only the label step around line 669, which #11757 does not touch.Overlap checked: #11757 (a different part of review-signal.yml: its header, triggers and the first job; this change is one block in the label step)
Owning session: noopbot (a61f66c2), under CI & Release (ca77f950). Land path: the shipper, through merge-guard.