Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Oct 9, 2025

Problem

Users opening Azure DevOps repositories directly via the virtual file system URI vscode-vfs://azurerepos/{OrgName}/{ProjectName}/{RepoName} were unable to get remote indexing. The workspace index type would incorrectly show as "locally indexed" instead of "remotely indexed", preventing users from leveraging the remote code search capabilities.

This was working correctly for GitHub remote repositories (via vscode-vfs://github/{owner}/{repo}), but the same infrastructure wasn't being applied to Azure DevOps repos.

Solution

Added detection and initialization logic for Azure DevOps remote repositories in the CodeSearchRepoTracker, mirroring the existing implementation for GitHub remote repositories:

Key Changes

  1. Added Azure DevOps URI detection: Created isAzureDevOpsRemoteRepository() helper function to identify ADO remote repositories by their URI scheme.

  2. Integrated ADO repos into CodeSearchRepoTracker:

    • Added parallel initialization path for ADO remote repos alongside GitHub repos
    • Implemented openAdoRemoteRepo() method to handle ADO-specific initialization
    • Added URI validation to ensure the format has exactly 3 path segments (OrgName/ProjectName/RepoName)
  3. Handled diff computation: Updated diffWithIndexedCommit() to treat ADO remote repositories like GitHub repos (assumes no diff since the repo is virtual).

Technical Details

The implementation leverages the existing Azure DevOps infrastructure that was already in place (AdoRepoId, AdoCodeSearchService) but wasn't being triggered for virtual ADO repositories. The changes follow the exact same pattern as GitHub remote repositories to ensure consistency and maintainability.

Note: Workspace preloading support was intentionally not included as it may not be fully supported for ADO remote repositories yet.

Testing

  • Added comprehensive unit tests for the new isAzureDevOpsRemoteRepository() function
  • All existing unit tests pass
  • TypeScript compilation successful with no errors
  • Validated URI format checking prevents runtime errors with malformed URIs

Fixes microsoft/vscode#268725

Original prompt

This section details on the original issue you should resolve

<issue_title>Cannot use remotely index for remote repo in Azure Devops</issue_title>
<issue_description>I am trying to work on the remote repo (without clone in local) of Azure devops with github copilot, but I found the workspace index type of the remote repo is locally index after checking, if I clone the repo in local, the workspace index will become remotely index. I wonder how it could be remotely index as a remote repo without clone in local.
Here is my workspace file setting:
{ "folders": [ { "uri": "vscode-vfs://azurerepos/{OrgName}/{ProjectName}/{RepoName}" } ], "settings": {} }

  • Copilot Chat Extension Version: 0.31.3
  • VS Code Version: 1.104.2
  • OS Version:
    Edition Windows 11 Enterprise
    Version 24H2
    Installed on ‎10/‎22/‎2024
    OS build 26100.6508
    Experience Windows Feature Experience Pack 1000.26100.128.0
  • Feature (e.g. agent/edit/ask mode): Workspace Index
  • Selected model (e.g. GPT 4.1, Claude 3.7 Sonnet):
  • Logs:

Steps to Reproduce:

  1. Open the workspace directly
  2. Wait the index checking finish

</issue_description>

<agent_instructions>Add support for azure dev ops folders similar to how we support GitHub folders (see isGitHubRemoteRepository)</agent_instructions>

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

@mjbvz Thanks for the report. Can you please remind me how you're opening the azure dev ops repo directly

I know we don't support this yet but we should be able to. We do support it for GitHub repos </comment_new>

Fixes microsoft/vscode#268725

💡 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 3 commits October 9, 2025 07:46
- Add isAzureDevOpsRemoteRepository() helper function
- Initialize ADO remote repos in codeSearchRepoTracker
- Add openAdoRemoteRepo() method for handling ADO repo initialization
- Update diffWithIndexedCommit() to handle ADO remote repositories
- Update ensureWorkspaceIsFullyLoaded() to handle ADO remote repositories
- Add comprehensive unit tests for remote repository utils

Co-authored-by: mjbvz <[email protected]>
Add validation to ensure ADO remote repo URIs have the correct format with 3 path segments (org/project/repo) before attempting to create AdoRepoId objects. This prevents runtime errors with malformed URIs.

Co-authored-by: mjbvz <[email protected]>
Changed validation from `< 3` to `!== 3` to be more explicit about the expected ADO URI format with exactly 3 segments (OrgName, ProjectName, RepoName).

Co-authored-by: mjbvz <[email protected]>
@Copilot Copilot AI changed the title [WIP] Fix remote repo workspace index issue in Azure DevOps Add Azure DevOps remote repository support for remote indexing Oct 9, 2025
@Copilot Copilot AI requested a review from mjbvz October 9, 2025 07:56
Copilot finished work on behalf of mjbvz October 9, 2025 07:56
this._fullyLoadedPromise ??= (async () => {
for (const uri of this.getWorkspaceFolders()) {
if (isGitHubRemoteRepository(uri)) {
if (isGitHubRemoteRepository(uri) || isAzureDevOpsRemoteRepository(uri)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot Let's remove this part for now as I'm not sure it is supported yet

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the ADO support from ensureWorkspaceIsFullyLoaded() method. The file has been reverted to only check for GitHub remote repositories. (commit: short hash will be shown after commit)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the ADO support from ensureWorkspaceIsFullyLoaded() method. The file has been reverted to only check for GitHub remote repositories. (377ca05)

Removed Azure DevOps remote repository support from workspaceServiceImpl.ts as it may not be supported yet by the remote repositories service.

Co-authored-by: mjbvz <[email protected]>
Copilot finished work on behalf of mjbvz October 9, 2025 15:55
@Copilot Copilot AI requested a review from mjbvz October 9, 2025 15:55
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.

Cannot use remotely index for remote repo in Azure Devops

2 participants