Skip to content

ci: add ci aggregator job to unblock branch-protection required check#22

Merged
IgorShevchik merged 1 commit into
mainfrom
ci/aggregator-required-check
May 29, 2026
Merged

ci: add ci aggregator job to unblock branch-protection required check#22
IgorShevchik merged 1 commit into
mainfrom
ci/aggregator-required-check

Conversation

@IgorShevchik

Copy link
Copy Markdown
Collaborator

Unblocks PR #20 (release v0.1.0) without needing branch-protection edits.

The problem

Branch protection on main requires a status check named ci. GitHub reports check statuses per job, not per workflow — so a required check ci (likely typed expecting it to match ci.yml) has no matching job and sits as "Expected — Waiting for status to be reported" forever. Every PR's Merge button is greyed out because of this single ghost check.

PR #20 (release-please's v0.1.0 PR) is currently in exactly this state: 7 successful checks, 1 pending ci that will never resolve.

The fix

Add a tiny aggregator job named ci at the bottom of .github/workflows/ci.yml. It needs: every other gate and reports a single pass/fail status based on their combined results. Branch protection's required ci check now has a real source.

  ci:
    name: ci
    runs-on: ubuntu-latest
    if: always()
    needs: [lint, typecheck, test, build, docs]
    steps:
      - name: Aggregate required-gate results
        env:
          LINT: ${{ needs.lint.result }}
          TYPECHECK: ${{ needs.typecheck.result }}
          TEST: ${{ needs.test.result }}
          BUILD: ${{ needs.build.result }}
          DOCS: ${{ needs.docs.result }}
        run: |
          # … bash check; exit 1 if any !=success

if: always() is load-bearing — without it, a failed dependency causes the aggregator to be skipped, which leaves the required check perma-pending and reproduces the exact bug we're fixing.

Why this works without admin access

Workflows on a PR are read from the PR's head branch, not from main. So this PR's own CI run will execute the new aggregator job, the required ci check will report a real status, and the merge unblocks. Once merged, every subsequent PR (including PR #20 after rebase) gets the same treatment.

What's NOT in the aggregator

Commit messages (commitlint) is intentionally excluded from needs: — it only runs on pull_request events and would mark the aggregator as failed on direct pushes to main. Branch protection can require Commit messages separately alongside ci, or just require ci and accept that commit discipline is enforced PR-side only.

CONTRIBUTING.md update

"One-time maintainer setup" step #2 rewritten to document two equivalent options:

  • Single aggregator (recommended): require just ci (+ optionally Commit messages).
  • Explicit list: require every CI job by its name: field — with an explicit warning that adding the workflow filename (ci / ci.yml) instead silently blocks every PR (the exact bug this PR fixes).

After this PR merges

  1. PR chore(main): release b24rabbitmq 0.1.0 #20 (release-please v0.1.0) needs to pick up the new ci.yml. Two options:
    • I can locally merge main into the release-please branch and push — pulls the change in.
    • Or the release-please bot picks it up on next push to main (but that requires another push first; simpler to do option 1).
  2. PR chore(main): release b24rabbitmq 0.1.0 #20's CI runs include the ci aggregator → required check satisfied → merge unblocks.
  3. release-please creates tag v0.1.0 + GitHub Release → triggers npm-publish.yml → OIDC publish.

Gates

Gate Result
pnpm lint green
pnpm typecheck green
pnpm test 66/66
pnpm test:coverage 100/100/100/100
pnpm build green
pnpm docs:build green

Behavioural change

None in src/. New job runs only in CI. No public exports affected.


Generated by Claude Code

Branch protection on main was configured to require a status check
named `ci` (likely the workflow filename, not a job name). GitHub
reports check statuses per-job, not per-workflow, so the required
check `ci` had no source — it sat as "Expected — Waiting for
status to be reported" permanently, silently blocking every PR
(including the release-please PR #20 for v0.1.0).

Without admin access to edit branch protection settings, the cleanest
workaround is to make the missing check exist: add a tiny aggregator
job named `ci` to .github/workflows/ci.yml that depends on every
other gate (lint, typecheck, test, build, docs) and reports
success/failure based on their combined results.

How it works:
- `needs: [lint, typecheck, test, build, docs]` — waits for every
  gate to finish.
- `if: always()` — runs the aggregator even if a dependency failed,
  so branch protection sees a concrete pass/fail status instead of
  the aggregator getting "skipped" and leaving the required check
  perma-pending (the exact failure mode this fixes).
- bash step reads `needs.<job>.result` for each, exits non-zero if
  any is not `success`.

`Commit messages` (commitlint) is intentionally NOT in the
aggregator's `needs:` because it only runs on `pull_request` events
and would mark the aggregator as failed on push to main. Branch
protection can either require `Commit messages` alongside `ci` (the
explicit-list option), or keep just `ci` and accept that commit
discipline is enforced PR-side only (the single-aggregator option).

CONTRIBUTING.md "One-time maintainer setup" step #2 rewritten to
document both options:
- Single aggregator (recommended): require just `ci`.
- Explicit list: require each job by its `name:` field.
With an explicit warning that adding the workflow filename
(`ci` / `ci.yml`) instead of a job name silently blocks every PR.

This commit's own PR-time CI run includes the new aggregator job —
the required check `ci` will report a real status on this PR,
unblocking its own merge.

Gates: lint, typecheck, test (66/66), build, docs:build all green.
No src/ changes. The new job runs only in CI.
@IgorShevchik IgorShevchik merged commit e5a4406 into main May 29, 2026
8 checks passed
@IgorShevchik IgorShevchik deleted the ci/aggregator-required-check branch May 29, 2026 05:57
IgorShevchik pushed a commit that referenced this pull request May 29, 2026
…e-push)

Same reconciliation as commit 86312d4 — release-please bot force-
pushed the release-please branch when PR #22 (ci aggregator)
merged to main, wiping the earlier reconciliation. This commit
restores it with the date refreshed to 2026-05-29.

Manual reconciliation between release-please's auto-generated
[0.1.0] block (short subject lines, plus stale uuidv7/type-msg
leftovers from pre-0.0.4 history) and the hand-written Unreleased
block we maintained through PRs #10-#21 (rich per-entry
descriptions with behavioural-change callouts).

The push from this identity (non-GITHUB_TOKEN) also triggers PR-
time CI on PR #20 — which now includes the `ci` aggregator job
that satisfies branch protection's required check (#22).

Kept from release-please: [0.1.0] heading + compare link + date.
Replaced body with hand-written rich content covering #10-#21,
dropped 4 stale uuidv7 entries (already in [0.0.3]/[0.0.2]),
1 stale type/Message entry (already in [0.0.4]), and 7 noisy
docs: improve entries from pre-reanimation.

Gates: lint, test (66/66), docs:build all green.
IgorShevchik pushed a commit that referenced this pull request May 29, 2026
First trustworthy release of @bitrix24/b24rabbitmq after the
full reanimation cycle. All three roadmap tracks closed:

- Track 1 (Correctness): every Phase 1 defect fixed test-first
  with characterisation locks (PRs #10, #12, #13, #14, #15,
  #16, #17).
- Track 2 (Onboarding & positioning): runnable examples,
  README integrator section, TypeDoc API reference + PR-time
  JSDoc gate (PRs #5, #18).
- Track 3 (Process & infrastructure): release-please-driven
  release flow, tag-triggered npm publish with OIDC trusted
  publishing + provenance, ci aggregator job for branch
  protection (PRs #19, #21, #22).

See the reconciled `[0.1.0]` block in CHANGELOG.md for the
rich per-PR descriptions and behavioural-change callouts.

Merging this PR creates the v0.1.0 git tag + GitHub Release,
which triggers .github/workflows/npm-publish.yml to publish
@bitrix24/b24rabbitmq@0.1.0 to npm via OIDC trusted
publishing with --provenance attestation.

Gates: lint, typecheck, unit tests (node 20 + 22), build,
docs:build, commit messages, ci aggregator — all green on
PR #20.
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.

2 participants