Repository navigation
Replacement escapes its packageRule and is offered on sibling deps of the same packageName #45603
Replies: 2 comments 1 reply
|
Minimal reproduction repository: https://github.com/benlangfeld/renovate-repro-45603 The repo root is the reproduction —
It prints the per-dependency updates and the regex engine Renovate picked, so the JS-regex fallback can be ruled out from the output itself — a clean run reports The Happy to transfer it into Supersedes the gist I posted first (https://gist.github.com/benlangfeld/4255d50acabf053b969ffa2f1fdfaa88) — same reproduction, now in a repository you can run Renovate against directly. |
|
Hi there, |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
How are you running Renovate?
Self-hosted Renovate CLI
Which platform you running Renovate on?
Other (please specify)
Which version of Renovate are you using?
44.54.0 (first seen on 44.52.1, reproduced on both)
Please tell us more about your question or problem
Summary
A dependency that matches no
packageRulesentry containingreplacementNameis nevertheless offered that replacement. In the reproduction below,percona/percona-postgresql-operator:2.6.0— a bare operator tag — is offeredpercona/percona-distribution-postgresql:17.7-2, an entirely different image, alongside its legitimate version updates.This matters because that Docker repository hosts several different components distinguished only by tag suffix, so a mis-applied replacement swaps one component's image for another's rather than merely picking a wrong version.
Environment
Self-hosted CLI on Node 24.20.0.
re2is installed and loaded (the log shows noRE2 not usablewarning). The reproduction below runs against the local filesystem withRENOVATE_PLATFORM=local, so it is not platform-specific.Minimal reproduction
Reproduction repository: https://github.com/benlangfeld/renovate-repro-45603
The repo root is the reproduction, so Renovate can be pointed straight at it;
./reproduce.shruns it locally with no platform involved. The two files are reproduced inline below.values.yaml(picked up by thehelm-valuesmanager):renovate.json:{ "packageRules": [ { "matchDatasources":["docker"], "matchPackageNames":["percona/percona-postgresql-operator"], "matchCurrentVersion":"/^\\d+\\.\\d+\\.\\d+$/", "versioning":"semver" }, { "matchDatasources":["docker"], "matchPackageNames":["percona/percona-postgresql-operator"], "matchCurrentVersion":"/-postgres-gis/", "allowedVersions":"/^(nonexistent)$/" }, { "matchDatasources":["docker"], "matchPackageNames":["percona/percona-postgresql-operator"], "matchCurrentVersion":"/-postgres$/", "replacementName":"percona/percona-distribution-postgresql", "replacementVersion":"17.7-2" } ] }Run:
All three images are public, so this needs no credentials.
Observed
All three deps are offered the replacement to
percona/percona-distribution-postgresql:17.7-2, includingc(2.6.0), which gets it alongside its legitimate minor and major updates. See thepackageFiles with updatesexcerpt in the logs section below.Expected
Only dep
amatches the replacement rule'smatchCurrentVersion(/-postgres$/). Depsbandcshould get no replacement update.The regexes behave correctly in isolation — tested directly against the three tag strings,
/-postgres$/matches only2.7.0-ppg17.5.2-postgres— so the rule's own matching is not the problem.What the trigger seems to need
Removing any one of these three makes the output correct, so all three appear necessary:
versioning: "semver"on a rule that matches the victim dep (c). Dropping it from rule 1 makes the run clean. ItsallowedVersionsis not needed.allowedVersionsmatching a third dep (b). Removing that rule, or giving it a satisfiableallowedVersions, makes the run clean.a). With onlybandcpresent, the run is clean.Deps
bandcboth receive the replacement belonging toa, which is why this reads as a replacement escaping its rule and attaching to sibling deps of the samepackageName.Ruled out
re2installed and active.Possibly related
#20304 (closed, completed) is in the same area — a replacement affecting a dependency it should not have — but its symptom is the old image being rewritten with the new image's digest, whereas here an unrelated dep gains a whole replacement update. #12623 also touches docker replacements.
Notes
I hit this while adding
replacementNamerules to a shared preset for images Percona moved between repositories. The reproduction above is the reduced form of a larger real-world config, cut down from 28 rules and 8 dependencies to 3 and 3, and is published at https://github.com/benlangfeld/renovate-repro-45603. Happy to transfer it intorenovate-reproductionsif you would rather own it there.Logs (if relevant)
Logs
All reactions