Repository navigation
pr-status: flag finished runs that didn't pass but have no failed jobs - #101714
Conversation
The script decided "clean" by counting failed jobs and never looked at the run's conclusion. A run waiting for approval (`action_required`), a run cancelled before any job failed, a run whose workflow failed to start (`startup_failure`), and skipped or stale runs all have no failed jobs, so each was reported as "No failed jobs found", the same as a passing run. Only `success` now reads as clean. For any other conclusion with no failed jobs, index.md opens with a "CI did not pass" note that names the reason (with a fallback for values GitHub may add later), the title becomes "CI Status Report", and the console says the run did not pass. Runs that list failed jobs are unchanged. Every status other than `completed` now counts as unfinished, not just `queued` and `in_progress`, so `waiting`, `pending` and `requested` runs get a progress report and `--wait` waits for them.
|
Vercel Agent finished reviewing your changes and approved this pull request. ExplanationChecked conclusion reporting, unfinished-run handling, and import-safe helper exports; the regression-coverage finding is resolved. Focused report tests are acceptable for this pure status logic given the documented live- Resolved issues (1)
Review steps (1m 14s)Preparing the workspace 13.3s |
Tests PassedCommit: ffc6b5d |
Run main() only when the script is invoked directly, and export describeUnpassedRun, generateIndexMd and a new isRunUnfinished helper, so a unit test can check which runs read as clean, unfinished, or "CI did not pass" without calling gh.
Summary
node scripts/pr-status.jsdecided a run was clean by counting failed jobs and never looked at the run's conclusion. A finished run can have no failed jobs without passing: it can be waiting for a maintainer to approve a fork PR's workflows (action_required), cancelled before any job failed, unable to start because of a broken workflow file (startup_failure), skipped, or stale. Each of those printed "No failed jobs found" and produced the sameindex.mdas a passing run, apart from theStatus:line.Only
successnow reads as clean. For any other conclusion with no failed jobs,index.mdopens with a "CI did not pass" note that names the reason, the title becomes "CI Status Report", and the console says the run did not pass. Conclusions without a specific note, including any GitHub adds later, get a generic one. Runs that list failed jobs are unchanged.Every status other than
completednow counts as unfinished. Before, onlyqueuedandin_progressdid, sowaiting,pendingandrequestedruns fell into the "No failed jobs found" path and--waitdidn't wait for them.The script now runs
main()only when invoked directly and exportsdescribeUnpassedRun,generateIndexMdandisRunUnfinished, sotest/unit/pr-status-run-status.test.tscan check how each status and conclusion is reported.This is independent of vercel/next.js#101707, which makes the script pick the PR's own run and load job logs again. Both edit
scripts/pr-status.jsin different places.Verification
test/unit/pr-status-run-status.test.tscovers every status and conclusion. Making theaction_requiredcase read clean again fails it.node scripts/pr-status.js <pr> --skip-flaky-checkon live runs:action_requiredrun shows the note inindex.mdand on the console. Without pr-status: look up PR runs by head SHA and load job logs on gh 2.97+ #101707, the branch lookup picked vercel/next.js#101628's newer run on the shared branch name, which is also waiting for approval.scripts/pr-status.js.🤖 Generated with Claude Code