gh-stack icon indicating copy to clipboard operation
gh-stack copied to clipboard

Rebase stack leaves upper PRs' test-merge refs on orphaned/chained base commits, breaking merge-ref CI

Open mcmathews opened this issue 1 month ago • 0 comments

Follow-up to #258 with a fresh reproduction, filed as a bug.

Repro: 5-PR stack (bottom based on main, each PR based on the branch below). Rebased the stack with gh-stack. Afterwards every PR's REST base.sha matched its base branch tip, but refs/pull/N/merge did not:

  • Bottom+1 PR: base-side parent is the pre-rebase tip of its base branch (no longer reachable from any ref).
  • Each PR above that: base-side parent is the refs/pull/N/merge commit of the PR below it, not its base branch tip.
  • Bottom PR (based on main): unaffected.

CI that builds from the merge ref (Jenkins GitHub Branch Source, "merge with target") fetches only branch refs, so every affected PR fails checkout with merge: <sha> - not something we can merge. Per #258, rescans and close/reopen don't recover it; retargeting the base does.

Expected: after a restack, each PR's test-merge ref is recomputed against the current tip of its base branch.

Happy to share SHAs and logs privately.

mcmathews avatar Oct 05 '26 21:10 mcmathews