fix(server): support Azure DevOps pull request responses - #8364
fix(server): support Azure DevOps pull request responses#8364Kieren-Foenander wants to merge 3 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
There was a problem hiding this comment.
Effect service conventions review: one change-discipline finding — documentation that recorded why the threads route is derived from Azure's response was dropped while threadsUrl was refactored into the threads route. Service definitions, layers, namespace imports, error modelling, and the added tests otherwise follow the conventions.
Posted via Macroscope — Effect Service Conventions
01913b5 to
8b1ecde
Compare
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This production change spans Azure response parsing, authenticated thread retrieval, fork repository selection, and Git worktree materialization. The checkout and remote-selection behavior is materially altered across several components, so human validation is appropriate. You can add or adjust custom eligibility rules. Learn more. |
8b1ecde to
2f9e77c
Compare
|
Addressed the approvability concern in |
- Read pull request threads through the Azure DevOps CLI - Handle nullable Azure fields and same-repository PR refs
2f9e77c to
f40dbd3
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f40dbd3. Configure here.



What Changed
az devops invoke, reusing the Azure CLI extension authentication.Related issue
Fixes #8078
Why
Azure DevOps responses can contain nullable fields, and same-repository pull requests do not expose the synthetic head refs used by other providers. Those differences caused pull request loading, activity reads, or checkout to fail. This keeps the provider-specific behavior at the Azure DevOps boundary while preserving the existing orchestration flow.
Verification
vp test run apps/server/src/git/GitManager.test.ts apps/server/src/pullRequest/AzureDevOpsPullRequestCli.test.ts apps/server/src/pullRequest/azureDevOpsPullRequestJson.test.ts apps/server/src/sourceControl/AzureDevOpsCli.test.ts apps/server/src/sourceControl/AzureDevOpsSourceControlProvider.test.ts(162 tests passed)vp run --filter t3 typecheckChecklist
Created with GPT-5.6 Codex in the T3 Code harness.
Note
Medium Risk
Changes PR head materialization and Azure API/thread contracts (
threadsreplacesthreadsUrl); incorrect fork or fallback logic could check out the wrong branch or fail PR threads.Overview
Hardens Azure DevOps pull request handling so listing, activity, and worktree checkout work when the API returns nulls, fork PRs, or no synthetic pull-request head ref.
Azure pull request JSON decoding now accepts nullable fields and derives cross-repo metadata from
forkSource(isCrossRepository,project/repohead identity). That metadata flows through the source-control provider instead of being hardcoded. PR conversation threads move from a RESTthreadsUrlto a structuredAzureDevOpsThreadsRoute, andlistThreadsusesaz devops invoke(shared extension auth) instead ofaz rest.getRepositoryCloneUrlsacceptsproject/repoand passes--projecttoaz repos show.In
GitManager, same-repository PRs with no resolved head repository still tryfetchPullRequestBranch, but on failure they fall back to fetching the named remote head branch (Azure same-repo behavior). PRs with unknown head repository identity no longer take that fallback and surfaceGitPullRequestMaterializationErrorinstead of checking out an ambiguous same-named branch onorigin.Tests cover decoding, CLI args, fork/incomplete fork cases, worktree prep without pull refs, and the ambiguous-head guard.
Reviewed by Cursor Bugbot for commit 782c693. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix Azure DevOps PR support for forks, null fields, and thread fetching
AzureDevOpsPullRequestSchemain azureDevOpsPullRequests.ts to accept nulls for optional fields and parsesforkSourceto compute cross-repository metadata;toChangeRequestin AzureDevOpsSourceControlProvider.ts now propagatesisCrossRepositoryand fork head repo identity instead of hardcoding falsethreadsUrl: string | nullwith a structuredAzureDevOpsThreadsRouteacross azureDevOpsPullRequestJson.ts, AzureDevOpsPullRequestCli.ts, and AzureDevOpsPullRequestProvider.ts;listThreadsnow callsaz devops invokeinstead ofaz restgetRepositoryCloneUrlsin AzureDevOpsCli.ts to acceptproject/repospecifiers and pass--projecttoaz repos showmaterializePullRequestHeadBranchBasein GitManager.ts: for same-repo PRs whose provider does not publish a head ref, fetches the remote head branch by name on failureAzureDevOpsPullRequest.threadsUrlfield is removed and replaced bythreads; any out-of-tree code readingthreadsUrlwill break.normalizeAzureDevOpsPullRequestRecordnow returns null cross-repo fields instead of false/empty when fork data is incompleteMacroscope summarized 782c693.