Repository navigation
fix(forge): read Azure DevOps collection, legacy SSH, and default-repo remotes - #4764
Conversation
…o remotes
The Azure org/project accessors picked fixed positions in the remote path,
so three valid remote shapes gave a wrong project (and web URL):
DefaultCollection-prefixed visualstudio.com URLs, the legacy
{org}@vs-ssh.visualstudio.com:v3/... SSH host, and the short
dev.azure.com/{org}/_git/{repo} form for a project's default repo.
One azure_coordinates helper now resolves web host, org and project for
every shape, and the CI-status and PR paths use its web host.
Closes #4763
|
@worktrunk-bot The new
|
…abel
The vs-ssh.visualstudio.com path puts the organization into the
{org}.visualstudio.com web host, so a URL delimiter in that segment
(e.g. v3/attacker.example#/proj/repo) redirected the host.
|
Fixed in 21455da. In the The regression cases cover a remote with |
GitRemoteUrl::azure_organization/azure_projectread the org and project from fixed positions in the remote path. Three valid Azure DevOps remote forms broke that, sowt list --format jsonreported a wrongrepo.forge.projectandurl, and theazCI lookup got the same wrong project (or, for the legacy SSH host, the orgvs-ssh):https://myorg.visualstudio.com/DefaultCollection/My%20Project/_git/my-repoDefaultCollectionMy%20Project[email protected]:v3/myorg/My%20Project/my-repovs-ssh.visualstudio.com, ownervs-ssh, projectv3myorg.visualstudio.com, ownermyorg, projectMy%20Projecthttps://dev.azure.com/myorg/_git/my-repo_git, url…/myorg/_git/_git/my-repomy-repo, url…/myorg/my-repo/_git/my-repoA new private
azure_coordinatesresolves(web host, org, project)for every shape. It strips a leadingDefaultCollectionon*.visualstudio.com, readsv3/{org}/{project}on both SSH hosts, and falls back to the repo name when the project segment is omitted (the project's default repo shares its name). The two accessors,web_url,repo_info, the PR-checkout org detection, and the CI-status context all go through it. The CI-status path and the PR path now take the host from the newazure_web_hostrather than the raw remote host, so the legacy SSH host maps to{org}.visualstudio.com.repo_info_from_remote_azure_devops_collection_legacy_ssh_and_default_repocovers the reporter's three remotes plus thevisualstudio.comshort forms. Before the change, the issue's repro gave the wrong values in the table; after it, a local build gives the expected ones. Existing Azure unit and integration tests pass.projectandnamestill keep the URL's percent-encoding (My%20Project), as the issue notes. This PR leaves that unchanged.Closes #4763 — automated triage