Wire up workspace_integrate_upstream API for stack rebase and upstream integration#13678
Draft
mtsgrd wants to merge 1 commit into
Draft
Wire up workspace_integrate_upstream API for stack rebase and upstream integration#13678mtsgrd wants to merge 1 commit into
mtsgrd wants to merge 1 commit into
Conversation
36effc6 to
7c228ad
Compare
7c228ad to
93001e3
Compare
90da8d5 to
576b1a6
Compare
Contributor
Author
|
@Caleb-T-Owens is the new API ready for the svelte app to migrate? |
94ff5eb to
0915fca
Compare
3432a4a to
f21d42c
Compare
**`IntegrateUpstreamModal` refactor:**
- Migrated from old Resolution API to `BottomUpdate[]` API
- Imperative status fetch → reactive `useQuery` subscription
(auto-invalidates on background fetch)
- Wrapped statuses section in `<ReduxResult>` for loading/error handling
**Backend (`upstream_integration.rs`):**
- Exposed `bottom_selector` on `StackStatus` for building
`BottomUpdate`s
**E2E tests:**
- "Leave as is" preserves branch base while other branches advance
- Helpers: `openIntegrateModal()`, `integrationRow()`, `getBranchBase()`
**Cleanup:**
- Merged `UpstreamIntegrationService` into `stackService` — upstream
status queries and mutations now live alongside other stack operations
- Removed `StackStatusesWithBranchesV3` type and
`getBaseBranchResolution` (joining now happens in the modal)
- Deleted old `integrate_upstream` endpoint and dead code in
`branchEndpoints.ts`
Return stack status entries instead of full stack objects
The API already returns status entries keyed by stack ID, so adjust the
component to use those entries directly instead of trying to join with a
separate stacks list. This simplifies logic, avoids relying on
getStackName/getStack lookup, and fixes incorrect data assumptions
implied by combineWithStacks. Changes: parse status entries from the
API, sort by integration state and branch name, update resolution kind
handling, build BottomUpdate payloads from stack IDs, and update the
template to iterate over status entries.
Accept Option<StackId> throughout upstream status handling
Revert earlier change that propagated StackId instead of Option<StackId>
and instead update codepaths to continue accepting Optional stack IDs
while preserving the optimizations made. Many functions, data
structures, iterations and tests were adjusted to use StackStatus with
an optional stack_id field (or to pattern-match the existing Option
inside loops) so we can keep nullable stack identifiers at the
API/schema boundary while simplifying internal handling and avoiding
unwraps. Changes include: UI Svelte component iteration and resolution
handling, Rust CLI/status/pull modules iteration and lookups, the
StackStatus struct and serialization/schema updates, callers of
get_stack_status to pass stack_id through, and numerous tests updated to
reference status.stack_id instead of tuple-based (Option, Status)
indexing.
Use but-graph for workspace upstream statuses
Replace legacy upstream integration path with a new implementation that
uses the but-graph workspace projection to compute per-stack upstream
integration statuses and worktree conflicts. This moves logic out of
gitbutler-branch-actions into a new workspace/upstream_statuses module,
updates callers to invoke the new function, and makes
StackStatus::create public to support the new flow. The change avoids
the old stack_details_v3 path and performs trial rebases and three-way
merges against the graph-derived workspace to determine conflicts and
integration state.
Remove legacy upstream integration APIs and code
Remove all callers and implementations of the legacy integrate_upstream
and upstream statuses APIs. These endpoints and helper functions have
been deleted from the server, tauri bindings, tests, and the
gitbutler-branch-actions crate; upstream integration status computation
and workspace integration are now handled by the newer workspace APIs
(e.g. but_api::workspace::workspace_integrate_upstream and
but_api::workspace::upstream_statuses). This cleans up dead legacy code,
removes unused types and tests, and updates call sites to use the new
workspace-oriented APIs.
Move upstream integration types into but-api workspace
Move the upstream integration types into but-api::workspace and update
all callers to import them from the new location. This removes the
legacy re-export from gitbutler-branch-actions and converts the
workspace module to expose a dedicated upstream_integration submodule.
The change updates imports across but, but-api, and
gitbutler-branch-actions (including virtual_branches, status, and pull
command code) to reference
but_api::workspace::upstream_integration::{...} and wires
upstream_statuses to use the relocated types.
f21d42c to
2fe9438
Compare
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
workspace_integrate_upstreamAPI for upstream integration in the desktop appIntegrateUpstreamModalfrom imperative fetching to reactive query subscriptions withReduxResultbottom_selectoronStackStatusso the frontend can constructBottomUpdateselectorsTest plan
🤖 Generated with Claude Code