feat(ui): add Azure DevOps support to getGitCommitURL#6327
Conversation
✅ Deploy Preview for docs-kargo-io ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Automated Policy NoticeThis pull request has been converted to a draft because it does not reference an unblocked issue. Maintainers do not routinely review drafts. All contributions to Kargo require a linked, unblocked issue. This ensures that proposed changes have been reviewed by maintainers before effort is invested. To move forward:
See the Contributor Guide for full details. |
Azure DevOps repository URLs have the form: https://dev.azure.com/{org}/{project}/_git/{repo} The existing `getGitCommitURL` switch handled github.com, gitlab.com, and bitbucket.org but fell through to returning the raw source URL for ADO, meaning the commit-hash link was never a clickable `/commit/<sha>` deeplink. The `gitUrlParse` `baseUrl` approach doesn't compose correctly for ADO's four-segment path (`/org/project/_git/repo`), so we append `/commit/${revision}` directly to the original `url` instead. Adds a test case mirroring the existing GitHub/GitLab/Bitbucket patterns. Signed-off-by: Johnzell Wilson <johnzellwilson@shiftkey.com>
9d37265 to
fd2d399
Compare
Automated Policy NoticeThis pull request has been converted to a draft because it does not reference an unblocked issue. Maintainers do not routinely review drafts. All contributions to Kargo require a linked, unblocked issue. This ensures that proposed changes have been reviewed by maintainers before effort is invested. To move forward:
See the Contributor Guide for full details. |
Automated Policy NoticeThis pull request has been converted to a draft because it does not reference an unblocked issue. Maintainers do not routinely review drafts. All contributions to Kargo require a linked, unblocked issue. This ensures that proposed changes have been reviewed by maintainers before effort is invested. To move forward:
See the Contributor Guide for full details. |
Summary
The
getGitCommitURLutility inopen-container-initiative-utils.tsbuilds deeplink URLs fromorg.opencontainers.image.source+org.opencontainers.image.revisionannotations. It currently handles GitHub, GitLab, and Bitbucket but falls through to returning the raw source URL for Azure DevOps, meaning the commit hash on a Freight card never becomes a clickable/commit/<sha>link.Changes
open-container-initiative-utils.ts: adds anelse if (resource.includes('dev.azure.com'))branch that returns\${url}/commit/${revision}`directly against the original source URL (rather than the reconstructedbaseUrl) because ADO's four-segment path form —https://dev.azure.com/{org}/{project}/_git/{repo}` — doesn't compose cleanly fromgitUrlParse'sowner+namefields.open-container-initiative-utils.test.ts: adds one test case mirroring the existing GitHub/GitLab/Bitbucket patterns.Test
ADO URL anatomy