-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add Azure DevOps remote repository support for remote indexing #1271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- 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]>
this._fullyLoadedPromise ??= (async () => { | ||
for (const uri of this.getWorkspaceFolders()) { | ||
if (isGitHubRemoteRepository(uri)) { | ||
if (isGitHubRemoteRepository(uri) || isAzureDevOpsRemoteRepository(uri)) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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]>
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
Added Azure DevOps URI detection: Created
isAzureDevOpsRemoteRepository()
helper function to identify ADO remote repositories by their URI scheme.Integrated ADO repos into CodeSearchRepoTracker:
openAdoRemoteRepo()
method to handle ADO-specific initializationHandled 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
isAzureDevOpsRemoteRepository()
functionFixes microsoft/vscode#268725
Original prompt
💡 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.