Skip to content

pr-status: flag finished runs that didn't pass but have no failed jobs - #101714

Merged
jamiboym merged 2 commits into
canaryfrom
jamiboym/pr-status-non-success-runs
Nov 18, 2026
Merged

jamiboym merged 2 commits into
canaryfrom
jamiboym/pr-status-non-success-runs

Conversation

@jamiboym

@jamiboym jamiboym commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

node scripts/pr-status.js decided 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 same index.md as a passing run, apart from the Status: line.

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, 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 completed now counts as unfinished. Before, only queued and in_progress did, so waiting, pending and requested runs fell into the "No failed jobs found" path and --wait didn't wait for them.

The script now runs main() only when invoked directly and exports describeUnpassedRun, generateIndexMd and isRunUnfinished, so test/unit/pr-status-run-status.test.ts can 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.js in different places.

Verification

🤖 Generated with Claude Code

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

vercel Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Vercel Agent finished reviewing your changes and approved this pull request.
ffc6b5d • Wed, 18 Nov 2026 01:54:05 GMT

Explanation

Checked 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-gh testing constraint, and no escalation remains. The 11 committed cases passed through a Node assertion harness; Jest was unavailable.

Resolved issues (1)

scripts/pr-status.js:1564-1572 — The status-classification bugfix has no committed regression tests, leaving false-clean reports and premature --wait completion unguarded against recurrence.

Review steps (1m 14s)

Preparing the workspace 13.3s
Analyzing the changes 55.8s
Finalizing the review 4.6s

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Tests Passed

Commit: ffc6b5d
View workflow run

Comment thread scripts/pr-status.js Resolved
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.
@github-actions github-actions Bot added the tests label Nov 18, 2026
@jamiboym
jamiboym marked this pull request as ready for review November 18, 2026 03:52
@jamiboym
jamiboym merged commit 12a58f7 into canary Nov 18, 2026
127 checks passed
@jamiboym
jamiboym deleted the jamiboym/pr-status-non-success-runs branch November 18, 2026 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant