Skip to content

ci: review-signal reads the files and the diff of the event's head - #12495

Merged
cixzhang merged 3 commits into
mainfrom
ci/review-signal-event-head
Nov 18, 2026
Merged

cixzhang merged 3 commits into
mainfrom
ci/review-signal-event-head

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

What

The status and its diff always describe the event's head.

review-signal posts its gate status at the event's head SHA, and it reads the trusted sources at that head. It read the changed files and the diff from the pull request itself, though, and those can already show a newer push. Now:

  • Files: from a compare of the event's base and head SHAs (repos.compareCommitsWithBasehead, basehead: <base.sha>...<head.sha>), which is the pull request's own three-dot diff at that head.
  • Diff: from the same compare, as application/vnd.github.diff. The workflow no longer requests the pull request's diff.
  • More than 300 files (a compare lists at most 300): the workflow reads the pull request's file list, then confirms that the pull request still points at the event's head. When it moved, this run posts nothing and the run for the newer head decides. Such a pull request's diff is never classified, so the appearance-only exception stays false, as for any classifier failure.

Tests

review-signal-workflow.test.mjs (red-first: the 3 new cases and one updated case fail on main):

  • files and diff come from the compare of the event's base and head SHAs, and no request names the pull request's diff;
  • the script never asks for the live pull-request diff;
  • a pull request with more than 300 files reads its list and posts nothing when its head moved;
  • a pull request of more than 300 files is never classified and still gets its status (the case fails with the size guard replaced by true).

Local: review-signal-workflow, review-signal-decision, ci-admission, spec-owner-workflow and workflow-paths tests: 191 passed. prettier --check and actionlint: clean.

Overlap checked: #11856, #11757 (#11856 changes the same two files to decide when the design-review label comes back at a head an owner cleared, a different question from which commit the files and diff describe; this change does not fix it. Both add a block at the end of review-signal-workflow.test.mjs, so they conflict there; the harness now takes one files parameter that feeds both the compare and the file list, so #11856's tests rebase by passing their files through it. #11757 is an external pull request on an older base that rewrites much of the workflow file and already conflicts with main; this change neither depends on it nor resolves it)

Owning session: noopbot (a61f66c2), under CI & Release (ca77f950). Land path: the shipper, through merge-guard, on green, CodeBunny approval and Specs' exact-head /approve-spec.

The files and the diff now come from a compare of the event's base and head SHAs, so the status and its diff always describe the event's head. A pull request of more than 300 files reads its file list, then confirms its head is the event's; its diff is never classified.
@vercel

vercel Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 18, 2026 12:34am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 18, 2026, 12:51 AM UTC

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 18, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec cdf1876

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 526b405

Storybook · Sandbox · built from this PR's head

Package size: no published package changed; no new dependencies.

Not run on this PR: add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.

CI impact: 0 job-min per update · pool 0% · time to green −18.3 min · standard runners · 1 other workflow changed (not measured) · 1 CI action or script file changed (not measured)
Before After Change
Job-minutes per PR update 219 219 0
Runner pool, runner-minutes a day 71,349 71,349 0 (0%)
Average concurrent jobs 49.5 49.5 0
Time to green (median → this run) 64.5 min 46.2 min −18.3 min
Runs a day 326 326 0

Other workflows: review-signal.yml changed: runs on pull_request_target, pull_request_review, issue_comment, workflow_dispatch; standard runners; its minutes are not measured here

Not measured (the jobs that use these keep their recent minutes above): .github/scripts/review-signal-workflow.test.mjs.

Assumptions: before is each job's average over the last 20 pull-request runs; after keeps that for unchanged jobs and uses this run's minutes for added or changed ones, weighted by how often each changed job ran in those runs; runs a day averages the seven whole days before today; time to green compares this run with the median of those runs that ran the same jobs.


Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested. The approach is sound: the gate now reads the files and the diff of the exact head it posts on. Two things need fixing before approval.

  • The test "never classifies the diff of a pull request larger than a compare names" never reaches the over-300 guard: the stubbed file list returns one file, so the run stops at the count check first, and the suite stays green with the guard replaced by true. Make the list return 301 files, then assert that the diff is not requested and that the status is still posted.
  • The description says this change and #11856 merge cleanly, but they conflict at the end of review-signal-workflow.test.mjs. With both blocks kept, all five of #11856's design-label tests fail, because #11856 feeds its files only through the listFiles stub. Correct that sentence, ideally with one files harness parameter that feeds both the compare stub and the list stub.

