New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(datasource/go): private repositories on azure #26984
fix(datasource/go): private repositories on azure #26984
Conversation
This will fix a bug that occurs with private go packages with a major version greater than 1 on Azure DevOps. The problem is that Azure DevOps has support for go-get metadata but it will only work for modules that are included without a version suffix attached, like dev.azure.com/<org>/<project>/_git/<repo>.git/v2 Once such a suffix is part of the URL the http request to fetch the metadata info will result in 404 Not Found error. This change will now fetch the releases for the module as git tags from the repository. The Azure DevOps documentation https://learn.microsoft.com/en-us/azure/devops/repos/git/go-get describes two ways to name go packages: dev.azure.com/<org>/<project>/_git/<repo>.git and dev.azure.com/<org>/<project>/<repo>.git Both possible names are changed to https://dev.azure.com/<org>/<project>/_git/<repo> to have a valid Azure DevOps https git URL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still missing code coverage
with the recent changes there is no chanche to trigger the azure fall back detection.
the old fall back detection for azure modules is not reachable anymore. The fall back could be removed or ignored by the linter to fix it. I chose to ignore it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise LGTM
🎉 This PR is included in version 37.220.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This will fix a bug that occurs with private go packages with a major version greater than 1 on Azure DevOps.
Changes
This change will fetch the releases for a go package on Azure DevOps as git tags from the repository.
It will support the two described ways to name a go package on Azure DevOps by changing the package name to a valid Azure DevOps https git URL.
Context
The problem is that Azure DevOps has support for go-get metadata but it will only work for modules that are included without a version suffix attached, like
dev.azure.com/<org>/<project>/_git/<repo>.git/v2
. Once such a suffix is part of the URL the http request to fetch the metadata info will result in404 Not Found
error.This change will now fetch the releases for the module as git tags from the repository.
The Azure DevOps documentation describes two ways to name go packages:
dev.azure.com/<org>/<project>/_git/<repo>.git
dev.azure.com/<org>/<project>/<repo>.git
Both possible names are changed to
https://dev.azure.com/<org>/<project>/_git/<repo>
.Closes #14347
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via: