Skip to content

Add stable 'CI success' aggregate gate for branch protection - #867

Draft
cmraible wants to merge 1 commit into
repo-audit/pnpmfrom
repo-audit/settings
Draft

Add stable 'CI success' aggregate gate for branch protection#867
cmraible wants to merge 1 commit into
repo-audit/pnpmfrom
repo-audit/settings

Conversation

@cmraible

@cmraible cmraible commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Part of the repo audit (Step 4: settings & rulesets). Stacked on #866 (base repo-audit/pnpm) — merge that first; GitHub auto-retargets this to main.

The problem

The Protect Main ruleset requires the status check Lint and Test (Node 22) — a matrix-leg name. If the Node version in the matrix ever changes, that check renames, and branch protection would require a check that no longer runs: it either blocks all PRs forever or silently stops gating. Requiring a per-matrix-leg name is fragile.

This PR

Adds a single CI success job to ci.yml that needs: [prepare, lint-and-test] and fails if any leg didn't succeed. Its name is stable regardless of the matrix, so the ruleset can require one check that always reflects "did all of CI pass". No behavior change to the existing jobs.

Follow-up settings changes (manual, admin — after this merges)

These are GitHub config, not code, and need doing once CI success is running on main:

  1. Swap the required check on the Protect Main ruleset: Lint and Test (Node 22)CI success.
  2. Delete the redundant Protect default branch ruleset (16859469) — its only rule (block deletion) is already covered by Protect Main.

(Disabling rebase-merge was considered and dropped: the ruleset already enforces allowed_merge_methods: ["squash"] for main, so the repo-level toggle is moot.)

https://claude.ai/code/session_019VZskjJgacTYkiystBAHmP

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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

Comment thread .github/workflows/ci.yml Fixed
@codecov-commenter

codecov-commenter commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.52%. Comparing base (ef96364) to head (8eb87a2).

Additional details and impacted files
@@               Coverage Diff                @@
##           repo-audit/pnpm     #867   +/-   ##
================================================
  Coverage            95.52%   95.52%           
================================================
  Files                   40       40           
  Lines                  939      939           
  Branches               171      171           
================================================
  Hits                   897      897           
  Misses                  42       42           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Branch protection currently requires 'Lint and Test (Node 22)', a matrix-leg
name that renames — and silently stops gating — if the Node matrix changes.
Add a single 'CI success' job that needs all lint-and-test legs and fails if
any did not succeed, so the ruleset can require one stable check instead.

Claude-Session: https://claude.ai/code/session_019VZskjJgacTYkiystBAHmP
@cmraible
cmraible force-pushed the repo-audit/settings branch from 522fe6d to 8eb87a2 Compare September 2, 2026 21:20
Comment thread .github/workflows/ci.yml
Comment on lines +97 to +114
name: CI success
if: always()
needs: [prepare, lint-and-test]
runs-on: ubuntu-latest
steps:
# Fail closed: require every needed job to be exactly 'success'. Checking
# only for 'failure'/'cancelled' would let a 'skipped' result pass — e.g.
# if prepare emitted an empty matrix, lint-and-test would be skipped and
# this gate would go green with zero tests run.
- name: Fail unless every required job succeeded
if: ${{ needs.prepare.result != 'success' || needs.lint-and-test.result != 'success' }}
run: |
echo "One or more required CI jobs did not succeed:"
echo " prepare: ${{ needs.prepare.result }}"
echo " lint-and-test: ${{ needs.lint-and-test.result }}"
exit 1
- name: All required CI jobs passed
run: echo "All required CI jobs passed"
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.

3 participants