-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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(gitlab): Consistent urlencoding and call source specific hostType for gitlab (changelogs, packages, tags, releases) #13577
Closed
Closed
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@viceice are you sure you like this idea?
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.
I don't know a better solution yet. 🤷♂️
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.
I have looked for alternative solutions to solve the problem.
The problem is that it is currently impossible to apply hostRules to calls made by the changelog modules. This due to the fact that they use the platform identifier as hostType, which cannot have any rules applied to them since the automatically generated host rule for the platform is always applied last, overriding the authentication set by any previous rule.
Most datasources apply their datasource id to their Http client which adds it as hostType, making it possible to set hostRules for specific datasources. That is also what gitlab-tags and gitlab-releases datasources do. The hostRules also have a fallback mechanism for sources that use Gitlab or Github as source. This makes it possible for gitlab-tags and gitlab-releases to have specific rules configured for private repositories and otherwise fallback to the platform configuration. The changelog http clients,(which are called after datasource lookups) however always use the platform identifier as hostType, which as previously mentioned cannot be overridden.
I can think of only the 3 options to make hostRules configurable for changelogs so that they don't fail when datasources are configured with their own authentication which is not applied to subsequent changelog lookups.
Moving automatically generated platform rule to the beginning, making it possible to override automatically generated rule for call using the platform identifier. Making it possible to override the configured renovate platform token. However there is no ways to differentiate between preset, platform and changelog calls.
In the case of the Gitlab changelog retrieval, it does 3 types of calls, tag lookup, checking for existence of changelog md(tree lookup) and looking up releases.
Treat the changelog module just like a gitlab-releases or gitlab-tags datasource with its own identifier used as hostType, making it possible to differentiate from other platform calls and apply rules to them, and adding it to the fallback list. (The solution above, which I personally like best, but I am biased.)