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(gomod): use git host rules as authentication for gosum updates #12230
Conversation
@rarkins I still have to update the docs and do some further testing with some of my own repositories, but if you have time I would like to ask you if you can please take already a look at the implementation and see if that is what you imagined. Many thanks in advance. |
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.
Some questions:
- Is there any harm in adding all hosts, even if they have nothing to do with Go (e.g. could be a Rubygems registry)?
- Do we need to be "platform aware" (e.g. github, gitlab, etc) or if we do all hosts then will we have enough rules in place anyway?
Might cause problems when accessing go modules under
At the end of the day |
We could perhaps do an intelligent de-duplication to avoid that problem? |
I just tested it again and I had an error in my previous testing (the
I think this should be generally fine. The only other option I see would be to narrow it down to the 6 Git Platforms that are supported plus rules without hostType. |
i think we should only use specific known host types plus new |
So known git platforms only? |
I would suggest, in this order
And adding it only if it is a different
Should result it token being |
This could be useful for more managers than just gomod, too |
Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: Rhys Arkins <rhys@arkins.net>
🎉 This PR is included in version 28.19.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Changes:
This PR adds all known GitHub, GitLab (and tbd) credentials it can find in the host rules as Git Environment variables for the gosum update as outlined in #7361 (comment)
As of today it looks for all hostRules matching GitHub and GitLab. A custom
hostType=go
is not yet supported (but would be only 3 more lines). It currently useshostRule.matchHost
to construct the GitUrl it should use the credentials for. This allows it to use paths as well.Open Topics/Questions:
hostType=go
for it? // not for nowgit
I can use? // yes all platform + without hostTypehostRule.matchHost
(supports paths) orhostRule.resolvedHost
and construct the http(s) url from there? //hostRule.matchHost
To be done:
Context:
fixes #7361
follow up to #11077
Documentation (please check one with an [x])
How I've tested my work (please tick one)
I have verified these changes via: