Skip to content

fix(impl-merge): let a re-dispatch finish an already-merged PR - #11307

Merged
MarkusNeusinger merged 3 commits into
mainfrom
fix/impl-merge-redispatch-merged-pr
Sep 5, 2026
Merged

fix(impl-merge): let a re-dispatch finish an already-merged PR#11307
MarkusNeusinger merged 3 commits into
mainfrom
fix/impl-merge-redispatch-merged-pr

Conversation

@MarkusNeusinger

Copy link
Copy Markdown
Owner

Summary

  • impl-merge.yml's completeness check fetched the PR branch, which gh pr merge --delete-branch removes at the merge, so a re-dispatch for an already-merged PR died on couldn't find remote ref before it could reach the post-merge steps that "already merged → continue" exists for. The check now validates against origin/main when the PR is merged (where the squash put the files) and no longer tries to close a merged PR when they are missing.
  • Trigger: feat(echarts): implement errorbar-asymmetric #11295 (2026-09-05 01:24 UTC) merged and then failed at Authenticate to GCP 5 s later — images left in staging, metadata on main pointing at production URLs, no impl:echarts:done label, no Postgres sync. The manual re-dispatch failed with exactly this error.
  • The babysit-pipeline skill 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

  • Workflow YAML parses; the edited run block passes bash -n
  • After merge: gh workflow run impl-merge.yml -f pr_number=11295 reaches "already merged — validating against origin/main", then promotion, labels and sync succeed; gs://anyplot-images/plots/errorbar-asymmetric/javascript/echarts/plot-light.png exists and staging is empty
  • uv run python -m tools.changelog check --base origin/main passes
  • Unmerged path unchanged: a normal ai-approved merge still validates against the PR branch

Known 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

MarkusNeusinger and others added 2 commits September 5, 2026 03:32
…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
Copilot AI balanced review requested due to automatic review settings September 5, 2026 01:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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.

Comment thread .github/workflows/impl-merge.yml Outdated
…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
@MarkusNeusinger
MarkusNeusinger merged commit a2c08bf into main Sep 5, 2026
12 checks passed
@MarkusNeusinger
MarkusNeusinger deleted the fix/impl-merge-redispatch-merged-pr branch September 5, 2026 12:11
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