Skip to content

Review finding: Required Merge Gate matches check runs by name across events and runs #312

Closed

Description

@kiwidream

Summary

The gate picks check runs by name only, across workflow runs, events and PR bases.

Severity: medium. Found in the 2026-11-04 review of the v1.0.1 change set (all 1.x.x merges since v1.0.0 plus the open PRs that target it), against 1.x.x 21fee6ee8e; area: #171.

Observed

Confidence: false red confirmed (production log). Fail-open confirmed against the real gate script with modelled API data; not exercised on GitHub.

  • Location: .github/workflows/required-merge-gate.yml:770-778 (check_run_filter: map(select(.name == $name)) | sort_by(.started_at // .created_at // "") | last) at 21fee6e.
  • Scenario: The newest check run with the matching name wins, whichever suite it came from. Two outcomes follow.
  • Evidence: production check-run data for 18943b7 and 9ea1ac9, and the job log of run 41101389289. A local probe using the repository's FakeGh harness and the gate's real run: script produced rc=0 for push-suite successes with no PR-suite gate run, and rc=1 concluded skipped for a stale draft-era run.

Impact

This one check is the only required check on main and 1.x.x (.github/rulesets/1.x.x.json), and it decides whether a regression can merge into the release line. #171's own contract is "never success while a required check failed, was absent, or could not be read". A check that is absent in the current context but succeeded in another context is outside the tested model.

Suggested fix

Bind the wait to this event's own runs. Either resolve the Full Validation and Core Checks workflow runs for head_sha with the same event (and, for PRs, the same pull_requests[].number), created at or after this gate run, and read their gate jobs through the Actions jobs API. Or filter check runs on check_suite.id from those runs. Treat runs from other suites as absent, which makes them pending, not passed or failed. Add contract tests for a push-context success, a stale skipped run and a re-run in the same suite.

Related: new. #169 and #171 dealt with transient errors and the budget, not with which run is selected.

Activity

  1. added
    bug
    on Nov 4, 2026
  2. kiwidream commented on Nov 6, 2026

    @kiwidream
    MemberAuthor

    Fixed on 1.x.x by #345 (merged as 621b330). Each wait in the Required Merge Gate now reads check runs only from that run's check suite, and only from a workflow run of the gate's own event that matches the gate's run on head SHA, event, head branch, head repository and PR number. Core Checks now runs for every gate event. The poller tests replay the #268 false red and the fail-open cases. Pull requests into 1.x.x already run the fixed gate; main gets it when 1.x.x is integrated.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions