fix: Configurability host rules for datasources and changelogs #13654
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.
Changes:
Context:
Applying hostRules for specific datsources is usually done by adding hostType to be matched to the rule, containing the datasource id. However this is not possible for all datasources, since a few don't add their id as hostType, but instead use the default hostType added by the platform specific Http client, which usually matches the platformId. Which doesn't make it possible to differentiate between datasource and platform calls. They also cannot be overriden when running on that platform as noticed in ##13497
This is the case for the following datasources:
The changelog modules which run after datasource lookups also don't add a hostType make it impossible to differentiate them between platform calls and lookups for changelogs. So one can configure token for gitlab-tags, but fail on changelog lookup.(See #13497)
This PR resolves this by treating the changelogs modules like any other (platform) datasource module(gitlab-tags, github-tags), which add a specific hostType to make it possible to add specific hostRules, while still having a fallback to the platform rules in case no specific rules are present.
The added hostTypes are
Closes #13497
Replaces #13577
Documentation (please check one with an [x])
How I've tested my work (please tick one)
I have verified these changes via: