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

feat(go): support self hosted go modules in gitlab #8876

Conversation

davidgwcurve
Copy link
Contributor

@davidgwcurve davidgwcurve commented Feb 25, 2021

Changes:

Fixes issue #8859, #8859.

- Query hostRules for hostType=gitlab, url=https://[go module]
- If the answer back from hostRules contains a token field, then we know it's a GitLab host and can redirect the lookup to a gitlab tags one

Also fixes the same logic in the changelog functionality, as after this issue was resolved I got 404's.

Context:

Closes #8859

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 tick one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added unit tests, or (TODO)
  • No new tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

@HonkingGoose
Copy link
Collaborator

@davidgwcurve Your latest commit includes changes to package.json and yarn.lock files, was that intended?

Copy link
Collaborator

@rarkins rarkins left a comment

Choose a reason for hiding this comment

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

Revert package json changes

@davidgwcurve davidgwcurve force-pushed the feat/8859-support-self-hosted-go-modules-gitlab branch from af37999 to 457d127 Compare February 26, 2021 16:52
@HonkingGoose HonkingGoose requested a review from rarkins February 26, 2021 17:53
@@ -216,19 +254,19 @@ describe('datasource/go', () => {
httpMock
.scope('https://some.unknown.website/')
.get('/example/module?go-get=1')
.reply(404);
.reply(200);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

there is a test that checks for a 404 returned from the specified URL already, this test should actually be checking that the call was successful but the code doesn't know how to handle the dependency (i.e. not github/gitlab.com/not a gitlab hostRules)

@davidgwcurve davidgwcurve marked this pull request as ready for review March 1, 2021 16:25
@davidgwcurve
Copy link
Contributor Author

@rarkins I've added unit tests now and ran on our own repository, it works as expected.

@rarkins rarkins merged commit e3ccc26 into renovatebot:master Mar 1, 2021
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 24.70.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 1, 2021
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.

Support self-hosted Go Modules in GitLab
4 participants