repository: Resolve PRs against the upstream repo when available - #1424
Open
huntie wants to merge 1 commit into
Open
repository: Resolve PRs against the upstream repo when available#1424huntie wants to merge 1 commit into
huntie wants to merge 1 commit into
Conversation
|
This pull request has been imported. If you are a Meta employee, you can view this in D117880759. (Because this pull request was imported automatically, there will not be any future comments.) |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixes resolution of Pull Requests in ISL, in the case when a Git repo is cloned with both
originandupstreamremotes (as is the default forgh repo clonewith a user fork of an open source repo).Example
For a
react-nativecheckout whoseoriginishuntie/react-native, ISL queries that repo for pull requests that instead live on the upstreamreact/react-native. It finds nothing, and therefore every pull request stays stuck loading against the wrong repo:Root cause
getRepoInfobuildscodeReviewSystemfrompaths.defaultalone, so it always lands on the push remote. The CLI does not:try_find_upstreamin the github extension resolves a bare pull request number againstpaths.upstreambeforepaths.default, andsl pr submittargetsget_upstream_owner_and_name(). So the CLI files and reads pull requests upstream while ISL looks for them in the fork — they never agree.Fix
Resolve
codeReviewSystemfrom an ordered list of candidate repos rather than frompaths.defaultalone: preferpaths.upstreamwhen it names a GitHub repo, and fall back topaths.defaultotherwise. Leave repos with no upstream untouched — the fallback is then the only candidate.This is the precedence Sapling's CLI already applies, so ISL and
sl prnow resolve a checkout's pull requests to the same repo.Note: This touches only
codeReviewSystem, which feeds the code review provider — pull request queries, review links, and remote file links. Push and pull still usepaths.default.Test Plan
✅ Upstream PRs resolve