feat(providers): add Azure DevOps support for PR operations#30
Merged
Conversation
Detects dev.azure.com / visualstudio.com remotes automatically and routes PR status, merge, title updates, and Create-PR flows through the az CLI (azure-devops extension). GitHub path is unchanged — a thin dispatcher in src/main/lib/git/providers forwards by provider, and the PR widget, status bar, and rename dialog consume the existing provider-agnostic shape. Silent detection of az / extension / login; queries degrade to null on any failure so the 30s poll never throws, mutations throw toast-ready messages (missing CLI, missing extension, not logged in). Conflict errors surface via the existing MERGE_CONFLICT: contract so no renderer changes are needed. Also adds a new git_project column (Drizzle migration 0010) to store the Azure project slug without colliding with gitOwner, extends getPrContext to return provider info for the agent prompt, and teaches pr-message.ts and git-activity.ts to emit and parse az repos pr create. v1 scope: cloud only; PR comments stubbed to [] for Azure; additions/ deletions report 0; rebase merge falls back to non-squash. On-prem Azure DevOps Server is out of scope. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
dev.azure.com,*.visualstudio.com, HTTPS + SSH variants) from the git origin URL and route PR status, merge, rename, and Create-PR through theazCLI (azure-devopsextension). GitHub path stays byte-identical — a thin dispatcher insrc/main/lib/git/providers/forwards by provider and the PR widget / status bar / rename dialog keep consuming the existing shape.azCLI +azure-devopsextension +az account. Queries degrade tonull/[]on any failure so the 30s poll never throws; mutations throw toast-ready messages (missing CLI, missing extension, not logged in). Merge conflicts surface via the existingMERGE_CONFLICT:contract — no renderer changes needed.git_projectcolumn (Drizzle migration0010) so the Azure project slug doesn't collide withgit_owner(still used to buildgithub.com/{owner}.pngavatars). ExtendsgetPrContextto return provider info;pr-message.tsandgit-activity.tsnow emit and parseaz repos pr create.v1 scope (confirmed before implementation)
[](threads are a different data model — deferred).0for Azure PRs (widget handles zero;git diff --numstatplanned for v2).method: "rebase"falls back to non-squash merge on Azure with a console warn (azCLI only exposes--squash <bool>).Test plan
GitHub regression (must be byte-identical)
github.com/…/compare/…?expand=1.gh pr create, activity badge appears.MERGE_CONFLICTtoast with "Sync with Main".ghtemporarily → widget shows empty state, no toast, no crash.Azure DevOps happy path
gitProvider="azure",gitOwner=<org>,gitProject=<project>,gitRepo=<repo>.dev.azure.com/…/pullrequestcreate?sourceRef=…&targetRef=….pr-message.tsemitsaz repos pr createwith correct org/project/repo and--output json.org/project/repowith an "Azure DevOps" external-link button.Azure failure modes (each must toast OR silently show empty state — never crash)
aznot on PATH → query silent; merge shows "Azure CLI not found" toast.azure-devopsextension missing → merge shows "Azure DevOps extension missing. Run: az extension add --name azure-devops".az logout→ merge shows "Not logged in to Azure. Run az login and retry".az repos pr show→ query returns null, no toast, console warn only.URL parsing sanity check
https://dev.azure.com/myorg/MyProject/_git/myrepo.git→{ provider: "azure", owner: "myorg", project: "MyProject", repo: "myrepo" }https://myorg@dev.azure.com/myorg/MyProject/_git/myrepo→ samegit@ssh.dev.azure.com:v3/myorg/MyProject/myrepo→ samehttps://myorg.visualstudio.com/DefaultCollection/MyProject/_git/myrepo→ samehttps://github.com/owner/repostill returns{ provider: "github", project: null }Build / typecheck
bun run buildsucceeds (30.95s).tsc --noEmitclean on all modified/new files (6 pre-existing errors insrc/renderer/components/update-banner.tsxare unrelated).Deferred to v2
az repos pr thread listwith thread-model mapping).🤖 Generated with Claude Code