fix(impl-merge): let a re-dispatch finish an already-merged PR - #11307
Merged
Conversation
…dy-merged PR The merge step has long treated "already merged" as success and continued to promotion, labels, issue close and the Postgres sync — the whole point of dispatching the workflow again after a run that crashed post-merge. It never got there: the completeness check before it fetched the PR branch, and `gh pr merge --delete-branch` had removed that branch at the merge, so the re-run died on `couldn't find remote ref`. Seen on #11295 (2026-09-05): the GCP auth step failed 5 s after the squash, the images stayed in staging while the metadata on main already pointed at production, and the re-dispatch could not repair it. The check now reads the files from origin/main when the PR is merged, which is where the squash commit put them, and no longer tries to close a merged PR when they are absent. The babysit skill gets the gotcha and the status-cycle rule (compare landed pairs against production images). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LfPAdJKa4JWzvsEUQZUuhs
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LfPAdJKa4JWzvsEUQZUuhs
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The PR-state lookup must retry or fail safely before selecting the validation ref.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Fixes re-dispatch recovery for implementation PRs whose post-merge workflow failed.
Changes:
- Validates merged PRs against
origin/main. - Avoids closing already-merged PRs.
- Documents recovery procedures and adds a changelog entry.
File summaries
| File | Description |
|---|---|
changelog.d/impl-merge-redispatch-merged-pr.md |
Records the fix. |
.github/workflows/impl-merge.yml |
Adds merged-PR recovery, but state lookup failures can still trigger the deleted-branch failure. |
.claude/skills/babysit-pipeline/SKILL.md |
Documents post-merge failure recovery. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…ion ref Copilot review on #11307: a transient failure of the new state lookup read as "not merged" and fell through to the branch fetch — the exact failure the lookup exists to avoid. Same 3x/linear-backoff shape as the merge step's probe; unknown after three tries stops the run instead of guessing the ref. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LfPAdJKa4JWzvsEUQZUuhs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
impl-merge.yml's completeness check fetched the PR branch, whichgh pr merge --delete-branchremoves at the merge, so a re-dispatch for an already-merged PR died oncouldn't find remote refbefore it could reach the post-merge steps that "already merged → continue" exists for. The check now validates againstorigin/mainwhen the PR is merged (where the squash put the files) and no longer tries to close a merged PR when they are missing.Authenticate to GCP5 s later — images left in staging, metadata on main pointing at production URLs, noimpl:echarts:donelabel, no Postgres sync. The manual re-dispatch failed with exactly this error.babysit-pipelineskill gets the gotcha: how to recognise a post-merge crash in the step list, re-dispatch instead of promoting by hand, and compare landed pairs against production images every status cycle.Plan
N/A
Test plan
runblock passesbash -ngh workflow run impl-merge.yml -f pr_number=11295reaches "already merged — validating against origin/main", then promotion, labels and sync succeed;gs://anyplot-images/plots/errorbar-asymmetric/javascript/echarts/plot-light.pngexists and staging is emptyuv run python -m tools.changelog check --base origin/mainpassesai-approvedmerge still validates against the PR branchKnown gap:
.github/workflows/changes have no local verification loop; the re-dispatch for #11295 after merge is the real test.🤖 Generated with Claude Code
https://claude.ai/code/session_01LfPAdJKa4JWzvsEUQZUuhs