CI has not run at this head yet because the pull request is a draft.

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Claim: the status is posted at the event's head, and trusted sources are read there. Verified: the gate writes and source reads use the event's head SHA.
  • Claim: files come from a compare of the event's base and head. Verified: review-signal.yml lines 404-412 and the new compare test.
  • Claim: the diff comes from the same compare, and the pull request's diff is no longer requested. Verified: lines 545-549; no pull-request diff route is left.
  • Claim: over 300 files, the job reads the pull request's list and posts nothing when the head moved. Verified: lines 413-426 and the moved-head test.
  • Claim: such a pull request's diff is never classified. True in the code (lines 530-533), but its test does not prove it (first finding).
  • Claim: three new cases and one updated case fail on main. Verified: four failures on the base with the new test file.
  • Claim: 191 tests pass in the five named files. Consistent: 117 ran here, and the fifth file needs a git checkout and has 74 cases. The formatting check is clean; the workflow lint did not run here.
  • Claim: #11856 changes the same two files for a different question, and this change does not fix it. Verified.
  • Claim: the two merge cleanly. False (second finding).
  • Claim: #11757 is an outside pull request on an older base that already conflicts, and this change neither depends on it nor resolves it. Verified.
  • Ownership and landing-path notes: process statements, not checked against code.
  • File .github/workflows/review-signal.yml: clear.
  • File .github/scripts/review-signal-workflow.test.mjs: first finding (lines 844-847); its compare stub returns a fixed file list (second finding).

Automated review (maintainer link)

…and the list, and the size guard's case reaches the guard
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 526b405

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI has not run on this head yet because the pull request is a draft, and it runs once the pull request is marked ready for review. Both earlier findings are fixed: the size-guard case now reaches the guard and fails without it, and the note on #11856 is accurate.

  • Non-blocking: merging #11856 also keeps both files defaults in the runSignal parameter list without a conflict marker, so the merged test file fails to load until one line is deleted; with it deleted, all 53 cases pass.
Claims and files checked

Review mode: incremental; reason: none

  • Claim: the status is posted at the event's head, and trusted sources are read there. Verified: review-signal.yml lines 344-346 and 583-586.
  • Claim: the files and the diff used to come from the pull request itself, which can show a newer push. Verified on the base: the live file list and the pull-request diff.
  • Claim: files come from a compare of the event's base and head. Verified: lines 404-412 and the compare case at test lines 802-818.
  • Claim: the diff comes from the same compare, and the pull request's diff is no longer requested. Verified: lines 545-549 and the case at test lines 820-825.
  • Claim: over 300 files, the job reads the pull request's list and posts nothing when the head moved. Verified: lines 413-426 and the case at test lines 827-846.
  • Claim: such a pull request's diff is never classified, so the appearance-only exception stays false. Verified: lines 530-533 and 636.
  • Claim: the new cases and the updated case fail on main. Verified, and five fail there: the four new cases and the updated classifier contract case.
  • Claim: the size-guard case fails with the guard replaced by true. Verified.
  • Claim: 191 tests pass in the five named files. Consistent: 117 pass here in four of them; the fifth needs a git checkout to load.
  • Claim: the formatting check and the workflow lint are clean. Formatting verified; the workflow lint was not run here.
  • Claim: #11856 changes the same two files for a different question, and this change does not fix it. Verified.
  • Claim: the two conflict at the end of the test file, and #11856's tests rebase through the shared files parameter. Verified, with the duplicate-parameter note above.
  • Claim: #11757 is an outside pull request on an older base that rewrites much of the workflow and already conflicts with main, and this change neither depends on it nor resolves it. Verified.
  • Ownership and landing-path notes: process statements, not checked against code.
  • File .github/workflows/review-signal.yml: clear.
  • File .github/scripts/review-signal-workflow.test.mjs: clear.

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as ready for review November 18, 2026 01:10
@cixzhang
cixzhang marked this pull request as draft November 18, 2026 01:33
@cixzhang
cixzhang marked this pull request as ready for review November 18, 2026 01:33
@cixzhang
cixzhang merged commit 3315e47 into main Nov 18, 2026
190 of 197 checks passed
@github-actions
github-actions Bot deleted the ci/review-signal-event-head branch November 18, 2026 06:05

This branch was successfully deployed

1 active deployment
Preview — 526b4058 Deployed Nov 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant