Skip to content

fix(bin): let fm-pr-merge --allow-red repeat to waive several checks - #5102

Closed
daoudjk wants to merge 1 commit into
kunchenguid:mainfrom
daoudjk:fm/fm-pr-merge-multi-allow-red
Closed

daoudjk wants to merge 1 commit into
kunchenguid:mainfrom
daoudjk:fm/fm-pr-merge-multi-allow-red

Conversation

@daoudjk

@daoudjk daoudjk commented Sep 21, 2026

Copy link
Copy Markdown

Intent

This is firstmate's own tooling. An account-wide GitHub Actions BILLING block has made all crucible CI red - the jobs die before running any step (0 steps, ~2-11s). The captain's standing policy is to merge validated, no-mistakes-passed PRs over those billing-blocked checks using bin/fm-pr-merge.sh --allow-red <check>. But fm-pr-merge.sh accepts --allow-red only ONCE ("--allow-red may be specified only once"), so PRs in repos with MULTIPLE CI checks cannot be merged. crucible-deploy has three (build-and-test, classify-and-render, readiness-publisher-api), all currently the same 0-step billing block, which blocks PR #305 (D-cell catalog designation) and PR #304 (containment fix). Extend fm-pr-merge.sh so --allow-red may be given multiple times, each waiving one exactly-named check, WITHOUT weakening any other safety property.

What Changed

  • Removed the guard in bin/fm-pr-merge.sh that rejected a second --allow-red <check-name> argument, so the flag can now be repeated, each occurrence waiving exactly one named GitHub check by exact name while still requiring every other check to be green.
  • Updated the usage comment and header documentation in bin/fm-pr-merge.sh to describe --allow-red <check-name> as repeatable ([--allow-red <check-name>]...).
  • Updated AGENTS.md and docs/architecture.md to describe the captain-instruction and waiver policy in terms of naming each waived check (one per repetition) instead of a single check.
  • Extended tests/fm-pr-merge.test.sh to cover multiple --allow-red occurrences waiving distinct named checks.

🤖 Generated with Claude Code

Risk Assessment

✅ Low: The change removes a single-use restriction on a repeatable flag; the downstream matching loop already iterated over all ALLOW_RED entries correctly, docs/comments/usage string and tests were updated consistently, and no other safety property (green-check requirement, away-posture refusal, head binding) was touched.

Testing

All fm-pr-merge.sh tests passed, including the two exercising the new repeatable --allow-red behavior end-to-end against mocked gh, proving that naming every red check via repeated --allow-red flags merges while leaving any one check unnamed still refuses.

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • bash tests/fm-pr-merge.test.sh (full targeted test file for bin/fm-pr-merge.sh, mocked gh/glab, no network)
  • test_allow_red_requires_one_separate_name — equals-form --allow-red=x still refused
  • test_allow_red_may_repeat_to_cover_several_checks — 3 red checks: 2 named refuses (uncovered check named in stderr), 3 named merges via gh pr merge --squash
✅ **Document** - passed

✅ No issues found.

🔧 **Lint** - 1 issue found → auto-fixed ✅
  • ⚠️ linter found issues (exit code 1)

🔧 Fix: No code change needed; lint passes with actionlint on PATH
✅ Re-checked - no issues remain.

✅ **Push** - passed

✅ No issues found.

A billing block makes every check on a PR red at once, so a repo with
multiple required checks (e.g. crucible-deploy's three) had no way to
waive them all: --allow-red accepted only one occurrence. The refusal
was a single arg-parsing guard; the check-matching logic already
treated ALLOW_RED as a set. Drop the "only once" guard so each
occurrence of --allow-red waives one exactly-named check, keeping
every other safety property (live head binding, every other check
still required green, away-posture refusal, GitLab exclusion)
unchanged.
@daoudjk

daoudjk commented Sep 21, 2026

Copy link
Copy Markdown
Author

Closing: this fix branch is meant to stay fork/local-only (firstmate changes are not PR'd upstream), and the first-time-contributor workflow-approval gate on this repo can't clear from this account anyway. The change is validated locally and held for the captain to land directly.

@daoudjk daoudjk closed this Sep 21, 2026
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