Skip to content

Fix conflict resolutions stranding the PR when its base branch moved#59

Merged
Phlogistique merged 5 commits into
mainfrom
claude/autorestack-action-conflict-vemewk
Jul 6, 2026
Merged

Fix conflict resolutions stranding the PR when its base branch moved#59
Phlogistique merged 5 commits into
mainfrom
claude/autorestack-action-conflict-vemewk

Conversation

@Phlogistique

Copy link
Copy Markdown
Collaborator

In scortexio/gh-stack-mv#36 a conflict resolution followed the posted instructions but the action never resumed and the conflict label stayed stuck. The resume rides on a synchronize event, and GitHub creates no pull_request runs for a PR that conflicts with its base. The PR did conflict with its base (the merged branch, kept until the resume retargets it): autorestack itself had advanced that branch when a grandparent PR merged, so the head no longer descended from its tip, and the resolution rewrote the same lines the squash reshaped, so GitHub's textual mergeability check failed too. The old merge dance guaranteed the descent structurally; the switch to git-merge-onto (#56) dropped that guarantee.

This re-vendors git-merge-onto 0.2.0 with its new --absorbed flag (scortexio/git-merge-onto#3) and passes it both in the action's own re-parent and in the posted resolution command. The merged branch's tip is recorded as an extra parent of the merge (on a conflict it rides along in MERGE_HEAD, so the user's plain git commit records it), so the pushed resolution descends from its base again and the resume event is guaranteed to fire.

New unit test replays the incident: parent advanced after the child forked, squash-merged, conflicting re-parent, resolution via the posted command; asserts the resolution descends from the old base's tip. The e2e gets the same assertion on its real conflict scenario.

Do not merge before git-merge-onto 0.2.0 is on PyPI: the posted command, which the e2e replays verbatim, runs uvx 'git-merge-onto>=0.2'.


Generated by Claude Code

Re-vendors git-merge-onto 0.2.0 and passes --absorbed in the action's
re-parent and in the posted resolution command, so the result descends
from the merged branch's tip and the PR stays mergeable (and its resume
event firing) until it is retargeted.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PHUVU3Ek3U9j3LrdjPnyAy
Comment thread update-pr-stack.sh Outdated
Comment thread tests/test_conflict_absorbed_resolution.sh Outdated
@Phlogistique Phlogistique marked this pull request as ready for review July 6, 2026 08:51
Comment thread tests/test_e2e.sh Outdated
Comment thread tests/test_e2e.sh Outdated
@Phlogistique Phlogistique merged commit 6c99628 into main Jul 6, 2026
3 checks passed
@github-actions github-actions Bot deleted the claude/autorestack-action-conflict-vemewk branch July 6, 2026 09:20
Phlogistique added a commit that referenced this pull request Jul 6, 2026
Stacked on #59.

A rebase merge lands the branch's content as new commits without merging
its history, same as a squash spread over several commits. The old
refusal reasons were specific to the merge dance, which merged
`SQUASH_COMMIT~` and so could conflict against intermediate copies; the
single-merge re-parent (#56) only reads the landed tip's tree, and with
`--absorbed` (#59) the recorded parent is the merged branch's tip in
both cases. So the squash path handles rebase merges as-is.

This deletes the squash-vs-rebase detection (`is_rebase_merge` and its
commit-PR association polling, the flakiest part of the action: the
association is computed asynchronously and had to be waited for). The
only case left to detect is a merge-commit merge, where the children
already contain their parent's history and the action only retargets.
`tests/test_rebase_merge_skip.sh`, which asserted the old refusal,
becomes `tests/test_rebase_merge.sh` and asserts the update.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01PHUVU3Ek3U9j3LrdjPnyAy)_

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: github-actions <github-actions@github.com>
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