You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(azure-devops): project-less pull request URLs can be pasted to check out - #40436
Azure DevOps addresses a project's default repository without the project name, so its pull request links look like https://dev.azure.com/acme/_git/web/pullrequest/12 (or https://acme.visualstudio.com/_git/web/pullrequest/12 on a legacy host). Pasting one into the "Checkout pull request" dialog or the branch selector is refused with "Use a pull request URL, checkout command, 123, or #123." The same link with the project spelled out works.
The Azure DevOps definition's CHANGE_REQUEST_REFERENCE pattern requires a project segment before /_git/. parsePullRequestReference relies on it through isChangeRequestReference, so it returns null and the server is never asked.
Change
The project segment is now optional in CHANGE_REQUEST_REFERENCE, for dev.azure.com and for visualstudio.com hosts. A URL with no organization is still refused, as are http: and other hosts.
This brings the check in line with the rest of the definition: parseChangeRequestUrl already reads both URLs as pull request #12, and #38263 already treats https://dev.azure.com/{org}/_git/{repo} as a remote shape. On the server, the Azure CLI wrapper reads the id from pullrequest/<n>, so nothing else has to change.
Scope
A one-line fix for an obvious bug, so there is no separate issue. It is the same kind of fix as #29763, which made this pattern accept DefaultCollection URLs. I searched open PRs and issues for Azure pull request URLs, isChangeRequestReference and CHANGE_REQUEST_REFERENCE; none covers this. #33642 edits the same file but a different function.
Verification
I found this by comparing isChangeRequestReference with parseChangeRequestUrl in the same file, then checked that Azure really uses the short form.
Azure DevOps uses this URL shape. On the public numpy organization, https://dev.azure.com/numpy/_git/numpy/pullrequests loads without sign-in, and the page data of https://dev.azure.com/numpy/numpy/_git/numpy/pullrequests names the default repository as "defaultGitRepoUrl":"/numpy/_git/numpy". A repository that does not exist (/numpy/_git/doesnotexist) redirects to sign-in instead.
Old and new pattern on 48 edge inputs: 12 differ, all from refused to accepted, all project-less forms. Still refused: http:, other hosts, dev.azure.com.evil.example, userinfo, ssh.dev.azure.com, extra path segments and whitespace. Full-project and DefaultCollection URLs are unchanged.
Test: the new case fails on main (https://dev.azure.com/acme/_git/web/pullrequest/17: expected false to be true) and passes here. definition.test.ts passes 23/23 and packages/client-runtime/src/pullRequestLinkInput.test.ts still passes.
vp run check:changed passes: format, lint, knip, typecheck of 11 packages, and tests.
Not checked: a checkout against a live Azure DevOps organization (I have none), and the dialog in a running client. Past the dialog, the path was read, not run: normalizeChangeRequestId in AzureDevOpsCli.ts takes the id from pullrequest/(\d+) for every new shape.
Written by Claude Fable 5.2 in Claude Code, run from T3 Code.
…eck out
Azure DevOps addresses a project's default repository without the
project: https://dev.azure.com/{org}/_git/{repo}/pullrequest/{id}, or
https://{org}.visualstudio.com/_git/{repo}/pullrequest/{id} on a legacy
host. parseChangeRequestUrl already reads both, but the pattern behind
isChangeRequestReference required a project segment, so the checkout
dialog rejected these URLs as "Use a pull request URL, checkout command,
123, or pingdotgg#123" without asking the server.
The project segment is now optional in that pattern. A URL with no
organization is still refused.
Claude Fable 5.2 in Claude Code, running in T3 Code.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Reviewing files that changed from the base of the PR and between a3bd199 and 90a2a35.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The Azure DevOps change-request reference pattern now accepts specified pull request URLs without a project segment. Tests cover accepted and rejected URL forms.
Changes: Azure DevOps URL matching
Layer / File(s)
Summary
URL pattern and tests packages/source-control-azure-devops/src/shared/definition.ts, packages/source-control-azure-devops/src/shared/definition.test.ts
The pattern accepts project-less pull request URLs on dev.azure.com and .visualstudio.com hosts. Tests check accepted URLs with an organization segment and a rejected dev.azure.com URL without one.
Project-less Azure DevOps pull request URLs are now accepted by the checkout dialog and branch selector. The change is small, covered by tests, and no concrete risk remains.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the change: project-less Azure DevOps pull request URLs are now accepted for checkout. It uses the conventional commit form and matches the diff, which makes the project segment option…
Description check
The description follows the template. It has Problem, Change, Scope, and Verification sections, and each is filled in. The Problem section gives the expected behavior and reproduction URLs. The Change…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the change: project-less Azure DevOps pull request URLs are now accepted for checkout. It uses the conventional commit form and matches the diff, which makes the project segment optional in CHANGE_REQUEST_REFERENCE for dev.azure.com and visualstudio.com hosts.
Full details: Description check
Explanation
The description follows the template. It has Problem, Change, Scope, and Verification sections, and each is filled in. The Problem section gives the expected behavior and reproduction URLs. The Change section explains the regex change and why it matches the rest of the definition. The Scope section explains why no issue is linked and searches for duplicates. The Verification section lists before-and-after results, the new failing-then-passing test, and the checks not performed. It also names the model and harness, as the template asks.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Paste both project-less Azure URL formats into the branch picker, then into the checkout dialog after resolving the project-scoped spelling. Real Azure PR; fresh databases; Chromium, 1440×1000, light theme.
Actual Local or Worktree checkout was not executed; this proof covers the reported URL acceptance and real server resolution failure, through enabled checkout actions.
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
size:XS0-9 changed lines (additions + deletions).vouch:unvouchedAuthor is not yet trusted in the VOUCHED list.
2 participants
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.
Problem
Azure DevOps addresses a project's default repository without the project name, so its pull request links look like
https://dev.azure.com/acme/_git/web/pullrequest/12(orhttps://acme.visualstudio.com/_git/web/pullrequest/12on a legacy host). Pasting one into the "Checkout pull request" dialog or the branch selector is refused with "Use a pull request URL, checkout command, 123, or #123." The same link with the project spelled out works.The Azure DevOps definition's
CHANGE_REQUEST_REFERENCEpattern requires a project segment before/_git/.parsePullRequestReferencerelies on it throughisChangeRequestReference, so it returnsnulland the server is never asked.Change
The project segment is now optional in
CHANGE_REQUEST_REFERENCE, fordev.azure.comand forvisualstudio.comhosts. A URL with no organization is still refused, as arehttp:and other hosts.This brings the check in line with the rest of the definition:
parseChangeRequestUrlalready reads both URLs as pull request #12, and #38263 already treatshttps://dev.azure.com/{org}/_git/{repo}as a remote shape. On the server, the Azure CLI wrapper reads the id frompullrequest/<n>, so nothing else has to change.Scope
A one-line fix for an obvious bug, so there is no separate issue. It is the same kind of fix as #29763, which made this pattern accept
DefaultCollectionURLs. I searched open PRs and issues for Azure pull request URLs,isChangeRequestReferenceandCHANGE_REQUEST_REFERENCE; none covers this. #33642 edits the same file but a different function.Verification
I found this by comparing
isChangeRequestReferencewithparseChangeRequestUrlin the same file, then checked that Azure really uses the short form.numpyorganization,https://dev.azure.com/numpy/_git/numpy/pullrequestsloads without sign-in, and the page data ofhttps://dev.azure.com/numpy/numpy/_git/numpy/pullrequestsnames the default repository as"defaultGitRepoUrl":"/numpy/_git/numpy". A repository that does not exist (/numpy/_git/doesnotexist) redirects to sign-in instead.http:, other hosts,dev.azure.com.evil.example, userinfo,ssh.dev.azure.com, extra path segments and whitespace. Full-project andDefaultCollectionURLs are unchanged.main(https://dev.azure.com/acme/_git/web/pullrequest/17: expected false to be true) and passes here.definition.test.tspasses 23/23 andpackages/client-runtime/src/pullRequestLinkInput.test.tsstill passes.vp run check:changedpasses: format, lint, knip, typecheck of 11 packages, and tests.normalizeChangeRequestIdinAzureDevOpsCli.tstakes the id frompullrequest/(\d+)for every new shape.Written by Claude Fable 5.2 in Claude Code, run from T3 Code.
🤖 Generated with Claude Code