Skip to content

fix(release): classify commit-status states in the CI-green gate - #1541

Merged
c-vigo merged 2 commits into
devfrom
bugfix/1538-gate-statuscontext-states
Aug 17, 2026
Merged

c-vigo merged 2 commits into
devfrom
bugfix/1538-gate-statuscontext-states

Conversation

@c-vigo

@c-vigo c-vigo commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements #1538 (follow-up to #1537): the six CI-green gates classified every rollup entry by .conclusion — a CheckRun-only field — so a StatusContext (commit status API, which carries state) always fell into the pending bucket: a red commit status could never block as failed (on the failures-only release-core.yml gate it passed outright), and a green one held the pending gates open forever. Latent today (no org repo publishes commit statuses); real the day a consumer adds a status-API tool.

All three counts now bind one normalized verdict per entry — (.conclusion // .state) as $v — and compare against it: FAILURE/ERROR → failed, SUCCESS → success, null/""/PENDING/IN_PROGRESS/QUEUED/EXPECTED → pending. Field shapes were verified live via GraphQL introspection, not assumed: StatusState is exactly EXPECTED, ERROR, FAILURE, PENDING, SUCCESS, and CheckRun has no state field, so nothing can double-classify; an in-progress CheckRun (conclusion: null) resolves null // null → still pending, and conclusion: "" stays pending via the retained == "" arm (empty string is truthy in jq, no fall-through). Applied at all six sites (#1537 scope); the #1537 dedup expression is untouched, and its comment blocks were corrected where they claimed StatusContexts "keep counting as before".

Test plan

tests/test_ci_green_gate.py: the deliberately-pinned StatusContext test from #1537 is inverted as the issue prescribed, replaced by seven new scenario families x six sites — red status blocks as failed (sharpest red case: previously passed the release-core gate), green status passes / counts as a successful check, PENDING/EXPECTED still hold, mixed rollups classify each kind independently, same-keyed vs distinctly-keyed StatusContext/CheckRun grouping pinned as #1537 actually behaves. TDD red: 34 failed before the fix; 90 passed after. Combined gate suites: 128 passed; prek run --all-files exit 0 (verified independently of the implementation run).

Closes #1538

c-vigo added 2 commits August 17, 2026 14:12
Cover StatusContext entries in the executed gate fixtures across all six
sites: a FAILURE/ERROR state must block as failed, a SUCCESS state must
stop counting as pending and satisfy the success count, and PENDING or
EXPECTED must keep holding the pending gates. Mixed rollups pin that an
in-progress CheckRun (conclusion: null) stays pending while a green
status drops out, and the dedup cases pin #1522's grouping unchanged.

Inverts test_status_contexts_keep_their_current_treatment, which pinned
rather than blessed the forever-pending treatment.

Refs: #1538
The counts classified every statusCheckRollup entry by .conclusion, a
field only Checks-API entries carry. A commit status reports .state
instead, so it always fell into the pending bucket and held the gate open
forever: a red status could never block as failed, a green one never stop
counting as pending.

All six copies now classify on a normalized verdict, .conclusion //
.state, which is unambiguous because CheckRuns have no state and
StatusContexts no conclusion: FAILURE/ERROR block, PENDING/EXPECTED wait,
SUCCESS counts as a passing check. An in-progress check run still
resolves to null and counts as pending. Grouping and recency are
untouched.

Refs: #1538
@c-vigo
c-vigo merged commit 4e950b6 into dev Aug 17, 2026
12 checks passed
@c-vigo
c-vigo deleted the bugfix/1538-gate-statuscontext-states branch August 17, 2026 12:30
c-vigo added a commit that referenced this pull request Aug 18, 2026
## Summary

Implements #1544 (combined follow-up from #1542, the display-table
analogue of the #1538/#1541 gate fix): the `just gh-issues` PR table was
blind to StatusContexts in two ways — `_dedupe_status_checks` grouped on
`name` only (every commit status collapsed into one `"?"` bucket, only
the newest surviving), and `_format_ci_status` classified on
`conclusion` only (a red commit status rendered pending, a green one
never counted as passed).

Two helpers in the style of #1542's `_started`, each mirroring the
gates' jq exactly:

- `_check_key` = `name or context or "?"` — dedup grouping and the red
cell's failed-names list both use it, so a failing commit status is now
also *named* in the cell (bonus fix: the old `c.get("name", "?")`
returned `None` for present-but-null names).
- `_verdict` = `conclusion or state or ""` — pass/fail tallies classify
on it; pending stays the remainder, so PENDING/EXPECTED/in-flight all
fall through with no new branch, and skipped/neutral/cancelled CheckRuns
render exactly as before.

Same-keyed grouping matches the gates including tie behavior (Python
`>=` keeps the later element, as jq's `max_by` returns the last maximal
element). One #1542 fixture corrected to a realistic node shape
(StatusContexts carry `context`, never `name`); its behavioral pin is
unchanged.

Display-only — no gate behavior changes.

## Test plan

Two new dedup tests (distinct StatusContexts stay separate; same-keyed
StatusContext/CheckRun grouping matching #1541's gate test) and a new
`TestFormatCiStatusCommitStatuses` class (FAILURE/ERROR render failed,
SUCCESS counts passed, PENDING/EXPECTED render pending, red status beats
green checks). TDD red: 6 failed pre-fix (e.g. a `state: FAILURE`
context rendering `⏳ 0/1` yellow); the PENDING/EXPECTED cases and all
pre-existing CheckRun-only tests were green throughout as regression
pins. `packages/vig-utils/tests`: 537 passed; `prek run --all-files`
exit 0 (verified independently of the implementation run).

Closes #1544
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant