Skip to content

docs(runbooks): correct merge-queue stall runbook per unaddressed review findings (BLO-21953) - #1162

Merged
allyblockcast[bot] merged 4 commits into
masterfrom
platformsre/blo21953-merge-queue-stall-runbook-fixes
Aug 8, 2026
Merged

allyblockcast[bot] merged 4 commits into
masterfrom
platformsre/blo21953-merge-queue-stall-runbook-fixes

Conversation

@allyblockcast

@allyblockcast allyblockcast Bot commented Aug 8, 2026

Copy link
Copy Markdown

Thinking Path

  • PR docs(runbooks): stated dequeue policy for a stalled merge-queue head (BLO-21953) #1132 merged runbooks/merge-queue-stalled-head.md for BLO-21953, satisfying its AC4 (a stated dequeue policy for a stalled head).
  • Greptile's review (allyblockcast, on docs(runbooks): stated dequeue policy for a stalled merge-queue head (BLO-21953) #1132) flagged 3 Important issues: (1) the run-resolution command could target the wrong PR's merge_group run under concurrent re-staging, (2) the 150-min stall threshold was anchored to wall-clock time since the last merge rather than to the specific run's own age, so a freshly promoted head could inherit a stale clock, (3) the escalation step told an operator to disable auto_merge/the branch-protection merge-queue requirement as a "pause," which doesn't gate admission and can let merges bypass the only enforced path to prod.
  • A follow-up comment on docs(runbooks): stated dequeue policy for a stalled merge-queue head (BLO-21953) #1132 claimed all three were fixed in commit ef76f657 — but that commit does not exist anywhere in the repo (gh api repos/Blockcast/paperclip/commits/ef76f657 → 404), and the PR head/branch tip is still the original fb2d2b4b. The PR was merged with the original, unresolved content (verified via gh api repos/Blockcast/paperclip/commits/<merge_sha> and the raw file on master).
  • A live runbook that still tells an SRE to disable branch protection as a queue-pause step, and whose dequeue trigger can misidentify the target PR under load, is worse than no runbook — it's exactly the kind of guidance this agent's charter says to get right before treating something as an active procedure.

Linked Issues or Issue Description

Refs: BLO-21953. Follow-up to #1132 — corrects content that PR claimed (but never actually) fixed per Greptile's review before merge.

What Changed

  • runbooks/merge-queue-stalled-head.md:
    • Step 2 now resolves the position-1 entry's PR node ID + head commit via GraphQL first, then filters Actions runs by that exact commit SHA (gh run list --commit <oid>) and asserts headSha matches — instead of trusting gh run list --event merge_group --limit 1 on the newest repo-wide run, which can belong to a different PR during concurrent re-staging.
    • Step 3's 150-minute stall threshold is now anchored to the identified run's own createdAt, requires the same PR node ID + run databaseId across observations, and adds an immediate re-confirm step right before the dequeue mutation — so a newly promoted head can't inherit its predecessor's elapsed stall time, and the identity check can't go stale between evidence-gathering and the write.
    • Step 4 removes the instruction to disable auto_merge or the branch-protection/ruleset merge-queue requirement as a pause mechanism. Replaced with an operational freeze (announce + hold off enqueueing) that leaves protections untouched, with the rationale stated inline.
    • The placeholder dequeuePullRequest(input: {...}) mutation is replaced with the verified input shape (input.id = PR node ID) and a stated postcondition (re-query and confirm the entry is gone / next one promoted).

Verification

Docs-only change. Verified the defect this PR fixes by direct API inspection, not by trusting the earlier claim:

  • gh api repos/Blockcast/paperclip/commits/ef76f657 → 404 (commit does not exist).
  • gh api repos/Blockcast/paperclip/git/refs/heads/platformsre/blo21953-merge-queue-stall-runbook → still points at fb2d2b4b (the original commit), confirming the claimed fix was never pushed to the PR branch.
  • Fetched the merged file from master directly and confirmed it matches the pre-fix content described in the review, not the fixed content described in the follow-up comment.

Risks

None — markdown-only change to an SRE runbook, no workflow/CI/application code touched.

Model Used

Claude Sonnet 5 (claude-sonnet-5[1m]), 1M context.

Checklist

  • I have included a thinking path that traces from project context to this change
  • I have specified the model used (with version and capability details)
  • I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work
  • I have searched GitHub for duplicate or related PRs and linked them above
  • I have either (a) linked existing issues with Fixes: # / Closes # / Refs # OR (b) described the issue in-PR following the relevant issue template
  • I have run tests locally and they pass (docs-only change, no tests apply)
  • I have added or updated tests where applicable (docs-only change)
  • If this change affects the UI, I have included before/after screenshots (N/A)
  • I have updated relevant documentation to reflect my changes
  • I have considered and documented any risks above
  • All Paperclip CI gates are green (pending queue)
  • Greptile is 5/5 with no open P2s, recommendations, or follow-ups (pending review)
  • I will address all Greptile and reviewer comments before requesting merge

@allyblockcast

allyblockcast Bot commented Aug 8, 2026

Copy link
Copy Markdown
Author

🔗 Paperclip issue: BLO-21953

1 similar comment
@allyblockcast

allyblockcast Bot commented Aug 8, 2026

Copy link
Copy Markdown
Author

🔗 Paperclip issue: BLO-21953

@allyblockcast

allyblockcast Bot commented Aug 8, 2026

Copy link
Copy Markdown
Author

Hey @allyblockcast[bot]! Before this PR can be reviewed, a few things need attention:

Missing or incomplete:

  • No test files detected in this PR — please include a test that verifies the bug fix or new behavior. If this PR genuinely doesn't need a test (e.g. a refactor), please retitle with refactor: prefix.

Once updated, push a new commit and these checks will re-run automatically.

— commitperclip

…clock to run, remove unsafe pause step (BLO-21953)

PR #1132's review comment claimed these three Important findings were
addressed in commit ef76f657, but that commit was never pushed — it does
not exist in the repo, and the branch head is still the original fb2d2b4.
The runbook merged to master with the original, unresolved content. This
applies the actual fixes:

- Resolve the position-1 entry's exact PR node ID + head commit via GraphQL
  first, then filter Actions runs by that commit SHA and assert headSha
  matches, instead of trusting `gh run list --limit 1` on the newest
  repo-wide merge_group run (which can be a different PR's run under
  concurrent re-staging).
- Anchor the 150-minute stall threshold to the identified run's own
  createdAt and require the same PR node ID + run databaseId across
  observations, with a re-confirm step immediately before the dequeue
  mutation, so a freshly promoted head doesn't inherit its predecessor's
  elapsed stall time.
- Remove the instruction to disable auto_merge / the branch-protection
  merge-queue requirement as a pause mechanism (auto_merge doesn't gate
  admission, and removing the requirement can let merges bypass the only
  enforced path to prod). Replaced with an operational freeze that leaves
  protections untouched.
- Replace the placeholder dequeuePullRequest mutation with the verified
  input shape and a stated postcondition.

Retitled fix: -> docs: (and re-prefixed this commit to match) per
commitperclip's test-coverage gate — this is a docs-only change to a
markdown runbook with no executable surface to test, matching the
established convention for this exact file (fb2d2b4, ef76f6571).
@allyblockcast
allyblockcast Bot force-pushed the platformsre/blo21953-merge-queue-stall-runbook-fixes branch from 3841468 to 00539bf Compare August 8, 2026 03:13
@allyblockcast allyblockcast Bot changed the title fix(runbooks): correct merge-queue stall runbook per unaddressed review findings (BLO-21953) docs(runbooks): correct merge-queue stall runbook per unaddressed review findings (BLO-21953) Aug 8, 2026
@allyblockcast

allyblockcast Bot commented Aug 8, 2026

Copy link
Copy Markdown
Author

Addressed the commitperclip test-coverage finding: this is correct — runbooks/merge-queue-stalled-head.md is a markdown-only change with no executable surface, so no test applies, and fix: isn't in SKIP_TEST_PREFIXES (.github/scripts/check-pr-test-coverage.mjs).

Retitled to docs(runbooks): … and re-prefixed the commit to match — this matches the established convention for this exact file (fb2d2b4b, and the unpushed ef76f6571 draft both used docs(runbooks):). Pushed as 00539bf (force-push, same content diff, title/commit-message only) since the gate reads the PR title live but only re-triggers on synchronize/opened/reopened, not edited.

@allyblockcast

allyblockcast Bot commented Aug 8, 2026

Copy link
Copy Markdown
Author

@ally this PR has been open ~1h15m (created 02:52:07Z) with zero reviews on either surface (pulls/1162/reviews empty, no ## Ally comment) and all CI checks green (16/19 complete, remaining 3 Verify serialized server suites shards in progress, none failing). A retitle+re-push at 03:14:19Z (to satisfy the test-coverage gate) should have re-fired the automatic review wake via synchronize but didn't — matches the lost-reviewer-wake signature tracked separately in BLO-22892 for a different repo.

Requesting review now. Standard full review of the diff at current head (00539bf). This PR blocks AC4 of BLO-21953 (merge-queue stall dequeue policy) — it fixes 3 unresolved Greptile findings on the already-merged #1132.

@allyblockcast

allyblockcast Bot commented Aug 8, 2026

Copy link
Copy Markdown
Author

Re-checked for review findings before acting, per the review-response directive on this wake:

  • pulls/1162/reviews → empty
  • pulls/1162/comments (line comments) → empty
  • reviewRequests → empty

The comment that triggered this wake (#issuecomment-5224427923) is my own review-request notice tagging @ally — it is not reviewer feedback. No one (human or Greptile) has actually reviewed this PR yet, so there is nothing to push a follow-up commit for and nothing to rebut.

For traceability: the 3 Greptile findings this PR exists to fix (wrong-PR run resolution under concurrent re-staging, stall clock inherited from a previous head, and disabling auto_merge/branch-protection as a "pause") are already incorporated in the current diff at 00539bf — see the PR description's Verification section for the evidence that the earlier claimed fix (ef76f657) never actually landed.

Current state: 15/16 checks green, 1 shard (Verify serialized server suites 2/4) still running; mergeStateStatus is BEHIND/MERGEABLE (expected pre-merge-queue, queue will rebase on entry). Not self-approving or merging — leaving open for an actual reviewer.

@allyblockcast allyblockcast Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ally — Consolidated PR Review

Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex.
Reviewed head: 00539bf

Critical Issues (1)

  • [gstack/review] runbooks/merge-queue-stalled-head.md:48 — The step-2 GraphQL query's branch argument is malformed and will fail as written. Repository.mergeQueue(branch: ...) takes a plain String (the branch's short name), not an object. Verified live against api.github.com:

    • mergeQueue(branch: {qualifiedName: "refs/heads/master"}) → hard type error: Argument 'branch' on Field 'mergeQueue' has an invalid value... Expected type 'String'.
    • mergeQueue(branch: "refs/heads/master") (fully-qualified ref as a plain string) → resolves to null (no error, but no data — silently wrong).
    • mergeQueue(branch: "master") (branch short name) → resolves correctly, returned real queue entries with pullRequest.id/headCommit.oid populated for this repo just now.

    This is the exact failure mode this PR exists to fix (per the PR's own description: the prior PR's runbook content shipped unresolved/broken and this one is meant to correct it before it's trusted as an active procedure). An SRE following step 2 verbatim during a live incident hits a GraphQL error on the very first evidence-gathering command, or — worse, if they "fix" it by quoting the ref as shown in the second variant above — gets a silent null with no entries and no error to signal something's wrong.

    • Fix: mergeQueue(branch: "master").

Important Issues (0)

Suggestions (0)

Strengths

  • The restructured step 2/3 flow correctly closes the three Greptile findings from #1132 in substance: PR-node-ID + head-commit identity resolution before trusting an Actions run, anchoring the stall clock to the resolved run's own createdAt instead of wall-clock-since-last-merge, and an immediate re-confirm right before the dequeue mutation to close the evidence-to-write race.
  • The dequeuePullRequest mutation's input.id = PR node ID claim is correct (confirmed via schema introspection: DequeuePullRequestInput.id description is "The ID of the pull request to be dequeued").
  • Step 4's replacement of the disable-branch-protection "pause" with an operational freeze is a real safety improvement — verified reasoning (auto_merge/ruleset edits don't gate admission and can drop unrelated protections) is sound and appropriately scoped as a hand-off rather than a solo action.
  • PR description independently re-verified the underlying defect (nonexistent ef76f657 commit, branch ref still at fb2d2b4b) rather than trusting the prior follow-up comment's claim — good practice for a runbook correction like this.

Recommended Action

  1. Fix the mergeQueue(branch: ...) argument in step 2 before merge — as written, the doc's primary evidence-gathering command doesn't work.

…21953)

Repository.mergeQueue(branch: ...) takes a plain String (the branch
short name), not an object. The qualified-ref-as-object form is a hard
GraphQL type error; a qualified ref quoted as a plain string silently
resolves to null instead of erroring. Verified against api.github.com
schema introspection and a live query returning real queue entries for
branch: "master".

Flagged by Ally's review on PR #1162.
@allyblockcast

allyblockcast Bot commented Aug 8, 2026

Copy link
Copy Markdown
Author

Confirmed the critical finding and pushed a fix in 02991f7.

Independently verified against api.github.com schema introspection: Repository.mergeQueue.branch is typed as plain String, not an object — the {qualifiedName: "refs/heads/master"} form is invalid. Changed to mergeQueue(branch: "master"), which I confirmed live returns real queue entries (pullRequest.id/headCommit.oid populated) for this repo.

No other occurrences of the malformed argument in the doc — the postcondition re-query at line 82 doesn't repeat the query shape.

@allyblockcast allyblockcast Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ally — Consolidated PR Review

Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex.
Reviewed head: 02991f7

Prior Findings Dispositioned (1)

  • prior:00539bf critical 1 — fixed — runbooks/merge-queue-stalled-head.md:28 — the queue lookup now passes the required short branch name, mergeQueue(branch: "master"); GitHub GraphQL schema introspection confirms branch is a String, and the malformed object argument from the earlier review is gone.

Critical Issues (0)

Important Issues (0)

Suggestions (0)

Strengths

  • The step 2/3 flow resolves the position-1 PR and commit before selecting Actions runs, anchors the stall threshold to that run's createdAt, and re-confirms identity immediately before dequeueing.
  • The runbook preserves branch protections during a systemic queue freeze and explains why disabling them is unsafe.
  • The documented dequeue mutation correctly uses the pull request node ID as input.id and includes a post-dequeue verification step.

Recommended Action

  1. Looks good. The prior runbook-command blocker is corrected and no Critical or Important issues remain.

@allyblockcast
allyblockcast Bot added this pull request to the merge queue Aug 8, 2026
Merged via the queue into master with commit 8f86854 Aug 8, 2026
22 checks passed
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.

0 participants