Repository navigation
fix(web-shell): disable Push while the branch is behind its upstream #10754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
9b3ce46
fix(web-shell): disable Push while the branch is behind its upstream
wenshao bf4c301
fix(web-shell): reason about the push destination, not the upstream
wenshao e14460a
Merge branch 'main' into fix/webshell-push-hint-behind
qwen-code-dev-bot 9c30948
fix(web-shell): warn instead of disabling when the push counts look d…
wenshao c2a55dc
fix(web-shell): key the push row's silence on git naming no destination
wenshao 496bc77
Merge branch 'main' into fix/webshell-push-hint-behind
qwen-code-dev-bot 0020a64
Merge branch 'main' into fix/webshell-push-hint-behind
qwen-code-dev-bot 1725d09
fix(web-shell): keep the stale rows on screen through a post-action r…
qwen-code-dev-bot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # Push disabled on non-fast-forward states | ||
|
|
||
| ## Scenario | ||
|
|
||
| Open a trusted git workspace in the Web Shell and open the branch picker from | ||
| the sidebar git chip with the repo in each state: | ||
|
|
||
| 1. Tracking upstream, ahead 1 / behind 0 (pushable). | ||
| 2. Behind 3, clean tree, ahead 0. | ||
| 3. Ahead 1 / behind 1 (diverged). | ||
| 4. Conflicted merge in progress on the branch, ahead 1 / behind 1. | ||
| 5. Update Project blocked by uncommitted changes (409 panel up), ahead 1 / | ||
| behind 0; click Push while the panel shows. | ||
|
|
||
| ## Checks | ||
|
|
||
| - State 1: Push shows `↑1` and is enabled. | ||
| - State 2: Push shows "Nothing to push" (dimmed) and is now **disabled** — | ||
| pushing an older tip is a non-fast-forward the remote rejects | ||
| unconditionally. | ||
| - State 3: Push shows the warning `↑1 ↓1 · update first` and is now | ||
| **disabled** for the same reason. | ||
| - State 4: Push shows the warning "Merging" and stays **enabled** — during an | ||
| in-progress operation the behind count is in flux (concluding the merge is | ||
| what resolves it), so the row only warns. | ||
| - State 5: the pull-resolution panel clears and the push outcome shows in the | ||
| status line (unchanged from #10390's flow; the scenario's fixture must be | ||
| ahead-only now). | ||
| - A caller status and the popover's own on-open fetch carrying the same | ||
| `computedAt` render the fetched counters (tie breaks toward the fetch). | ||
|
|
||
| ## Evidence | ||
|
|
||
| Follow-ups to the sandboxed verification of #10397 (run 33195566824): F1's | ||
| measured rule (`detached || (!operation && hasUpstream && behind > 0)`, its | ||
| M6' row, green there on 170 tests) and F2's surviving M5 mutant | ||
| (`newerStatus` `>=` → `>`), now pinned. Local mutation A/B: reverting the rule | ||
| to `detached` fails 3 tests; `>=` → `>` fails exactly the tie-break test. | ||
|
|
||
| ```sh | ||
| cd packages/web-shell && npx vitest run \ | ||
| client/components/BranchPickerPopover.test.tsx \ | ||
| client/components/sidebar/WorkspaceSection.test.tsx \ | ||
| client/components/panels/EnvironmentPanel.test.tsx \ | ||
| client/components/ChatEditor.test.tsx | ||
| ``` | ||
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.