Skip to content

Wire up workspace_integrate_upstream API for stack rebase and upstream integration#13678

Draft
mtsgrd wants to merge 1 commit intomasterfrom
add-rebase-stack-modal
Draft

Wire up workspace_integrate_upstream API for stack rebase and upstream integration#13678
mtsgrd wants to merge 1 commit intomasterfrom
add-rebase-stack-modal

Conversation

@mtsgrd
Copy link
Copy Markdown
Contributor

@mtsgrd mtsgrd commented May 6, 2026

Summary

  • Adopt the workspace_integrate_upstream API for upstream integration in the desktop app
  • Refactor IntegrateUpstreamModal from imperative fetching to reactive query subscriptions with ReduxResult
  • Expose bottom_selector on StackStatus so the frontend can construct BottomUpdate selectors
  • Add e2e tests for "leave as is" behavior and branch base assertions

Test plan

  • All 7 upstream integration e2e tests pass
  • "Leave as is" test verifies branch base is unchanged while rebased branches advance
  • Manual: open integrate modal, verify per-stack resolution picker works (rebase/merge/leave as is)

🤖 Generated with Claude Code

@mtsgrd mtsgrd force-pushed the add-rebase-stack-modal branch from 36effc6 to 7c228ad Compare May 7, 2026 14:57
@mtsgrd mtsgrd changed the title [wip] Add stack-level rebase context menu item Wire up workspace_integrate_upstream API for stack rebase and upstream integration May 8, 2026
@mtsgrd mtsgrd force-pushed the add-rebase-stack-modal branch from 7c228ad to 93001e3 Compare May 8, 2026 13:42
@github-actions github-actions Bot added the rust Pull requests that update Rust code label May 8, 2026
@mtsgrd mtsgrd force-pushed the add-rebase-stack-modal branch 2 times, most recently from 90da8d5 to 576b1a6 Compare May 8, 2026 14:12
@mtsgrd
Copy link
Copy Markdown
Contributor Author

mtsgrd commented May 8, 2026

@Caleb-T-Owens is the new API ready for the svelte app to migrate?

@mtsgrd mtsgrd force-pushed the add-rebase-stack-modal branch 3 times, most recently from a6744da to cf6188c Compare May 9, 2026 16:11
**New features:**
- "Rebase onto target" context menu action with dry-run preview modal (`RebaseStackModal`)
- Per-stack resolution picker: rebase, merge, or "leave as is" (skip)
- Dry-run preview showing how many commits will be rewritten

**`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
- Statuses computed via `computeStatuses(rawData)` — pure function taking the query response as param
- `buildUpdates(statuses)` parameterized instead of reading module-level state
- Dry-run cache invalidation skipped when `args.dryRun` is true

**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 (joining now happens in the modal)
- Deleted old `integrate_upstream` endpoint and dead code in `branchEndpoints.ts`
- Removed `dryRunPromise` — dry-run errors handled via async try/catch
@mtsgrd mtsgrd force-pushed the add-rebase-stack-modal branch from cf6188c to 9257088 Compare May 9, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

@gitbutler/desktop rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant