Skip to content

fix(governance): a REQUIRED check must never be skippable - #654

Merged
hyperpolymath merged 1 commit into
mainfrom
fix/baseline-gate-must-not-skip
Aug 26, 2026
Merged

fix(governance): a REQUIRED check must never be skippable#654
hyperpolymath merged 1 commit into
mainfrom
fix/baseline-gate-must-not-skip

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

The defect

governance / Validate Hypatia Baseline is a required status check across the estate, and the job carried a job-level guard:

if: needs.workflow-staleness.outputs.has_baseline == 'true'

A skipped job never satisfies a required context. So any repo without a .hypatia-baseline.json was blocked forever, by construction — not by a failure anyone could fix by making CI pass, because the check could not be satisfied at all.

Measured

repo baseline? job
standards yes runs
hypatia yes runs
rsr-template-repo no skipped → blocks
a2ml-ecosystem no skipped
scaffoldia no skipped

That's why hyperpolymath/rsr-template-repo#43 sits at BLOCKED with this context reported skipped, while none of its eight failing checks is even required.

Why not just add baseline files

Adding an empty [] baseline to ~300 minted repos treats the symptom, and it would make this job — which clones and builds the Hypatia escript — run on every PR estate-wide purely to validate nothing.

The fix

The job now always runs; the eight expensive steps carry the guard individually. A repo with no baseline executes a single echo and reports success. A repo with one behaves exactly as before.

Cheap and satisfiable, where it was previously cheap xor satisfiable.

Structure verified by parsing the YAML: no job-level if, 9 steps, 8 guarded on == 'true', 1 always-pass arm on != 'true', every step conditional — so exactly one arm executes.

Deliberately not bundled into #651: different concern, and this changes behaviour for every repo calling the reusable workflow.

🤖 Generated with Claude Code

`governance / Validate Hypatia Baseline` is a required status check across the
estate, and the job carried a job-level guard:

    if: needs.workflow-staleness.outputs.has_baseline == 'true'

A skipped job never satisfies a required context. So any repo without a
`.hypatia-baseline.json` was blocked FOREVER, by construction — not by a
failure anyone could fix by making CI pass, because the check could not be
satisfied at all.

MEASURED across five repos: standards and hypatia ship a baseline (job runs);
rsr-template-repo, a2ml-ecosystem and scaffoldia do NOT (job skips). That is
why rsr-template-repo#43 sits at BLOCKED with the context reported as
"skipped" while none of its eight failing checks is even required.

The fix is not to add empty baseline files to ~300 minted repos. That treats
the symptom, and it would make this job — which clones and builds the Hypatia
escript — run on every PR estate-wide purely to validate nothing.

Instead the job now ALWAYS runs, and the eight expensive steps carry the guard
individually. A repo with no baseline executes a single echo and reports
success; a repo with one behaves exactly as before. Cheap AND satisfiable,
where it was previously cheap XOR satisfiable.

Structure verified by parsing the YAML: no job-level `if`, 9 steps, 8 guarded
on has_baseline == 'true', 1 always-pass arm on != 'true', every step
conditional — so exactly one arm executes.

Deliberately NOT bundled into the path-contract PR (#651): different concern,
and this one changes behaviour for every repo that calls the reusable workflow.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

Next included review available in 51 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 4245f220-439a-406b-9765-b08e93696484

📥 Commits

Reviewing files that changed from the base of the PR and between 1d74c6c and 05376cc.

📒 Files selected for processing (1)
  • .github/workflows/governance-reusable.yml

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

@gitar-bot

gitar-bot Bot commented Aug 26, 2026

Copy link
Copy Markdown

Important

You are using the Gitar free plan. Upgrade to unlock code review, CI analysis, auto-apply, custom automations, and more.

Gitar

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR successfully resolves a governance issue where repositories without a Hypatia baseline were failing branch protection checks because a required job was being skipped. The implementation shifts the execution logic so that the job always runs, while individual expensive steps are gated by the presence of a baseline. A fallback step ensures the job completes successfully when no baseline is detected.

Codacy analysis indicates the PR is up to standards, with no new quality issues or complexity increases. The transition from job-level guards to step-level guards correctly fulfills the requirements for mandatory status checks.

Test suggestions

  • Execute workflow in a repository WITH a .hypatia-baseline.json file: all 8 validation steps should run.
  • Execute workflow in a repository WITHOUT a .hypatia-baseline.json file: 8 validation steps should skip, and the 'No baseline to validate' step should run and pass.

TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback

@hyperpolymath
hyperpolymath merged commit e9b9c9c into main Aug 26, 2026
38 of 40 checks passed
@hyperpolymath
hyperpolymath deleted the fix/baseline-gate-must-not-skip branch August 26, 2026 23:16
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