feat(azure): import and auto-deploy Azure DevOps repositories - #636
Open
reach2rv wants to merge 1 commit into
Open
feat(azure): import and auto-deploy Azure DevOps repositories#636reach2rv wants to merge 1 commit into
reach2rv wants to merge 1 commit into
Conversation
Self-hosted operators currently cannot deploy from Azure DevOps without forging a GitHub URL. Parse org/project/repo, store gitProject separately, and inject the PAT only at clone time so credentials never land in gitUrl.
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
Self-hosted Openship can import, clone, and auto-deploy Azure DevOps repositories as a first-class git source (
source: "azure"). Org/project/repo are parsed and stored separately; the PAT is injected only at clone time so it never lands ingitUrl.Motivation
Self-hosted operators cannot deploy from Azure DevOps today without forging a GitHub URL. Azure’s hierarchy is three-level (org / project / repo), Service Hook IDs are GUIDs, and clone auth is Basic
:{PAT}or an Entra bearer token — none of that fits the GitHub two-segment owner/repo model.This change adds Azure at GitHub parity for self-hosted / desktop only. Cloud SaaS hides the UI and Azure API routes return
NOT_SUPPORTED.Related issue
None. No Azure DevOps issue was found on
oblien/openship. This PR adds schema, endpoints, and new behavior; CONTRIBUTING asks for a maintainer-agreed issue before that class of change. Happy to open one and retarget if maintainers want that first.Changes
packages/core
"azure"toSOURCE_PROVIDERS.parseGitRepoUrl/buildGitUrlhandle:https://dev.azure.com/{org}/{project}/_git/{repo}https://{org}.visualstudio.com/{project}/_git/{repo}git@ssh.dev.azure.com:v3/{org}/{project}/{repo}(parse only; clone is HTTPS)gitOwner= org,gitProject= Azure project,gitRepo= repo.deployment-class.ResourceTypeincludes"azure"but it is not grantable.packages/db
project.git_project(Azure project name).project.webhook_external_id(Service Hook GUID; GitHub still uses integerwebhook_id).instance_settings.azure_pat_encrypted/azure_pat_set_at.0109_azure_devops.sql.azure_connectiontable — OAuth uses Better Authaccount(providerId = "microsoft").packages/adapters
https://:{token}@dev.azure.com/....apps/api
AZURE_CLIENT_ID,AZURE_CLIENT_SECRET, optionalAZURE_TENANT_ID(defaultorganizations).microsoftprovider with Azure DevOps scope499b84ac-1321-427f-aa17-267ca6975798/.default./api/azure(localOnly): status, Entra connect/disconnect, instance PAT, orgs/repos/branches, stack detect, Service Hooks./api/webhooks/azureauto-deploys matching projects.buildGitUrl; tokens never persist ingitUrl.apps/dashboard
gitProvider: "azure"andgitProjectthrough prepare/ensure.repoSlugv2 encodes{ owner, repo, provider, project }; Azure decode rejects a missing project.Azure is not mounted on
github.routes.tsand is not added toGrantableResourceType.How to use
Self-hosted / desktop only. On cloud SaaS,
/api/azure/*returns 400/NOT_SUPPORTEDand the Library tab is hidden.0109_azure_devops.AZURE_CLIENT_ID,AZURE_CLIENT_SECRET, optionalAZURE_TENANT_ID(defaultorganizations). Callback is Better Authmicrosoftplus dashboard/auth/callback/close.https://dev.azure.com/{org}/{project}/_git/{repo}./api/webhooks/azure. The API must be publicly reachable HTTPS.Clone credential is injected only at clone time (OAuth JWT as Bearer, PAT as Basic
:{pat}).Verification
Targeted unit tests (this branch, before push). Full
bun run test, workspacelint, andbun formatwere not completed locally —bunwas not on PATH in the PR shell, and an earlierbun installhitENOSPCon this machine.Manual / SaaS checks still needed (see checklist below).
Checklist
bun run test,bun run --cwd <workspace> lint, andbun formatall pass locally