Skip to content

Comments

Don't prompt to fetch additional remotes when user explicitly configures them#8219

Merged
alexr00 merged 7 commits intomainfrom
copilot/fix-fetching-additional-remotes
Dec 11, 2025
Merged

Don't prompt to fetch additional remotes when user explicitly configures them#8219
alexr00 merged 7 commits intomainfrom
copilot/fix-fetching-additional-remotes

Conversation

Copy link
Contributor

Copilot AI commented Dec 8, 2025

  • Understand the problem: When users configure githubPullRequests.remotes with explicit remotes, the system should automatically fetch from all configured remotes instead of prompting "Continue fetching from other remotes"
  • Identify the root cause: In fetchPagedData method (folderRepositoryManager.ts), the loop breaks early after finding results from first remote, causing hasUnsearchedRepositories to be true
  • Modify fetchPagedData to continue through all configured remotes when user has explicitly set them
  • Run linting and build checks - all passed
  • Address code review feedback - improved variable names and readability
  • Remove unrelated file changes
  • Run security checks - no vulnerabilities found
  • Fix hasMorePages to show "Load more" button correctly

Summary

The fix now correctly:

  • Shows "Load more" when any repository has more pages (using itemData.hasMorePages)
  • Shows "Continue fetching from other remotes" only when breaking early with unsearched repositories
  • Automatically searches all configured remotes without prompting when user explicitly sets them
Original prompt

This section details on the original issue you should resolve

<issue_title>Don't ask to fetch additional remotes when I provide a full list</issue_title>
<issue_description>Microsoft/vscode#67294

I set this:

  "githubPullRequests.remotes": [
    "ups",
    "origin"
  ]

But it still asks to fetch all of them, it should do this automatically as I've said I'm interested in those remotes.

image
</issue_description>

Comments on the Issue (you are @copilot in this section)

@Tyriar This is pretty annoying, every time I want to checkout/review a PR in xterm.js I need to click continue fetching (because my fork still has a PR in it).

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 4 commits December 8, 2025 14:53
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
When users explicitly configure githubPullRequests.remotes, the extension
should automatically fetch from all configured remotes instead of prompting
"Continue fetching from other remotes" after finding results in the first one.

This change modifies the fetchPagedData method to detect when remotes have
been explicitly configured (via global, workspace, or folder settings) and
skips the early break logic that was causing the prompt to appear.

Fixes microsoft/vscode-pull-request-github#XXXXX

Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
- Renamed hasExplicitRemotesConfig to hasUserConfiguredRemotes for clarity
- Extracted complex conditional logic into well-named boolean variables
  (hasReceivedData, isFetchingNextPage, hasReachedPreviousFetchLimit, shouldBreakEarly)
  to improve readability and make the logic more self-documenting

Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issue with fetching additional remotes Don't prompt to fetch additional remotes when user explicitly configures them Dec 8, 2025
Copilot AI requested a review from alexr00 December 8, 2025 15:06
Copy link
Member

@alexr00 alexr00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now the "load more" doesn't show. We still want that to show, just not the "continue fetching from other remotes".

Copilot AI and others added 2 commits December 11, 2025 11:59
When user configures remotes and we loop through all of them, we should
preserve itemData.hasMorePages so that the "Load more" button appears
if any repository has more pages. Previously, we were returning
hasMorePages: false which prevented the "Load more" button from showing.

Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 11, 2025

Now the "load more" doesn't show. We still want that to show, just not the "continue fetching from other remotes".

Fixed in commit ac92efd. Changed the final return to preserve itemData.hasMorePages instead of hardcoding it to false. This ensures "Load more" shows when any repository has more pages, while "Continue fetching from other remotes" only appears when breaking early with unsearched repositories.

Copilot AI requested a review from alexr00 December 11, 2025 12:04
@alexr00 alexr00 marked this pull request as ready for review December 11, 2025 14:30
@alexr00 alexr00 enabled auto-merge (squash) December 11, 2025 14:30
@vs-code-engineering vs-code-engineering bot added this to the December / January 2026 milestone Dec 11, 2025
@alexr00 alexr00 merged commit 381a8b1 into main Dec 11, 2025
6 checks passed
@alexr00 alexr00 deleted the copilot/fix-fetching-additional-remotes branch December 11, 2025 14:53
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.

Don't ask to fetch additional remotes when I provide a full list

3 participants