Skip to content

fix(azure): pass --project and --repository so PR creation works with SSH remotes - #173

Merged
narnaud merged 1 commit into
narnaud:mainfrom
dfaure-kdab:wip/dfaure/azure-ssh-project
Jul 8, 2026
Merged

fix(azure): pass --project and --repository so PR creation works with SSH remotes#173
narnaud merged 1 commit into
narnaud:mainfrom
dfaure-kdab:wip/dfaure/azure-ssh-project

Conversation

@dfaure-kdab

Copy link
Copy Markdown
Collaborator

az repos pr create only auto-detects the team project from the git remote when it is passed the HTTPS remote form. Once git-loom passes --org explicitly (which it does to avoid a misleading login error), az stops auto-detecting the project, so it must be supplied via --project. With an SSH remote (git@ssh.dev.azure.com:v3/...) az can never detect the project, so PR creation failed with:

ERROR: --project must be specified.

Extract the project from the remote URL alongside the org (renaming extract_azure_org_url to extract_azure_remote) and pass --project to both az repos pr create and az repos pr list. Legacy visualstudio.com collection URLs are ambiguous about the project segment, so leave those to az auto-detection.

@dfaure-kdab
dfaure-kdab requested a review from narnaud as a code owner July 3, 2026 16:53
… SSH remotes

`az repos pr create` only auto-detects the team project and repository
from the git remote when it is passed the HTTPS remote form. Once
git-loom passes `--org` explicitly (which it does to avoid a misleading
login error), az stops auto-detecting both, so they must be supplied via
`--project` and `--repository`. With an SSH remote
(`git@ssh.dev.azure.com:v3/...`) az can never detect them, so PR
creation failed with:

    ERROR: --project must be specified.
    ERROR: A valid repository name is required.

Extract the project and repository from the remote URL alongside the org
(renaming `extract_azure_org_url` to `extract_azure_remote`) and pass
`--project`/`--repository` to both `az repos pr create` and
`az repos pr list`. The repository is the segment after `_git` (HTTPS)
or the third path segment (SSH). Legacy `visualstudio.com` collection
URLs are ambiguous about the project segment, so leave that to az
auto-detection.
@dfaure-kdab
dfaure-kdab force-pushed the wip/dfaure/azure-ssh-project branch from b00ae30 to 6854337 Compare July 6, 2026 12:21
@dfaure-kdab dfaure-kdab changed the title fix(azure): pass --project so PR creation works with SSH remotes fix(azure): pass --project and --repository so PR creation works with SSH remotes Jul 7, 2026
@narnaud
narnaud merged commit 3d9981e into narnaud:main Jul 8, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants