Skip to content
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

Merged
merged 8 commits into from Feb 29, 2024

Conversation

jsperling-schwarz
Copy link
Contributor

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 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 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])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

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.
rarkins
rarkins previously approved these changes Feb 27, 2024
Copy link
Member

@viceice viceice left a 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.
@jsperling-schwarz
Copy link
Contributor Author

still missing code coverage

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.

lib/modules/datasource/go/base.ts Outdated Show resolved Hide resolved
Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise LGTM

lib/modules/datasource/go/base.spec.ts Show resolved Hide resolved
@viceice viceice added this pull request to the merge queue Feb 29, 2024
Merged via the queue into renovatebot:main with commit 88860db Feb 29, 2024
35 checks passed
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 37.220.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants