Skip to content

ci: governance escape paths report success on the job-level check, not "not applicable" #1436

Description

@groupthinking

Summary

pr-governance.yml produces two check runs, and only one of them carries the "not applicable" signal its escape paths intend.

Check Created by Escape path result
PR Governance the workflow, via github.rest.checks.create in publish() neutral
Canonical issue and evidence GitHub, for the job itself success

On an escape path, publish("neutral", …) does not call core.setFailed, so the job exits 0 and GitHub records its check as success. The neutral conclusion exists only on the custom PR Governance check.

Net effect: a PR that was never evaluated against the canonical delivery contract reports success on Canonical issue and evidence — indistinguishable from a PR that satisfied it.

Verified

Two independent PRs on the draft escape path:

PR #1423 (own PR, head e08ac36, draft):
  PR Governance                    -> neutral
  Canonical issue and evidence     -> success

PR #1000 (Dependabot, draft):
  PR Governance                    -> neutral
  Canonical issue and evidence     -> success

Pre-existing, not introduced by #1423

This is inherited from the if (pr.draft) escape at pr-governance.yml:49, which has always behaved this way. #1423 adds a Dependabot escape with the same shape, so it inherits the topology — it does not create it, widen it, or open a fail-open path for non-exempt authors. Raised by CodeRabbit while reviewing #1423 and split out here rather than scope-creeping that PR.

Why it matters

MERGE_POLICY.md gate 2 governs which contexts are required in branch protection. If Canonical issue and evidence is the required context, then every draft and every Dependabot PR reports a green required check while the contract went unevaluated. That is the same defect class the policy file exists to name: a check whose green does not mean what a reader assumes.

The exemptions themselves are correct — neither drafts nor Dependabot can meaningfully satisfy the contract. The problem is that the honest neutral lands on a check nobody is necessarily requiring.

Options

  1. Require PR Governance rather than Canonical issue and evidence in branch protection, and say so in MERGE_POLICY.md. Smallest change; the custom check already carries the correct three-state signal (success / neutral / failure). Probably the right answer.
  2. Make the job itself skip on escape paths via a job-level if:, so the job check reports skipped. Harder — the draft flag is available in the event payload, but the author check is currently made inside the script.
  3. Accept and document. Lowest effort, but leaves the misleading green in place.

Acceptance criteria

  • A draft or Dependabot PR is distinguishable, from required-check state alone, from one that satisfied the contract.
  • MERGE_POLICY.md names whichever context is authoritative and states what its green means.
  • Non-exempt authors still fail both checks on an invalid body — no fail-open.

Activity

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

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions