Support child repositories in code review panel#10249
Conversation
|
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: xiongyiming.
|
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
1a21c6a to
bdf1844
Compare
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @easoll on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment |
There was a problem hiding this comment.
Overview
This PR adds detection of direct child git repositories from non-repo terminal directories and wires those detected repos into the Code Review panel repository list and open-panel fallback path.
Concerns
- Parent directories are permanently marked as scanned before the async child scan has succeeded or any children were found, so repositories created later under that same workspace are never discovered from the parent CWD.
Verdict
Found: 0 critical, 1 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
| let local_path_for_search = path.to_local_path(); | ||
| let should_detect_child_repos = | ||
| matches!(source, RepoDetectionSource::TerminalNavigation) | ||
| && self.child_repo_scan_roots.insert(path.clone()); |
There was a problem hiding this comment.
git clone creates a child repo after the first metadata update, later RepoChanged events still call detect_possible_git_repo for the same path but insert returns false, so the new child repo is never discovered from the parent CWD. Only mark the path after a successful scan that found children, or add an invalidation/rescan path for terminal navigation.
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
bdf1844 to
7f57108
Compare
|
/oz-review |
|
I'm re-reviewing this pull request in response to a review request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR adds detection of direct child repositories below a non-repository terminal CWD and falls back to known repository state when opening Code Review from that parent directory.
Concerns
- The new terminal-to-repository mapping can associate multiple child repositories with the same focused terminal, but the existing focused-repository derivation picks from that map by iteration order. This can make the selected/focused repository nondeterministic when a parent directory contains more than one repository.
Verdict
Found: 0 critical, 1 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
|
|
||
| if self.get_repo_root_for_path(&root_path, ctx).is_none() { | ||
| for repo_root in self.get_descendant_repo_roots_for_path(&root_path, ctx) { | ||
| new_root_to_terminal.insert(repo_root, *terminal_id); |
There was a problem hiding this comment.
new_root_to_terminal with the same focused terminal makes the later focused-terminal pass treat all child repos as focused; because this map is a HashMap, focused_repo becomes whichever child repo iterates last. Derive the focused repo from the actual CWD/selected repo, or keep these fallback mappings out of focused repo selection, so the Code Review selector does not jump nondeterministically when the parent contains multiple repos.
7f57108 to
1f06244
Compare
|
/oz-review |
|
I'm re-reviewing this pull request in response to a review request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR adds direct child repository detection for non-repo terminal directories and wires those detected repositories into the Code Review panel selection flow.
Concerns
- The new fallback terminal mapping is not honored by the existing review terminal availability check, so opening Code Review from a non-repo parent can still leave review submission unavailable for the selected child repo.
- For faster review, please upload screenshots or a video of the Code Review panel working end to end from a non-repo parent directory.
Verdict
Found: 0 critical, 1 important, 1 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
|
|
||
| if self.get_repo_root_for_path(&root_path, ctx).is_none() { | ||
| for repo_root in self.get_descendant_repo_roots_for_path(&root_path, ctx) { | ||
| new_root_to_terminal.insert(repo_root, *terminal_id); |
There was a problem hiding this comment.
RightPanelView::review_terminal_status still requires the terminal CWD to be inside repo_path, so the mapped fallback terminal is rejected and review submission remains unavailable from the parent directory.
1f06244 to
5ebfe71
Compare
|
/oz-review |
|
I'm re-reviewing this pull request in response to a review request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
|
Addressed the latest Oz concern about review terminal availability. The selected repo -> terminal mapping is now honored when computing review terminal status: a repo-mapped terminal can be rooted at a non-repo parent directory, while unmapped terminals still have to be inside the selected repo. This keeps the fallback terminal route working for child repos discovered from a parent CWD without loosening availability for unrelated terminals. Added tests:
Also reran the existing targeted coverage:
|
There was a problem hiding this comment.
Overview
This PR adds detection of child repositories under a non-repo terminal CWD and wires those repositories into Code Review panel fallback selection and terminal routing.
Concerns
- The descendant fallback terminal mapping can overwrite an existing mapping for a terminal that is actually inside the selected repo, so Code Review may prefer the non-repo parent terminal even when a repo-local terminal is available.
- For faster review, please upload screenshots or a video of the feature working end to end.
Verdict
Found: 0 critical, 2 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
|
|
||
| if self.get_repo_root_for_path(&root_path, ctx).is_none() { | ||
| for repo_root in self.get_descendant_repo_roots_for_path(&root_path, ctx) { | ||
| new_root_to_terminal.insert(repo_root, *terminal_id); |
There was a problem hiding this comment.
repo_root when the parent terminal is processed later, causing Code Review to route comments to the non-repo parent instead of the repo terminal; keep existing repo mappings when inserting descendant fallbacks.
| new_root_to_terminal.insert(repo_root, *terminal_id); | |
| new_root_to_terminal.entry(repo_root).or_insert(*terminal_id); |
5ebfe71 to
f24fc74
Compare
|
/oz-review |
|
I'm re-reviewing this pull request in response to a review request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
|
Addressed the latest Oz concern about descendant fallback mappings overwriting repo-local terminals. The fallback insertion now preserves any existing repo mapping: This means a terminal whose CWD is actually inside the selected repo remains preferred, while the non-repo parent terminal is only used as a fallback when no repo-local terminal mapping exists. Added regression coverage:
Reran targeted coverage:
|
|
Addressed the latest Oz concern about descendant fallback mappings overwriting repo-local terminals. The fallback insertion now preserves any existing repo mapping: new_root_to_terminal
.entry(repo_root)
.or_insert(*terminal_id);This means a terminal whose CWD is actually inside the selected repo remains preferred, while the non-repo parent terminal is only used as a fallback when no repo-local terminal mapping exists. Added regression coverage:
Reran targeted coverage:
|
There was a problem hiding this comment.
Overview
This PR adds direct child repository detection for non-repo terminal directories and routes the Code Review panel to detected or selected repositories when the active terminal CWD is outside a repo.
Concerns
- For faster review, please upload screenshots or a video of the Code Review panel working end to end from a non-repo parent directory, including selecting a detected child repository. The repository guidance requires visual evidence for user-visible behavior changes.
Verdict
Found: 0 critical, 1 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
f24fc74 to
8908555
Compare
|
/oz-review |
|
/oz-review |
|
I'm re-reviewing this pull request in response to a review request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR adds detection of direct child Git repositories from a non-repo terminal CWD and wires those repositories into the Code Review panel fallback/terminal-selection path.
Concerns
- The change affects user-visible Code Review panel behavior, but the PR description does not include screenshots or a video showing the selection and review-routing flow from a non-repo parent directory. For faster review, please upload screenshots or a video of the feature working end to end.
Verdict
Found: 0 critical, 1 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
There was a problem hiding this comment.
Overview
This PR expands Code Review repository discovery and routing so a non-repo parent directory can surface detected child repositories and use a mapped terminal when sending review comments.
Concerns
- This changes user-visible Code Review panel behavior, but the PR description does not include screenshots or a video demonstrating repository selection and review-comment routing from a non-repo parent directory. For faster review, please upload screenshots or a video of the feature working end to end.
Verdict
Found: 0 critical, 1 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
|
/oz-review |
|
I'm re-reviewing this pull request in response to a review request. You can view the conversation on Warp. I reviewed this pull request and requested human review from: Comment Powered by Oz |
Oz no longer requests changes for this pull request after the latest automated review.
There was a problem hiding this comment.
Overview
This PR adds direct child repository detection for non-repo working directories, includes those child repositories in pane-group Code Review repository selection, and routes review terminals deterministically while filtering deleted cached repositories.
Concerns
- No blocking correctness or security concerns found in the changed lines.
Verdict
Found: 0 critical, 0 important, 0 suggestions
Approve
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
There was a problem hiding this comment.
Hey @easoll - thanks so much for the contribution! Looks like a useful feature. Wasn't able to find a linked issue for this - can you link one from our public repo issues here and re-request a review?
If there isn't already an issue that covers this change, would be great if you filed one either manually or with our /feedback slash command! Generally the way that we like to do this is manually mark issues as ready-to-spec/implement after resolving any product or technical ambiguity :)
Sending to KC since he has more context re: Code Review!
|
Thanks @vkodithala. I filed a public issue for this change and linked it from the PR description: I also added |
|
Small correction: I tried to re-request review via GitHub, but fork authors do not have permission to execute The linked public issue is now filed and referenced in the PR body as |
8908555 to
5869fc9
Compare
|
Updated the branch after linking the public issue (#10719). I rebased onto the latest upstream master to clear the dirty branch state, resolved the test conflict by keeping both the upstream selected-review-repo coverage and this PR's child-repo coverage, and re-ran the targeted tests locally. |
5869fc9 to
b48e851
Compare
|
Rebased onto the latest upstream master and resolved the new conflicts. The conflict resolution keeps the upstream local/remote repository cache support while retaining the child-repository discovery path for local non-repo parent directories. Targeted local checks passed: cargo fmt, repo_metadata repository tests, pane working-directory tests, and right-panel review path tests. |
vkodithala
left a comment
There was a problem hiding this comment.
Hey @easoll, thanks again for the contribution. We're not yet sure if we want to support this functionality, and will be tracking your issue for interactions: #10719 (comment). Leaving a stale "request changes" placeholder for now - will be sure to revisit this if we end up supporting!
In the future, make sure you've opened an issue that's been marked ready-to-spec/implement by an internal reviewer before making code changes :)
Summary
Visual evidence
The active terminal CWD is
~/workspace/tmp, which is not itself a git repository. The Code Review panel opens from that parent directory, the repository selector lists detected child repositories, and selectingwarp-git-repo-1renders its uncommitted diff.Tests
cargo fmt --all -- --checkgit diff --checkPATH="/tmp/warp-fake-bin:$PATH" cargo test -p repo_metadata repositories::tests --features local_fsPATH="/tmp/warp-fake-bin:$PATH" cargo test -p warp refresh_working_directories --features local_fsPATH="/tmp/warp-fake-bin:$PATH" cargo test -p warp workspace::view::right_panel::tests --features local_fsLinked issue
Closes #10719