Repository navigation
Conversation
Adds full Azure DevOps pull request review support as a first-class platform alongside GitHub and GitLab, following the same provider pattern (pr-provider.ts dispatch → platform-specific implementation). ## What's new ### URL parsing - `https://dev.azure.com/{org}/{project}/_git/{repo}/pullrequest/{id}` - `https://{org}.visualstudio.com/{project}/_git/{repo}/pullrequest/{id}` (legacy) - URL-encoded project/repo names decoded automatically - Case-insensitive `pullrequest` segment ### PR diff strategy 1. Try `git diff <baseSha>..<headSha>` locally (fast path) 2. If commits not present, try `git fetch origin` + retry 3. Fall back to ADO REST API: iterates PR change entries, fetches old/new file content at the base/head SHAs, builds a git-style unified diff using a self-contained LCS diff engine (no deps) ### Submitting reviews - General comments → `POST /threads` via ADO REST API - Inline file comments → `POST /threads` with `threadContext` position - Approve → `PUT /reviewers/{userId}` with `vote: 10` - User ID resolved from `_apis/connectionData` at submit time ### Auth - All `az rest` calls use `--resource 499b84ac-1321-427f-aa17-267ca6975798` to acquire an ADO-scoped token (ARM token rejected by ADO APIs) - `az repos pr show` uses ADO extension which handles auth natively ### UI - `AzureDevOpsIcon` component added to `packages/ui/components/` - Review destination button shows the ADO icon when reviewing ADO PRs - `@plannotator/ui/config` export added to `packages/ui/package.json` (was missing — `config/index.ts` existed but was undeclared) ### Types - `AzureDevOpsPRRef` and `AzureDevOpsPRMetadata` added to `pr-provider.ts` - `Platform` union extended to `"github" | "gitlab" | "azuredevops"` - All label helpers (`getPlatformLabel`, `getMRLabel`, etc.) updated - New types re-exported from `packages/server/pr.ts` ### Tests (22 new) - Full URL parsing coverage (dev.azure.com, visualstudio.com, encoded, case-insensitive, large IDs) - GitHub/GitLab regression tests - `buildFilePatch`: add/edit/delete/rename, empty diff, no-trailing-newline, hunk merging for nearby changes, hunk splitting for distant changes - `computeHunks`: identical, add, delete, replace ## Prerequisites (user-side) ```bash brew install azure-cli az extension add --name azure-devops az login ``` Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Owner
|
TLDR: Closing in favor of an extension seam rather than per-platform core patches. AI-assisted note. Thanks @jmbp1999 for the complete implementation. The direction we want is the provider override discussed in #671, so third-party platforms (Azure DevOps, Bitbucket, Gitea) plug in without each needing a merged core patch. Azure DevOps is the natural first consumer of that seam, and this PR is a solid reference for it. If you want to help shape the seam, #671 is the thread. |
backnotprop
added a commit
that referenced
this pull request
Nov 4, 2026
…f a tree stack's chain only Thread name (owner, q-49bd0699 A): pullHandoffThreadName gives "Review #869: <title>" (GitLab !61; a stack "Review #412 to #414: …"), one line, cut to the thread-name limit. Hand sends it as the person's thread_name and starts the thread without it when another open thread has it; + New agent opens compose with it in the chip. The message body is unchanged. Review fixes: a tree stack hands over only the chain up to the layer the view is open on (handoffStack), so its list, step 1's "to" branch and "in list order" stay true. One open-layer helper (openLayers, isOpenPull); the opening and step 2 are built once for a PR and a stack. Tests for the names, the prefill, a taken name, a tree, a GHE host; the server fixture's ask_line is the current step 1. Co-Authored-By: Claude <[email protected]>
backnotprop
added a commit
that referenced
this pull request
Nov 4, 2026
…be handed on its own Review findings 2 to 5 on #2606 (finding 1, the name on a re-handed PR, waits on the owner). - Tree stacks: the thread name says "#412 to #414" only for a straight run of the stack's open layers; a chain that skips one reads "Review #412, #414: <title>" (numbers cut with ", …" past 60 characters, the name within 120). - handoffStack(stack, links, thread) replaces the target parameter the UI never used: the layers no thread has yet (or the ones a thread has, for Hand again). After #412 and #414 go to one thread, the stack view says "No agent yet for #413" and hands #413 on its own, a single PR's hand-off against #412's branch. - layerVerdictLink: in a tree a layer falls back only to the thread of a layer above it on its own chain, so #413's verdict never goes to #412/#414's thread. - One open-PR rule: core exports inboxPullIsOpen; the stacks, the server's pull review route, postRules, PullReview's layer strip and PullsPage use it. The thread name is computed once per hand-off line. - Titles are cut between graphemes (Intl.Segmenter), never inside a ZWJ sequence or a flag; a title of only zero-width characters is "(no title)". Message text is byte-identical for every non-tree variant (before/after compare).
backnotprop
added a commit
that referenced
this pull request
Nov 4, 2026
The owner has not approved "No agent yet for #413" or a second "Ask for" line, and is redesigning this page, so this PR adds no visible text or layout. The stack view renders as on main: "No agent yet" only with no agent, one hand-off line (Ask for, or Hand again for). A tree's sibling left out of the agent's chain shows what main shows for any linked stack. Kept (invisible): tree verdict routing (#413 has no agent until it is linked), "Review #412, #414: …" for a chain that skips a layer, the shared inboxPullIsOpen, grapheme-safe titles. handoffStack is unchanged; the page uses it for the first hand-off (the chain to the top) and Hand again. Tests: the DOM test for the sibling's own hand-off line is gone; a DOM test now checks the page hands a tree's chain to its top and then shows no extra line. Routing and name tests stay.
backnotprop
added a commit
that referenced
this pull request
Nov 4, 2026
Main's pull hand-off work (isOpenPull/openLayers, handoffStack for a tree) meets this branch's topology.ts. stackLink, layerVerdictLink, startLayer and nextLayer stay in topology.ts; main's tree hand-off helpers stay in model.ts. layerVerdictLink keeps both rules: a layer takes the thread of a linked layer on its own line, and in a fork never a thread that has an open layer on another branch (a thread handed #412 and #414 is not #413's). pullHandoffThreadName takes the links, as stackTitle now does.
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.
Summary
Adds full Azure DevOps pull request review as a first-class platform alongside GitHub and GitLab, following the same provider pattern used throughout the codebase.
What's included
New platform support
dev.azure.comand legacyvisualstudio.comPR URLspullrequestsegmentDiff fetching (two-stage fallback)
git diff <baseSha>..<headSha>locally (fast path — works when repo is cloned)Review submission
POST /threadsvia ADO REST APIPOST /threadswiththreadContextposition infoPUT /reviewers/{userId}withvote: 10; user ID resolved from_apis/connectionDataaz restcalls use--resource 499b84ac-1321-427f-aa17-267ca6975798to get an ADO-scoped token (ARM token is rejected by ADO APIs)UI
AzureDevOpsIconcomponent added@plannotator/ui/configexport inpackages/ui/package.json(theconfig/directory existed but was not declared in exports)New types
AzureDevOpsPRRef,AzureDevOpsPRMetadatainpr-provider.tsPlatformunion extended:github | gitlab | azuredevopsgetPlatformLabel,getMRLabel,getMRNumberLabel,getDisplayRepo,getCliName,getCliInstallUrl) updatedpackages/server/pr.tsTests
22 new tests in
packages/shared/pr-azuredevops.test.ts:dev.azure.com,visualstudio.com, URL-encoded names, case-insensitive, large IDsbuildFilePatch: add/edit/delete/rename, identical files, no trailing newline, hunk merging, hunk splittingcomputeHunks: identical, add, delete, replaceAll 170 tests pass (148 pre-existing + 22 new).
Prerequisites (user-side)
Usage
Test plan