sourceUrl in packageRules doesn't override datasource value from Docker OCI labels #41505
camjay
started this conversation in
Suggest an Idea
Replies: 1 comment
-
|
any update on this? I am also facing this issue when using the custommanager: regex option to pick up docker dependencies I want to override the sourceUrl using renovate.json, but it seems to still only use values picked up from docker registry metadata |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
How are you running Renovate?
Self-hosted
If you're self-hosting Renovate, tell us which platform and version.
GitHub Enterprise Server 3.15.7, Renovate 43.19.2. Fix branch is based on current
main(commit4fce8ec).Describe the problem
We mirror Docker images to an internal Harbor registry. The upstream images have
org.opencontainers.image.sourcelabels pointing to their GitHub repos, which Renovate reads assourceUrl. We want our Renovate PRs to link to Harbor instead, so we setsourceUrlin packageRules:{ "packageRules": [ { "matchDatasources": ["docker"], "matchPackagePatterns": ["^harbor\\.example\\.com/"], "sourceUrl": "https://harbor.example.com/project/repo" } ] }The override gets picked up — you can see it applied in debug logs during the
source-urlstage ofapplyPackageRules. But the PRs still link to the upstream GitHub repo, not Harbor.Root cause
I traced this through
lib/workers/repository/process/lookup/index.ts. Here's what happens:assignKeyscopiessourceUrlfrom the datasource result (the OCI label value) intoresapplyPackageRulesruns at the'source-url'stage, and the user's packageRule override is applied toconfigconfig.sourceUrlis never written back tores.sourceUrl— so the datasource value sticksThe override works fine for datasources that don't provide their own
sourceUrl, since there's nothing to overwrite. It only fails when the datasource has a value (like Docker images with OCI labels) that takes precedence.Fix
I have a one-line fix with a test — PR incoming. The fix writes
config.sourceUrlback tores.sourceUrlafter thesource-urlstage when the values differ.Related
Beta Was this translation helpful? Give feedback.
All reactions