Skip to content

forge: Add linear merge range capability - #1398

Merged
abhinav merged 1 commit into
github-native-stack-forgefrom
github-merge-range
Oct 19, 2026
Merged

abhinav merged 1 commit into
github-native-stack-forgefrom
github-merge-range

Conversation

@abhinav

@abhinav abhinav commented Aug 10, 2026

Copy link
Copy Markdown
Owner

Forge repositories need an optional operation that can atomically merge
a fully restacked linear change range while rejecting stale remote
state. Add WithMergeRange with the expected branch names and head
commits needed for providers to enforce that boundary.

GitHub keeps its full pull request projection local to range validation,
checks branches, commits, and native-stack membership, then delegates to
the asynchronous merge gateway. The shared integration scenario creates
the required native stack before starting the range merge and waits for
operation acceptance and final merged states.

The GitHub integration cassette remains deliberately unrecorded for a
human operator to capture.

Refs #1388

@abhinav abhinav added the skip changelog PRs that don't need a changelog. label Aug 10, 2026
@abhinav
abhinav force-pushed the github-merge-range branch from 32236d4 to 5bce822 Compare August 12, 2026 02:43
@abhinav
abhinav force-pushed the github-merge-range branch from 5bce822 to adc76e0 Compare August 12, 2026 03:06
@abhinav
abhinav marked this pull request as ready for review August 12, 2026 04:19
@abhinav
abhinav force-pushed the github-merge-range branch from adc76e0 to ac1c88a Compare August 12, 2026 04:19
@abhinav
abhinav marked this pull request as draft August 15, 2026 13:56
@abhinav
abhinav force-pushed the github-merge-range branch from ac1c88a to d863566 Compare August 15, 2026 13:56
@abhinav
abhinav force-pushed the github-merge-range branch from d863566 to b651611 Compare August 23, 2026 13:40
@abhinav
abhinav force-pushed the github-merge-range branch from b651611 to 946584e Compare August 24, 2026 03:02
@abhinav
abhinav force-pushed the github-merge-range branch from 946584e to 8951076 Compare August 24, 2026 04:08
A selected branch forest does not identify the native range a provider can
merge.
Stack reconciliation may preserve an existing path that differs from a local
longest-path choice, so atomic merge planning must use the provider result.

Extend `WithStacks` with `PlanMergeRanges`.
Each executable plan binds a bottom-to-top change range to one atomic merge
operation, while changes omitted from every plan remain available for ordinary
merging.
`ErrUnsupported` preserves per-change fallback before any atomic operation
starts.

Carry both semantic change relationships and provider-facing base branches in
the desired stack state.
GitHub uses one batched read to plan lowest selected native-stack prefixes and
singleton unstacked pull requests.
Before starting the asynchronous merge, each plan reloads its range and
verifies the prepared bases, heads, and commits.

Shared forge and GitHub divergent-stack scenarios exercise the planning and
execution boundary.

Refs #1388
@abhinav
abhinav force-pushed the github-merge-range branch from c3be1ae to ad41e77 Compare October 19, 2026 01:29
@abhinav
abhinav marked this pull request as ready for review October 19, 2026 01:31
@abhinav
abhinav merged commit ac3708d into main Oct 19, 2026
22 checks passed
@abhinav
abhinav deleted the github-merge-range branch October 19, 2026 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip changelog PRs that don't need a changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant