Repository navigation
Add read-only Azure DevOps Server (on-prem) pull request review mode - #1658
Closed
jharperTBE wants to merge 1 commit into
Closed
jharperTBE wants to merge 1 commit into
jharperTBE wants to merge 1 commit into
Conversation
Gated behind --server-url. Adds a collection-scoped REST client, Windows integrated authentication via a PowerShell HttpClient worker (SSPI), PAT fallback, local unified diffs, and five read-only onprem_* tools for PR metadata, changes, diffs, file content, and threads. Cloud behavior is unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Author
|
Opened by mistake; closing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The local server only supports Azure DevOps Services today, because several of the endpoints it uses (tenant discovery, Entra sign-in, and some cloud-only APIs) don't exist on-prem. This PR adds a narrow, opt-in mode so agents such as the GitHub Copilot CLI can review pull requests on Azure DevOps Server 2019+ using Windows integrated authentication.
Approach
--server-url. With the flag, the positional argument is the collection name. The server skips tenant discovery and Entra auth and registers only the new read-only tools. Without the flag, cloud startup is unchanged.src/onprem/client.ts,config.ts). The defaultapi-versionis5.0(Server 2019) and can be changed with--api-version. The client validates the URL and collection, only builds requests inside the configured collection URL, and never follows redirects.src/onprem/transport.ts). Node/undici can't do SSPI, so requests go through a persistent hidden PowerShell worker. The worker uses .NETHttpClientwithUseDefaultCredentials(NTLM/Negotiate as the signed-in user), and Node never holds a secret.-a patis also supported (PERSONAL_ACCESS_TOKEN, Basic).src/tools/onprem-pull-requests.ts), all annotated read-only and wrapped with the existing content-safety spotlighting:onprem_project_listonprem_repository(list/get)onprem_pull_request(list/get/commits/iterations/work_items)onprem_pull_request_change(list/diff/content)onprem_pull_request_threadsrc/onprem/diff.ts). The server has no text-diff REST API, so the tool fetches the base (merge base) and source blobs and computes an LCS diff locally. Very large inputs are size-capped.docs/ONPREM.md, plus links fromdocs/FAQ.mdanddocs/GETTINGSTARTED.md.Areas for careful review
-EncodedCommand). Constrained Language Mode or app control policies can block it, and in that case the error is returned to the caller.windowsis a new--authenticationchoice. The yargs default was removed so on-prem mode can default towindows. The effective cloud default (interactive) is unchanged.GitHub issue number
N/A
Associated Risks
createMcpServer()extracted, auth default computed after parsing). The full test suite passes.paton other platforms.✅ PR Checklist
🧪 How did you test it?
npx jest: passed (26 suites, 1392 tests). New tests cover config validation, the diff algorithm, the client (URL guarding, errors), the transport (worker protocol, timeouts, restarts, PAT), the tools, and registration. The tool-annotation count was updated from 45 to 50.npx tsc --noEmit,npm run build,npx eslinton changed files,npx prettier --check src test docs,npm run validate-tools: all passed.-a windowsand the signed-in user's credentials: