Skip to content

fix(web): Push on the default branch no longer offers a feature branch the server rejects - #29845

Open
saphid wants to merge 1 commit into
pingdotgg:mainfrom
saphid:fix/gitactions-hunt
Open

saphid wants to merge 1 commit into
pingdotgg:mainfrom
saphid:fix/gitactions-hunt

Conversation

@saphid

@saphid saphid commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Problem

On web, if you're on the default branch with unpushed commits and uncommitted changes, the Git menu's Push is enabled (since #15625, Push no longer needs a clean tree). Clicking it opens the "Push to default branch?" dialog, and Check out feature branch & continue is enabled there. Clicking that sends push with featureBranch: true. The server rejects every non-commit action that asks for a feature branch (GitManager.runStackedAction: "Feature-branch checkout is only supported for commit actions."), so the user just gets an "Action failed" toast.

#18716 fixed this for clean trees. The dirty-tree case for push (and create_pr) was still open.

Change

resolveFeatureBranchUnavailableReason now also takes the pending action. For push and create_pr it returns a reason, so the button is disabled and the dialog explains why. This uses the same pattern #18716 added for clean trees. Commit actions on a dirty tree still offer the feature branch. Mobile already handles this case: GitConfirmSheet only sends featureBranch: true when the action includes a commit.

Scope and approval

Very small, focused fix for an obvious bug, so no prior issue: the web client offers a button the server always rejects, and the fix lines the existing guard up with the server's precondition (1 line in GitActionsControl.tsx, a few in the logic helper, plus one test). Overlap search: the local PR index and GitHub search turned up only #18716 (the merged clean-tree fix this extends) and its issue #18702. Open PRs #28652 and #29619 touch other git-action states, not this dialog.

Verification

  • Red on main: vp test run src/components/GitActionsControl.logic.test.ts failed at assert.isNotNull(reason("push", true)) with AssertionError: expected null to not equal null.
  • Green: the same file passes, 17/17.
  • vp run check:changed: format, lint, knip, typecheck (2 packages), test, and react compiler all pass.
  • Not checked: I didn't capture the dialog in a running client. The change only disables an existing button and shows reason text the dialog already renders.

Reviewed with sol-loop: 1 round with GPT-6.1 Sol on high. Sol verdict: approved.

Created with Claude Opus 5.5 in Claude Code (T3 Code).

🤖 Generated with Claude Code

…h the server rejects

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 3, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 17d60a9

Macroscope's review found this PR approvable — The dialog now disables feature-branch checkout for Push and Create PR because those actions do not commit changes and the server already rejects them. Commit workflows and explicit continuation on the current branch are unchanged.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

The feature-branch availability check now considers the requested action as well as whether the working tree has changes. The component passes the pending action, and tests cover the resulting conditions.

Changes: Feature Branch Availability

Layer / File(s) Summary
Action-aware availability check
apps/web/src/components/GitActionsControl.logic.ts, apps/web/src/components/GitActionsControl.tsx, apps/web/src/components/GitActionsControl.logic.test.ts
The check now considers the pending action and working-tree state. The component passes the action, and tests cover commit, push, and create-PR cases.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: mnigos

Merge Risk: Minimal · up to 17d60

The change correctly limits feature-branch continuation to actions that can create the required commit.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main web fix: Push on the default branch no longer offers an invalid feature-branch flow.
Description check Passed The description includes complete Problem, Change, Scope and approval, and Verification sections. It explains the server rejection, the implementation, the focused-scope rationale, and specific test r…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description includes complete Problem, Change, Scope and approval, and Verification sections. It explains the server rejection, the implementation, the focused-scope rationale, and specific test results. It also states that running-client verification and screenshots were not provided, but this is a minor omission for the focused guard change.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ast-grep (0.51.1)

ast-grep could not parse rule config: /ast-grep-rules/ast-grep-essentials/rules/rust/security/reqwest-accept-invalid-rust.yml

Usage-based review receipt

Note

This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. View usage-based billing.

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between e0f69e9 and 17d60a9.

Files selected for processing: 3
  • apps/web/src/components/GitActionsControl.logic.test.ts
  • apps/web/src/components/GitActionsControl.logic.ts
  • apps/web/src/components/GitActionsControl.tsx

Limit details: You’ve used all 10 included reviews currently available.

@maria-rcks

maria-rcks commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Note

Written by gpt-6.1-sol on behalf of Maria

Verified in a real dev environment

Verified unchanged head 17d60a9f984b9fdeacdfff2848e47215608dba6d on Linux using the running dev web client, the repository Playwright dependency, and /usr/bin/google-chrome. Created the project through the app and used real Codex gpt-6.1-sol turns to prepare and inspect a real git repository with a local bare origin. No mocks or fixtures.

  • Reproduced on github/main (61c3794c32): with one unpushed commit and an uncommitted README change on main, Git action options → Push offered feature-branch checkout. Clicking it sent push with featureBranch: true; the server returned Feature-branch checkout is only supported for commit actions.
  • Ran the exact PR head against the same project, thread, commit and dirty file. The feature-branch button is disabled and explains that Push does not commit changes. Abort leaves the repository unchanged.
  • Clicked Push to main. The app showed Pushed to origin/main; the real remote received the existing commit and README remained uncommitted. A second real Codex turn through the PR build confirmed this.
  • Clicked Commit & push → Check out feature branch & continue. It generated feature/docs-verification-change, committed the dirty file, pushed it, and updated the client/thread branch. The working tree was clean afterward.

Short runtime transcript from the real repository and bare origin:

After Push to main:
$ git status --short --branch
## main...origin/main
 M README.md
$ git rev-parse HEAD
8a94811d69238c457d08a2e52022657d45750423
$ git --git-dir=/home/user/gitactions-verification-remote.git rev-parse main
8a94811d69238c457d08a2e52022657d45750423

After feature-branch Commit & push:
$ git status --short --branch
## feature/docs-verification-change...origin/feature/docs-verification-change
$ git rev-parse HEAD
97bec8db53609a821d765af6d283e1e2237f2f09
$ git --git-dir=/home/user/gitactions-verification-remote.git rev-parse feature/docs-verification-change
97bec8db53609a821d765af6d283e1e2237f2f09

blacksmith-check passed the focused logic tests (17/17) and vp run check:changed HEAD^: format, lint, both knip checks, affected typechecks, tests and React compiler checks. The explicit base was needed because the worker initially had shallow snapshot history; fetched the exact head with depth 2 before rerunning. Existing CI reports 32 successful checks, none pending or failing.

Before, main with the invalid feature-branch action enabled:

Main offers feature-branch checkout for Push

After, the same data on the PR head:

PR disables feature-branch checkout for Push and explains why

The 10-second recording shows the Push guard, Abort, the still-enabled commit feature-branch option, and a successful Push to main. Inspected the capture and verified uploaded playback.

PR Push guard and successful continuation on main

Not verified

Native desktop shell, iOS/Android, macOS/Windows, remote/relay/tunnel connections, and providers other than Codex were not exercised on this Linux VM. Hosted PR creation and the create_pr confirmation branch were not exercised: the isolated repository uses a local bare origin, and Create PR was disabled on the default branch. The focused test covers its action guard. No external repository or additional PR was created, and no source changes were needed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants