fix: allow merge queue bot to push to protected branches - #185
Conversation
The GitHub Merge Queue bot (Integration 262318) needs to push rebased commits to main after queue checks pass. Classic branch protection's "Restrict who can push" blocks it — the bot is an internal GitHub app that cannot be added to branch protection push allowances. - Add merge queue bot as a conditional ruleset bypass actor (only when merge_queue is configured) - Add update rule to the ruleset for merge-queue repos so direct pushes are blocked via the ruleset instead of branch protection - Remove push_allowances from osac repo to eliminate the conflicting classic branch protection restriction - Increase max_entries_to_build from 3 to 4 (12 runners for queue, leaves 28 for PR checks with 40 total runners) Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: omer-vishlitzky <omer.vishlitzky@gmail.com>
WalkthroughThe repository ruleset now supports merge queue bypass and update enforcement. The osac repository removes push allowances and increases ChangesMerge queue ruleset
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 11✅ Passed checks (11 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
repositories.tf (1)
165-167: 🚀 Performance & Scalability | 🔵 TrivialVerify runner capacity separately from queue concurrency.
max_entries_to_build = 4limits queued pull requests requesting checks and workflows concurrently. It does not allocate 12 self-hosted runners or reserve 28 runners for pull-request checks. Confirm that runner labels, workflow concurrency, and pool limits enforce the intended 12/28 split. (docs.github.com)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@repositories.tf` around lines 165 - 167, Review the merge queue configuration around merge_queue.max_entries_to_build and separately validate the self-hosted runner labels, workflow concurrency settings, and runner pool limits. Ensure those controls enforce the intended 12-runner and 28-runner allocation; do not treat max_entries_to_build = 4 as runner capacity.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@repositories.tf`:
- Around line 165-167: Review the merge queue configuration around
merge_queue.max_entries_to_build and separately validate the self-hosted runner
labels, workflow concurrency settings, and runner pool limits. Ensure those
controls enforce the intended 12-runner and 28-runner allocation; do not treat
max_entries_to_build = 4 as runner capacity.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: osac-project/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 8ea9eb7b-44a2-4154-8b63-62ab40e03102
📒 Files selected for processing (2)
modules/common_repository/main.tfrepositories.tf
Summary
update = truerule to the ruleset so direct pushes to main are blocked via the ruleset (only bypass actors can push directly)push_allowancesfrom osac repo — classic branch protection's "Restrict who can push" overrides the merge queue bot's implicit push access, and the bot cannot be added to it (internal GitHub app with no discoverable slug)max_entries_to_buildfrom 3 to 4 (12 self-hosted runners for queue, leaves 28 for PR checks)Context
The merge queue was dequeuing PRs with all checks passing because the bot couldn't push the rebased result to main —
branch_protection_failure. Root cause: classic branch protection'srestrict_pusheslisted specific teams, which overrides the default list that includes the merge queue bot. Moving push restrictions to the ruleset (viaupdate = true) lets the merge queue bot bypass them as a ruleset bypass actor.Test plan
git push origin mainis rejected for non-bypass actors🤖 Generated with Claude Code
Summary by CodeRabbit