[Feature]: Support non-origin upstreams when showing associated PRs
#6758
tyteen4a03
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Before submitting
Area
apps/web
Problem or use case
The app assumes the primary git remote is always named
originin several places that drive PR association:apps/server/src/sourceControl/SourceControlProviderRegistry.ts(selectProviderContext) picks the remote literally namedoriginfirst, before falling back to any other detected provider remote.apps/web/src/lib/baseRefChoices.tsprefers theoriginremote when resolving base ref candidates.apps/web/src/components/GitActionsControl.tsxdefaults the publish remote name to"origin"and its guidance copy ("Add anoriginremote before pushing...") assumes that name specifically.Repos cloned from a fork (where
originis the fork andupstreamis the real remote), or set up with a custom remote name, can end up with associated-PR lookups silently targeting the wrong remote, or missing the PR entirely iforigindoesn't point at the provider repo the PR actually lives on.Proposed solution
"origin"as the assumed remote when resolving which remote to query for associated PRs. Use the remote that the current branch actually tracks (its upstream) as the primary signal, falling back to provider-detection heuristics only when there's no tracking info.selectProviderContextso a branch's actual upstream remote wins over a same-namedoriginremote that isn't the tracked one.GitActionsControl.tsxcopy/defaults so they don't implyoriginis required, only that some remote must exist.Bonus point: If a branch has multiple PRs to different origins, T3 Code should show all PRs.
Why this matters
My setup has multiple remotes, one of which I habitually don't call
origin. While I can trivially rename my upstream, it may not be possible for others.Smallest useful scope
N/A - suggestion already the minimum scope. Implementing the bonus points however would be great!
Alternatives considered
No response
Risks or tradeoffs
No response
Examples or references
No response
Contribution
All reactions