fix(lookup): write back sourceUrl from packageRules after source-url stage#1
Draft
camjay wants to merge 1 commit into
Draft
fix(lookup): write back sourceUrl from packageRules after source-url stage#1camjay wants to merge 1 commit into
camjay wants to merge 1 commit into
Conversation
99973df to
43e4cad
Compare
…stage When packageRules set sourceUrl, the override was applied to config but never written back to the result object. This meant datasource- provided values (e.g. from Docker OCI image labels) always won, even when a user explicitly overrode sourceUrl in their packageRules. Adds write-back of config.sourceUrl to res.sourceUrl after the source-url stage of applyPackageRules, plus a test case.
43e4cad to
33039cc
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes an issue where
sourceUrlset viapackageRulesdoesn't override the value provided by a datasource (e.g. Docker OCI image labels).The problem: When
applyPackageRulesruns at the'source-url'stage inlookupUpdates, any user-configuredsourceUrloverride is applied toconfig— but it's never written back tores.sourceUrl. So the datasource value always wins.This doesn't matter for datasources that don't provide a
sourceUrl, since there's nothing inresto compete with. But for Docker images withorg.opencontainers.image.sourceOCI labels, the label value always takes precedence over the user's packageRule.The fix: After the
'source-url'call toapplyPackageRules, writeconfig.sourceUrlback tores.sourceUrlwhen the two differ. This lets the user's explicit override win.Testing:
Upstream: renovatebot#41506
Discussion: renovatebot#41505