Skip to content

ci: the merge job retries a base-branch-policy refusal - #53

Merged
cbetta merged 2 commits into
masterfrom
merge-job-retry
Dec 4, 2026
Merged

cbetta merged 2 commits into
masterfrom
merge-job-retry

Conversation

@cbetta

@cbetta cbetta commented Dec 4, 2026

Copy link
Copy Markdown
Member

Part of the agreed spec Agents that need you less, acceptance test A8.

The standard merge job now retries gh pr merge up to 3 more times, 20 seconds apart, but only when GitHub answers "base branch policy prohibits the merge". That happens when the job runs while another merge is still landing; deps-factory#83 failed this way on 2026-12-04. Any other refusal still fails at once: the head moved, a check failed, or anything else. --match-head-commit "$HEAD" is unchanged, so it never merges a head other than the one CI passed (spec I1).

  • actionlint (with shellcheck) passes.
  • The loop was simulated with a fake gh. Success, then a policy refusal followed by success: merges. Policy refusals 4 times: fails after 3 waits. A moved head: fails at once with no wait.
  • The same change goes to every repo with this job, and to the canonical copy in jiji's APPS.md.

🤖 Generated with Claude Code

Spec agents-autonomy, A8. Only that refusal is retried, 20 seconds apart;
any other fails at once, and --match-head-commit is unchanged.

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

Copilot AI 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.

🟡 Changes recommended

The retry path is expected to handle the reported merge-policy refusal, but the case-sensitive match looks for lowercase text while gh pr merge returns “Base branch policy prohibits the merge” with an initial capital. That refusal therefore falls through to exit 1 instead of retrying.

1 open issue
What changed in this PR

Adds targeted retries to the CI merge job to handle temporary base-branch-policy refusals while preserving the checked-head safeguard.

Changes:

  • Allows four merge attempts, with 20-second waits between policy refusals.
  • Keeps other failures immediate and retains --match-head-commit.
File Description
.github/​workflows/​ci.yml Adds bounded retries and refusal-output matching to the merge step.

Review effort: Lite

Comment thread .github/workflows/ci.yml Resolved
GitHub can send it as "Base branch policy prohibits the merge" with a
capital B (Copilot, betta-design#56 and hackcoc#53).

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

Copilot AI 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.

🟢 Approval recommended

No actionable issues were found in the reviewed changes.

No open issues 🎉

1 resolved since last review

Review effort: Lite

@cbetta
cbetta merged commit 57c71cf into master Dec 4, 2026
9 checks passed
@cbetta
cbetta deleted the merge-job-retry branch December 4, 2026 14:12
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