-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: Bazel
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
merge_queue_quota_check blocks a merge when the owning team is over its Block-on-Red hot quota. A break-glass override approves the PR (.github/workflows/comment-approval.yml, via svc-auto-approve-bot) but the quota check ignores it, so an overridden PR still goes red in the queue. This makes the check pass when the bot's override approval is on the PR.
Changes
- buildscripts/monitor_build_status/merge_queue_quota_check.py
- New break-glass row in RULES (PASS), fed by Facts.break_glass. decide() stays pure.
- fetch_break_glass() reads the PR head SHA and its reviews from the GitHub API. break_glass_from_reviews() decides whether the override counts.
- The PR number comes from the (#N) in the merge-queue subject (existing pull_request_from_subject).
- evaluate() only does the GitHub lookup when decide() would otherwise BLOCK, so passing runs make no extra calls.
- The block message now mentions the override as a way to merge.
- etc/evergreen_yml_components/tasks/misc_tasks.yml: the task mints a read-only token (pull_requests: read, metadata: read, same as validate_commit_message) and passes GITHUB_TOKEN, GITHUB_ORG, GITHUB_REPO.
- buildscripts/tests/monitor_build_status/test_merge_queue_quota_check.py: review parsing, decision row, lazy lookup, pagination, missing token.
What counts as an override
A review counts only if all of these hold:
- It is authored by svc-auto-approve-bot.
- Its body starts with Approving override from @<member>. The bot also approves for CODEOWNERS and backport auto-merge, so any bot approval is not enough.
- It is the latest such review, and its state is APPROVED. A later dismissal revokes it.
- It is on the PR's current head commit. A push after the override means the approval no longer applies.
Behavior to review
- If the GitHub lookup fails, including a missing token, the override is ignored and the quota verdict stands. The failure is printed as break-glass lookup failed, ignoring it. The lookup only runs when the check would otherwise block, so a GitHub problem can never turn a pass into a block.
- This only affects the quota check. The override still doesn't skip evergreen or the queue; it only satisfies this one check.
Testing
bazel test //buildscripts/tests/monitor_build_status:test_merge_queue_quota_check passes (52 tests). Not yet exercised in a real merge-queue run.