Repository navigation
ci: label pull requests by their local CI declaration - #2592
Conversation
The Verification section asked for the commands a pull request ran and for what it could not run, in free text that nothing read: a pull request that ran nothing looked like one that ran everything. It is now a block pr-triage.yml reads: the head commit, the base commit, each command with its exit code, the result, and what the local run cannot cover. A new triage job compares the declared head with the pushed one and applies exactly one of local-ci-pass, local-ci-fail and local-ci-skipped, creating the labels when a fork cannot. A skipped or failed declaration carries one bot comment that asks a maintainer to audit the pull request, and the comment goes away once the block is fixed. AGENTS.md and the contributing pages in both languages state the rule: the declaration decides how closely a maintainer reads the pull request, never whether a required check passes. test.yml is untouched, as skipping its jobs from the label needs data on how often a declaration matches CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Read the body and head with pulls.get and give the job its own concurrency group keyed by the pull request, so a push and the body edit that declares it no longer race on frozen payloads and the last run labels the current state. Normalise CRLF bodies from the web editor, accept indented continuation lines so commands can be a nested list, cap line length and use a regex whose parts cannot overlap on untrusted input. Require base to be a SHA, reject the template's placeholder values, require an exit code in commands and treat a pass with a non-zero exit code as invalid. The comment now lists what makes a block invalid and has its own wording for a declared skip. Exempt bot authors, tolerate a 422 when a concurrent run created the label first, skip closed pull requests and leave an unchanged comment alone. Update the template, AGENTS.md and both contributing pages to match.
|
The idea is right and the
Verified with |
|
Verified
On the two red jobs, 🤖 Claude Opus 5.5 |
|
Merged
|
|
Same crash as the one below, with a candidate fix under test on its own: #2664 gives the dialog test's own process |
Summary
Give every pull request a machine-readable account of the checks its author ran, so a reviewer can see which pull requests still need a test audit and which ones already carry the evidence. Fixes #2582.
## Verificationasked for the commands and for what could not run, in free text that nothing read: a pull request that ran nothing looked like one that ran everything. It now carries a block thatpr-triage.ymlreads, the head commit, the base commit, each command with its exit code, the result and what the local run cannot cover. A new triage job compares the declared head with the pushed one and applies exactly one oflocal-ci-pass,local-ci-failandlocal-ci-skipped, creating the labels when a fork cannot. A skipped or failed declaration carries one bot comment that asks a maintainer to audit the pull request, and the comment goes away once the block is fixed.The declaration is a promise, not evidence: required checks still decide the merge.
test.ymlis untouched, because letting it skip jobs from the label needs data on how often a declaration matches what CI finds, and the merge queue re-runs every test anyway.Targets
Documentation and
.github/only: no platform code, so no backend needs the same change.Screenshots
None
Verification
7080d4ca81aff3c1b793efd5f496a2c8d96e8655809497c3d6f79f34d28f754d22221a3c6c7d92ffgo tool nsgo check→ 0,actionlint -color→ 0,git diff --check→ 0,go tool nsgo test→ 1failgo tool nsgo test -targeton other targets, the Android emulator, Windows and the browser jobs, and the Linux and web targets of the tests below, which this macOS host cannot run;test.ymlruns them, andpull_request_targetitself only runs on a real pull requestOn this head
go tool nsgo testexits 1 with 5327 passed, 1 failed and 86 skipped. The one failure isTestMaxRefreshRateReadsEveryMode: it needs a display that reports a rate for every mode, and this host reports 0 Hz for its fastest mode. The test fails the same way onmainon this host, since the failure follows the display; #2652 fixes the test.The head merges
mainat809497c3d, which fixes the jobs that were red on the earlier head:webpasses, andtest-suite (core)passesTestLaterViewsCoverHostedNatives,TestRoundedParentsClipHostedNativesandTestVideoShowsWhatIsBehindItsTransparentPixelsafteraf43ab1e8.test-suite (core)is still red onTestFileDialogsReachGTK, which runs the GTK file dialog on the runner and ends in aSIGSEGVafterlibEGL warning: DRI3 error; this branch does not touch that code.mainat809497c3ddoes not touch.github/workflows/pr-triage.yml, so the script below is the one this branch verified. Taken from the workflow and run under Node.js with a stubbed GitHub client, one label of another state set and one stale bot comment in place:Checklist
fix(linux): keep the caret after a paste; a squash merge uses it as the commit subject.changelog.d/line: contributors see the labels, app authors and users do not.🤖 Claude Opus 5.5
🤖 Generated with Claude Code