Skip to content

Add "update stack" - #9013

Merged
Alex Ross (alexr00) merged 7 commits into
mainfrom
alexr00/established-galliform
Oct 7, 2026
Merged

Alex Ross (alexr00) merged 7 commits into
mainfrom
alexr00/established-galliform

Conversation

@alexr00

Copy link
Copy Markdown
Member

No description provided.

@alexr00 Alex Ross (alexr00) self-assigned this Oct 5, 2026
@alexr00
Alex Ross (alexr00) marked this pull request as ready for review October 7, 2026 11:06
Copilot AI balanced review requested due to automatic review settings October 7, 2026 11:06
@alexr00
Alex Ross (alexr00) enabled auto-merge (squash) October 7, 2026 11:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Unstacking does not acquire the shared lock, allowing concurrent stack rewrites, and action errors can remain stale.

Review effort: Balanced
Findings: 1 High severity · 1 Medium severity

Open (2)
What changed in this PR

Adds stack-wide branch updating through safe rebases, lease-protected pushes, and overview-panel controls.

Changes:

  • Adds stack eligibility detection and branch-update orchestration.
  • Adds temporary-worktree rebasing with local/remote safety checks.
  • Adds Update stack UI, status handling, and comprehensive tests.
File Description
webviews/​editorWebview/​test/​overview.test.tsx Tests stack update UI and readiness.
webviews/​editorWebview/​test/​builder/​pullRequest.ts Adds update eligibility fixture state.
webviews/​editorWebview/​index.css Styles stack actions and errors.
webviews/​components/​pullRequestStack.tsx Adds the Update stack action.
webviews/​components/​merge.tsx Suppresses merge-commit updates for stacks.
webviews/​common/​context.tsx Adds update-stack messaging.
src/​test/​github/​updateStackBranches.test.ts Tests branch rewrite safety.
src/​test/​github/​pullRequestOverview.test.ts Tests host-side stack updates.
src/​test/​github/​pullRequestModel.test.ts Tests stack update detection.
src/​test/​github/​folderRepositoryManager.test.ts Tests worktree repository opening.
src/​gitProviders/​builtinGit.ts Exposes worktree repositories.
src/​github/​views.ts Adds update state and result types.
src/​github/​updateStackBranches.ts Implements stack rebasing and pushing.
src/​github/​repositoriesManager.ts Publishes active-PR changes.
src/​github/​queriesShared.gql Fetches branch and queue metadata.
src/​github/​pullRequestOverview.ts Coordinates stack updates and locking.
src/​github/​pullRequestModel.ts Detects outdated stack branches.
src/​github/​interface.ts Defines stack update eligibility.
src/​github/​graphql.ts Types added GraphQL fields.
src/​github/​folderRepositoryManager.ts Opens temporary worktrees.
src/​commands.ts Supplies repository management globally.
src/​api/​api.d.ts Extends Git provider operations.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/github/pullRequestOverview.ts
Comment thread webviews/components/pullRequestStack.tsx
@alexr00
Alex Ross (alexr00) marked this pull request as draft October 7, 2026 11:14
auto-merge was automatically disabled October 7, 2026 11:14

Pull request was converted to draft

@alexr00
Alex Ross (alexr00) marked this pull request as ready for review October 7, 2026 12:38
Copilot AI balanced review requested due to automatic review settings October 7, 2026 12:38
@alexr00
Alex Ross (alexr00) enabled auto-merge (squash) October 7, 2026 12:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Repository selection, eligibility state handling, and concurrent checkout mutation can currently produce incorrect update behavior.

Review effort: Balanced
Findings: 1 High severity

Open (1)
Resolved since last review (2)
Previously missed (2)

In code that hasn't changed since last review

Medium severity Select the manager whose PR belongs to the current stack

src/​github/​pullRequestOverview.ts:115

This preference is based on any active PR from the repository, not an active PR in this stack. With two workspace clones, an unrelated PR can be active in the first candidate while a stack member is checked out in another; getCheckedOutPullRequestNumber may then choose a different manager (or the unrelated PR), causing the button to be hidden or the update to run against the wrong clone and fail its SHA check. Select one manager whose active PR number belongs to _updatableStackPullRequestNumbers, and use that same manager for both the active number and repository.

Medium severity Preserve canUpdateStack when the field is absent

webviews/​common/​context.tsx:593

Preserve the existing flag when this field is absent. The unchanged sender in src/github/issueOverview.ts:195-202 emits the same command with only isCurrentlyCheckedOut; handling that message here currently overwrites canUpdateStack with undefined, so an unrelated active-issue change can make the Update stack action disappear until the stack is reloaded.

Comment thread src/github/updateStackBranches.ts
@alexr00
Alex Ross (alexr00) merged commit d155b22 into main Oct 7, 2026
7 checks passed
@alexr00
Alex Ross (alexr00) deleted the alexr00/established-galliform branch October 7, 2026 13:24
@alexr00 Alex Ross (alexr00) added this to the 1.142.0 milestone Oct 9, 2026
@alexr00 Alex Ross (alexr00) mentioned this pull request Oct 9, 2026
3 tasks
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.

3 participants