← 输入框|github.com|刷新
Skip to content

Check stack eligibility in the base repository when the fork has a different name - #9149

Draft
Alex Ross (alexr00) with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-repeated-stack-eligibility-warning
Draft

Alex Ross (alexr00) with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-repeated-stack-eligibility-warning

Conversation

Copilot AI commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Creating a PR from a fork whose name differs from the base repo (e.g. me/microsoft-vscode → microsoft/vscode) shows "Unable to check pull request stack eligibility: Unable to find the selected base repository." on every PR.

CreatePullRequestDataModel held one repositoryName, which is the compare (fork) repo's name. The stack check also used it as the base repo's name, so it looked up microsoft/microsoft-vscode. That lookup 404s. The missing repo is then cached as inaccessible, so every later check fails immediately and warns again.

Changes

  • CreatePullRequestDataModel
    • Adds baseRepositoryName, which fires a change event when it changes.
    • The new constructor parameter defaults to repositoryName, so callers that don't pass it keep their old behavior (e.g. pr.generateTitleAndDescription).
  • CreatePullRequestHelper: seeds baseRepositoryName from pullRequestDefaults.repo.
  • CreatePullRequestViewProvider
    • Keeps baseRepositoryName updated when the base is detected or picked:
      • onBaseBranchDetected now receives the full base RemoteInfo instead of just the owner;
      • the base path of processRemoteAndBranchResult sets it.
    • Uses baseRepositoryName for every stack eligibility check:
      • the model onDidChange handler;
      • setDefaultCompareBranch;
      • the compare path of processRemoteAndBranchResult.
    • The onDidChange handler also uses it to find the base remote it sends to the webview. A change to baseRepositoryName alone now triggers that lookup too.
// before
{ owner: this.model.baseOwner, repositoryName: this.model.repositoryName }
// after
{ owner: this.model.baseOwner, repositoryName: this.model.baseRepositoryName }

Tests

Four new tests in createPRViewProvider.test.ts set up a fork fork/test-fork of github/test. Each covers one path that checks stacks and asserts that the lookup targets the base repo and no warning is shown.

Not addressed

These spots still look up the base repo by the fork's name or owner. They don't cause this warning, so they are left for a follow-up:

  • getBaseRemote / getBaseGitHubRepo
  • getLabelOptions
  • the template repo: value
  • mergeQueueMethodForBranch
  • findIssueContext
  • the model's owner-only baseRemoteName lookup

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix repeated stack eligibility warning when creating PRs Check stack eligibility in the base repository when the fork has a different name Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Repeated stack eligibility warning when creating PRs

2 participants