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(go): Mimic Go logic for GOPRIVATE parsing #13166

Merged
merged 1 commit into from Dec 17, 2021

Conversation

56KBs
Copy link
Contributor

@56KBs 56KBs commented Dec 17, 2021

Changes:

Ensure that the parsing of GOPRIVATE/GONOPROXY matches the behaviour of Go itself.

The documentation for these values state it matches the logic of path.Match, however in reality it's actually a prefix based match.

Updating the regex to allow for either an exact match, or a match where the configured value is a prefix of the package, when a / is added.

Additionally, strip any trailing /'s from the configured value, as this matches the logic that Go takes when matching.

Context:

Closes #13138

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/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

Ensure that the parsing of `GOPRIVATE`/`GONOPROXY` matches the behaviour of Go itself.

The documentation for these values state it matches the logic of `path.Match`, however in reality it's actually a prefix based match.

Updating the regex to allow for either an exact match, or a match where the configured value is a prefix of the package, when a `/` is added.

Additionally, strip any trailing `/`'s from the configured value, as this matches the logic that Go takes when matching.

Fixes renovatebot#13138
Copy link
Collaborator

@zharinov zharinov left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

@rarkins rarkins changed the title fix: Mimic Go logic for GOPRIVATE parsing fix(go): Mimic Go logic for GOPRIVATE parsing Dec 17, 2021
@rarkins rarkins merged commit af817f9 into renovatebot:main Dec 17, 2021
@56KBs 56KBs deleted the fix/13138-goprivate-logic branch December 17, 2021 13:50
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 31.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

zanitete pushed a commit to nagra-insight/renovate that referenced this pull request Jan 4, 2022
Ensure that the parsing of `GOPRIVATE`/`GONOPROXY` matches the behaviour of Go itself.

The documentation for these values state it matches the logic of `path.Match`, however in reality it's actually a prefix based match.

Updating the regex to allow for either an exact match, or a match where the configured value is a prefix of the package, when a `/` is added.

Additionally, strip any trailing `/`'s from the configured value, as this matches the logic that Go takes when matching.

Fixes renovatebot#13138
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 17, 2022
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.

GOPRIVATE/GONOPROXY parsed incorrectly
5 participants