improve and prevent silent thread branch drift and PR fetching#2284
improve and prevent silent thread branch drift and PR fetching#2284justsomelegs wants to merge 8 commits intopingdotgg:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Needs human review This PR introduces a new user-facing feature (branch mismatch warning popover with switch/update actions) and modifies PR matching logic in GitManager that affects which PRs are associated with threads. While well-tested, the new capability and behavioral changes to PR resolution warrant human review. You can customize Macroscope's approvability policy. Learn more. |
|
Heya I will properly review your PRs when we get back from Miami. Seems like some good stuff just don't have capacity to review big PRs while we're here |
What Changed
Improves the local branch mismatch warning in the branch picker.
Why
When using local checkout mode, the active Git branch can drift away from the branch a thread was last associated with. Previously this was easy to miss and could lead to continuing work on the wrong branch.
This makes the mismatch visible in-place and gives users clear recovery actions without changing branches automatically.
The thread’s associated branch should only change when the user intentionally chooses a branch for the thread, creates/checks out a branch through the picker, or clicks
Use currentin the warning popover. It should not change just because the shared local checkout moved while viewing an existing server thread.UI Changes
Screenshots/video to attach:
Use current/Switchactions.Checklist
Note
[!NOTE]
Fix thread branch drift and improve PR matching for cross-repo and dedicated worktree cases
matchesBranchHeadContextin GitManager.ts to reject ambiguous or mismatched PR head identities, including cross-repo PRs missing head metadata and same-repo PRs where identities conflict.GitActionsControlfrom overwriting an existing server thread's branch based on shared checkout state; automatic branch sync is now limited to draft threads.BranchToolbarBranchSelector: when the active thread's branch differs from the current local checkout (and no dedicated worktree is in use), a warning icon and popover appear with options to switch the checkout or update the thread.resolveThreadPrto return PR status for dedicated worktree threads regardless of stored branch metadata, so PR indicators appear even when branch data is stale.matchesBranchHeadContextbehavior changes may cause previously reused PRs to be rejected and new PRs created in cross-repo fork scenarios.Macroscope summarized fdc70b6.