renovatebot / renovate

Home of the Renovate CLI: Cross-platform Dependency Automation by Mend.io
https://mend.io/renovate
GNU Affero General Public License v3.0
17.41k stars 2.28k forks source link

Replacements cause ignoring prerelease/compatibility #14962

Closed astellingwerf closed 1 year ago

astellingwerf commented 2 years ago

How are you running Renovate?

Self-hosted

If you're self-hosting Renovate, tell us what version of Renovate you run.

32.12.0

Please select which platform you are using if self-hosting.

Happens against GitLab (14) and GitHub.

Was this something which used to work for you, and then stopped?

I never saw this working

Describe the bug

(This issue was updated after further investigation. The earlier text blamed multiple package rules, but it later turned out that a single package rule can also invoke the unexpected behavior.)

If a repository has two similar dependencies (different only by semver prerelease / docker compatibility), and one is subject to a replacement package rule, the other one gets updated to a different prerelease / incompatible compatibility.

Relevant debug logs

Logs ``` Status: Downloaded newer image for renovate/renovate:32.12.0-slim DEBUG: Using RE2 as regex engine DEBUG: Parsing configs DEBUG: Checking for config file in /github-action/renovate-config.js DEBUG: File config "config": { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "platform": "github", "username": "renovate@labelvier.nl", "gitAuthor": "Renovate Bot ", "baseDir": "/tmp/renovate", "extends": ["config:base", ":disableDependencyDashboard"], "repositories": ["astellingwerf/renovate-issue-14962"] } DEBUG: CLI config "config": {} DEBUG: Env config "config": {"hostRules": [], "binarySource": "docker", "token": "***********"} DEBUG: Combined config "config": { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "platform": "github", "username": "renovate@labelvier.nl", "gitAuthor": "Renovate Bot ", "baseDir": "/tmp/renovate", "extends": ["config:base", ":disableDependencyDashboard"], "repositories": ["astellingwerf/renovate-issue-14962"], "hostRules": [], "binarySource": "docker", "token": "***********" } DEBUG: Found valid git version: 2.35.1 DEBUG: Using default github endpoint: https://api.github.com/ DEBUG: Platform config "platformConfig": { "hostType": "github", "endpoint": "https://api.github.com/", "isGHApp": false, "isGhe": false }, "renovateUsername": "renovate@labelvier.nl" DEBUG: Using configured gitAuthor (Renovate Bot ) DEBUG: Adding token authentication for api.github.com to hostRules DEBUG: Using configured baseDir: /tmp/renovate DEBUG: Using cacheDir: /tmp/renovate/cache DEBUG: Initializing Renovate internal cache into /tmp/renovate/cache/renovate/renovate-cache-v1 DEBUG: Commits limit = null DEBUG: Setting global hostRules DEBUG: Adding token authentication for api.github.com to hostRules DEBUG: validatePresets() DEBUG: Reinitializing hostRules for repo DEBUG: Clearing hostRules DEBUG: Adding token authentication for api.github.com to hostRules DEBUG: No dangling containers to remove INFO: Repository started (repository=astellingwerf/renovate-issue-14962) "renovateVersion": "32.12.0" DEBUG: Using localDir: /tmp/renovate/repos/github/astellingwerf/renovate-issue-14962 (repository=astellingwerf/renovate-issue-14962) DEBUG: initRepo("astellingwerf/renovate-issue-14962") (repository=astellingwerf/renovate-issue-14962) DEBUG: Overriding default GitHub endpoint (repository=astellingwerf/renovate-issue-14962) "endpoint": "https://api.github.com/" DEBUG: astellingwerf/renovate-issue-14962 default branch = master (repository=astellingwerf/renovate-issue-14962) DEBUG: Using personal access token for git init (repository=astellingwerf/renovate-issue-14962) DEBUG: resetMemCache() (repository=astellingwerf/renovate-issue-14962) DEBUG: Resetting npmrc (repository=astellingwerf/renovate-issue-14962) DEBUG: detectSemanticCommits() (repository=astellingwerf/renovate-issue-14962) DEBUG: Initializing git repository into /tmp/renovate/repos/github/astellingwerf/renovate-issue-14962 (repository=astellingwerf/renovate-issue-14962) DEBUG: Performing blobless clone (repository=astellingwerf/renovate-issue-14962) DEBUG: git clone completed (repository=astellingwerf/renovate-issue-14962) "durationMs": 327 DEBUG: latest repository commit (repository=astellingwerf/renovate-issue-14962) "latestCommit": { "hash": "4960a508b5d561dfa90c12fb91edde9f6b90cce7", "date": "2022-04-06T23:50:08+02:00", "message": "Move renovate-config.js", "refs": "HEAD -> master, origin/master, origin/HEAD", "body": "", "author_name": "Anne Stellingwerf", "author_email": "astellin@opentext.com" } DEBUG: getCommitMessages (repository=astellingwerf/renovate-issue-14962) DEBUG: Semantic commits detection: unknown (repository=astellingwerf/renovate-issue-14962) DEBUG: No semantic commits detected (repository=astellingwerf/renovate-issue-14962) DEBUG: checkOnboarding() (repository=astellingwerf/renovate-issue-14962) DEBUG: isOnboarded() (repository=astellingwerf/renovate-issue-14962) DEBUG: findFile(renovate.json) (repository=astellingwerf/renovate-issue-14962) DEBUG: findFile(renovate.json5) (repository=astellingwerf/renovate-issue-14962) DEBUG: Config file exists (repository=astellingwerf/renovate-issue-14962) "fileName": "renovate.json5" DEBUG: Retrieving issueList (repository=astellingwerf/renovate-issue-14962) DEBUG: Retrieved 0 issues (repository=astellingwerf/renovate-issue-14962) DEBUG: Repo is onboarded (repository=astellingwerf/renovate-issue-14962) DEBUG: Found renovate.json5 config file (repository=astellingwerf/renovate-issue-14962) DEBUG: Repository config (repository=astellingwerf/renovate-issue-14962) "fileName": "renovate.json5", "config": { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "packageRules": [ { "matchDatasources": ["docker"], "matchPackageNames": ["astellingwerf/renovate-reproduction"], "replacementName": "astellingwerf/renovate-reproduction", "matchCurrentVersion": "/^1\\.0\\.0-flavour1$/", "replacementVersion": "1.0.0-flavour2" } ] } DEBUG: migrateAndValidate() (repository=astellingwerf/renovate-issue-14962) DEBUG: No config migration necessary (repository=astellingwerf/renovate-issue-14962) DEBUG: massaged config (repository=astellingwerf/renovate-issue-14962) "config": { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "packageRules": [ { "matchDatasources": ["docker"], "matchPackageNames": ["astellingwerf/renovate-reproduction"], "replacementName": "astellingwerf/renovate-reproduction", "matchCurrentVersion": "/^1\\.0\\.0-flavour1$/", "replacementVersion": "1.0.0-flavour2" } ], "extends": ["config:base", ":disableDependencyDashboard"] } DEBUG: migrated config (repository=astellingwerf/renovate-issue-14962) "config": { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "packageRules": [ { "matchDatasources": ["docker"], "matchPackageNames": ["astellingwerf/renovate-reproduction"], "replacementName": "astellingwerf/renovate-reproduction", "matchCurrentVersion": "/^1\\.0\\.0-flavour1$/", "replacementVersion": "1.0.0-flavour2" } ], "extends": ["config:base", ":disableDependencyDashboard"] } DEBUG: Setting hostRules from config (repository=astellingwerf/renovate-issue-14962) DEBUG: Found repo ignorePaths (repository=astellingwerf/renovate-issue-14962) "ignorePaths": [ "**/node_modules/**", "**/bower_components/**", "**/vendor/**", "**/examples/**", "**/__tests__/**", "**/test/**", "**/tests/**", "**/__fixtures__/**" ] DEBUG: No vulnerability alerts found (repository=astellingwerf/renovate-issue-14962) DEBUG: No vulnerability alerts found (repository=astellingwerf/renovate-issue-14962) DEBUG: No baseBranches (repository=astellingwerf/renovate-issue-14962) DEBUG: extract() (repository=astellingwerf/renovate-issue-14962) DEBUG: Setting current branch to master (repository=astellingwerf/renovate-issue-14962) DEBUG: latest commit (repository=astellingwerf/renovate-issue-14962) "branchName": "master", "latestCommitDate": "2022-04-06T23:50:08+02:00" DEBUG: Using file match: (^|/)tasks/[^/]+\.ya?ml$ for manager ansible (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)requirements\.ya?ml$ for manager ansible-galaxy (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)galaxy\.ya?ml$ for manager ansible-galaxy (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: azure.*pipelines?.*\.ya?ml$ for manager azure-pipelines (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)batect(-bundle)?\.yml$ for manager batect (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)batect$ for manager batect-wrapper (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)WORKSPACE(|\.bazel)$ for manager bazel (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: \.bzl$ for manager bazel (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)\.?bitbucket-pipelines\.ya?ml$ for manager bitbucket-pipelines (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: buildkite\.ya?ml for manager buildkite (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: \.buildkite/.+\.ya?ml$ for manager buildkite (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)Gemfile$ for manager bundler (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: \.cake$ for manager cake (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)Cargo.toml$ for manager cargo (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/).circleci/config.yml$ for manager circleci (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)cloudbuild.ya?ml for manager cloudbuild (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)Podfile$ for manager cocoapods (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)([\w-]*)composer.json$ for manager composer (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)conanfile\.(txt|py)$ for manager conan (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)deps\.edn$ for manager deps-edn (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)docker-compose[^/]*\.ya?ml$ for manager docker-compose (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/|\.)Dockerfile$ for manager dockerfile (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)Dockerfile\.[^/]*$ for manager dockerfile (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/).drone.yml$ for manager droneci (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)flux-system/gotk-components\.yaml$ for manager flux (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|\/)\.fvm\/fvm_config\.json$ for manager fvm (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/).gitmodules$ for manager git-submodules (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^workflow-templates|\.github\/workflows)\/[^/]+\.ya?ml$ for manager github-actions (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|\/)action\.ya?ml$ for manager github-actions (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: \.gitlab-ci\.yml$ for manager gitlabci (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: \.gitlab-ci\.yml$ for manager gitlabci-include (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)go.mod$ for manager gomod (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: \.gradle(\.kts)?$ for manager gradle (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|\/)gradle\.properties$ for manager gradle (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|\/)gradle\/.+\.toml$ for manager gradle (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: \.versions\.toml$ for manager gradle (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)gradle/wrapper/gradle-wrapper.properties$ for manager gradle-wrapper (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)requirements\.yaml$ for manager helm-requirements (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)values.yaml$ for manager helm-values (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)helmfile.yaml$ for manager helmfile (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)Chart.yaml$ for manager helmv3 (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: ^Formula/[^/]+[.]rb$ for manager homebrew (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: \.html?$ for manager html (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)plugins\.(txt|ya?ml)$ for manager jenkins (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)jsonnetfile.json$ for manager jsonnet-bundler (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)kustomization\.ya?ml$ for manager kustomize (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)project\.clj$ for manager leiningen (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/|\.)pom\.xml$ for manager maven (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: ^(((\.mvn)|(\.m2))/)?settings\.xml$ for manager maven (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)package.js$ for manager meteor (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)mix\.exs$ for manager mix (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/).node-version$ for manager nodenv (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)package.json$ for manager npm (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: \.(?:cs|fs|vb)proj$ for manager nuget (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: \.(?:props|targets)$ for manager nuget (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|\/)dotnet-tools\.json$ for manager nuget (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|\/)global\.json$ for manager nuget (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)\.nvmrc$ for manager nvm (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)([\w-]*)requirements\.(txt|pip)$ for manager pip_requirements (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)setup.py$ for manager pip_setup (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)Pipfile$ for manager pipenv (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)pyproject\.toml$ for manager poetry (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)\.pre-commit-config\.yaml$ for manager pre-commit (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)pubspec\.ya?ml$ for manager pub (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/).python-version$ for manager pyenv (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)\.ruby-version$ for manager ruby-version (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: \.sbt$ for manager sbt (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: project/[^/]*.scala$ for manager sbt (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)setup\.cfg$ for manager setup-cfg (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)Package\.swift for manager swift (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: \.tf$ for manager terraform (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)\.terraform-version$ for manager terraform-version (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)terragrunt\.hcl$ for manager terragrunt (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: (^|/)\.terragrunt-version$ for manager terragrunt-version (repository=astellingwerf/renovate-issue-14962) DEBUG: Using file match: ^.travis.yml$ for manager travis (repository=astellingwerf/renovate-issue-14962) DEBUG: Matched 1 file(s) for manager dockerfile: Dockerfile (repository=astellingwerf/renovate-issue-14962) DEBUG: Matched 1 file(s) for manager github-actions: .github/workflows/renovate.yml (repository=astellingwerf/renovate-issue-14962) DEBUG: Found a multistage build stage name (repository=astellingwerf/renovate-issue-14962) DEBUG: Found a multistage build stage name (repository=astellingwerf/renovate-issue-14962) DEBUG: Found dockerfile package files (repository=astellingwerf/renovate-issue-14962) DEBUG: Found github-actions package files (repository=astellingwerf/renovate-issue-14962) DEBUG: Found 2 package file(s) (repository=astellingwerf/renovate-issue-14962) INFO: Dependency extraction complete (repository=astellingwerf/renovate-issue-14962) "baseBranch": "master", "stats": { "managers": { "dockerfile": {"fileCount": 1, "depCount": 2}, "github-actions": {"fileCount": 1, "depCount": 2} }, "total": {"fileCount": 2, "depCount": 4} } DEBUG: getLabels(https://index.docker.io, astellingwerf/renovate-reproduction, 1.0.0-flavour1) (repository=astellingwerf/renovate-issue-14962) DEBUG: getManifestResponse(https://index.docker.io, astellingwerf/renovate-reproduction, 1.0.0-flavour1) (repository=astellingwerf/renovate-issue-14962) DEBUG: Package releases lookups complete (repository=astellingwerf/renovate-issue-14962) "baseBranch": "master" DEBUG: branchifyUpgrades (repository=astellingwerf/renovate-issue-14962) DEBUG: 2 flattened updates found: astellingwerf/renovate-reproduction, astellingwerf/renovate-reproduction (repository=astellingwerf/renovate-issue-14962) DEBUG: Returning 1 branch(es) (repository=astellingwerf/renovate-issue-14962) DEBUG: config.repoIsOnboarded=true (repository=astellingwerf/renovate-issue-14962) DEBUG: packageFiles with updates (repository=astellingwerf/renovate-issue-14962) "config": { "dockerfile": [ { "packageFile": "Dockerfile", "deps": [ { "depName": "astellingwerf/renovate-reproduction", "currentValue": "1.0.0-flavour1", "replaceString": "astellingwerf/renovate-reproduction:1.0.0-flavour1", "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", "datasource": "docker", "depType": "stage", "depIndex": 0, "updates": [ { "updateType": "replacement", "newName": "astellingwerf/renovate-reproduction", "newValue": "1.0.0-flavour2", "branchName": "renovate/astellingwerf-renovate-reproduction-replacement" } ], "warnings": [], "versioning": "docker", "currentVersion": "1.0.0", "fixedVersion": "1.0.0-flavour1" }, { "depName": "astellingwerf/renovate-reproduction", "currentValue": "1.0.0-flavour1-suffix", "replaceString": "astellingwerf/renovate-reproduction:1.0.0-flavour1-suffix", "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", "datasource": "docker", "depType": "final", "depIndex": 1, "updates": [ { "updateType": "replacement", "newName": "astellingwerf/renovate-reproduction", "newValue": "1.0.0-flavour2", "branchName": "renovate/astellingwerf-renovate-reproduction-replacement" } ], "warnings": [], "versioning": "docker", "currentVersion": "1.0.0", "fixedVersion": "1.0.0-flavour1-suffix" } ] } ], "github-actions": [ { "packageFile": ".github/workflows/renovate.yml", "deps": [ { "depName": "actions/checkout", "commitMessageTopic": "{{{depName}}} action", "datasource": "github-tags", "versioning": "docker", "depType": "action", "replaceString": "actions/checkout@v3.0.0", "autoReplaceStringTemplate": "{{depName}}@{{#if newDigest}}{{newDigest}}{{#if newValue}} # tag={{newValue}}{{/if}}{{/if}}{{#unless newDigest}}{{newValue}}{{/unless}}", "currentValue": "v3.0.0", "depIndex": 0, "updates": [], "warnings": [], "sourceUrl": "https://github.com/actions/checkout", "currentVersion": "v3.0.0", "fixedVersion": "v3.0.0" }, { "depName": "renovatebot/github-action", "commitMessageTopic": "{{{depName}}} action", "datasource": "github-tags", "versioning": "docker", "depType": "action", "replaceString": "renovatebot/github-action@v32.12.0", "autoReplaceStringTemplate": "{{depName}}@{{#if newDigest}}{{newDigest}}{{#if newValue}} # tag={{newValue}}{{/if}}{{/if}}{{#unless newDigest}}{{newValue}}{{/unless}}", "currentValue": "v32.12.0", "depIndex": 1, "updates": [], "warnings": [], "sourceUrl": "https://github.com/renovatebot/github-action", "currentVersion": "v32.12.0", "fixedVersion": "v32.12.0" } ] } ] } DEBUG: processRepo() (repository=astellingwerf/renovate-issue-14962) DEBUG: Processing 1 branch: renovate/astellingwerf-renovate-reproduction-replacement (repository=astellingwerf/renovate-issue-14962) DEBUG: Calculating hourly PRs remaining (repository=astellingwerf/renovate-issue-14962) DEBUG: Retrieving PR list (repository=astellingwerf/renovate-issue-14962) DEBUG: Retrieved 0 Pull Requests (repository=astellingwerf/renovate-issue-14962) DEBUG: currentHourStart=2022-04-06T21:00:00.000+00:00 (repository=astellingwerf/renovate-issue-14962) DEBUG: PR hourly limit remaining: 2 (repository=astellingwerf/renovate-issue-14962) DEBUG: Calculating prConcurrentLimit (10) (repository=astellingwerf/renovate-issue-14962) DEBUG: getBranchPr(renovate/astellingwerf-renovate-reproduction-replacement) (repository=astellingwerf/renovate-issue-14962) DEBUG: findPr(renovate/astellingwerf-renovate-reproduction-replacement, undefined, open) (repository=astellingwerf/renovate-issue-14962) DEBUG: findPr(renovate/astellingwerf-renovate-reproduction-replacement, undefined, closed) (repository=astellingwerf/renovate-issue-14962) DEBUG: 0 PRs are currently open (repository=astellingwerf/renovate-issue-14962) DEBUG: PR concurrent limit remaining: 10 (repository=astellingwerf/renovate-issue-14962) DEBUG: Calculated maximum PRs remaining this run (repository=astellingwerf/renovate-issue-14962) "prsRemaining": 2 DEBUG: PullRequests limit = 2 (repository=astellingwerf/renovate-issue-14962) DEBUG: Calculating hourly PRs remaining (repository=astellingwerf/renovate-issue-14962) DEBUG: currentHourStart=2022-04-06T21:00:00.000+00:00 (repository=astellingwerf/renovate-issue-14962) DEBUG: PR hourly limit remaining: 2 (repository=astellingwerf/renovate-issue-14962) DEBUG: Calculating branchConcurrentLimit (10) (repository=astellingwerf/renovate-issue-14962) DEBUG: 1 already existing branches found: renovate/astellingwerf-renovate-reproduction-replacement (repository=astellingwerf/renovate-issue-14962) DEBUG: Branch concurrent limit remaining: 9 (repository=astellingwerf/renovate-issue-14962) DEBUG: Calculated maximum branches remaining this run (repository=astellingwerf/renovate-issue-14962) "branchesRemaining": 2 DEBUG: Branches limit = 2 (repository=astellingwerf/renovate-issue-14962) DEBUG: Setting current branch to master (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: latest commit (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) "branchName": "master", "latestCommitDate": "2022-04-06T23:50:08+02:00" DEBUG: getBranchPr(renovate/astellingwerf-renovate-reproduction-replacement) (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: findPr(renovate/astellingwerf-renovate-reproduction-replacement, undefined, open) (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: findPr(renovate/astellingwerf-renovate-reproduction-replacement, undefined, closed) (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: branchExists=true (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: dependencyDashboardCheck=undefined (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: recreateClosed is false (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: findPr(renovate/astellingwerf-renovate-reproduction-replacement, Replace dependency astellingwerf/renovate-reproduction with astellingwerf/renovate-reproduction 1.0.0-flavour2, !open) (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: prAlreadyExisted=false (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: Checking if PR has been edited (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: Branch has not been modified (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) "branchName": "renovate/astellingwerf-renovate-reproduction-replacement" DEBUG: Checking schedule(at any time, null) (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: No schedule defined (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: Branch already exists (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: getBranchPr(renovate/astellingwerf-renovate-reproduction-replacement) (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: findPr(renovate/astellingwerf-renovate-reproduction-replacement, undefined, open) (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: findPr(renovate/astellingwerf-renovate-reproduction-replacement, undefined, closed) (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: GitHub 404 (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) "url": "repos/astellingwerf/renovate-issue-14962/branches/master/protection" DEBUG: No branch protection found (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: Skipping stale branch check due to rebaseWhen=auto (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: isBranchConflicted(master, renovate/astellingwerf-renovate-reproduction-replacement) (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: Setting git author name (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) "gitAuthorName": "Renovate Bot" DEBUG: Setting git author email (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) "gitAuthorEmail": "renovate@labelvier.nl" DEBUG: Branch does not need rebasing (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: Using reuseExistingBranch: true (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: manager.getUpdatedPackageFiles() reuseExistinbranch=true (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: Found a multistage build stage name (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: Found a multistage build stage name (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: Found a multistage build stage name (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: Found a multistage build stage name (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: Branch dep is already updated (repository=astellingwerf/renovate-issue-14962, packageFile=Dockerfile, branch=renovate/astellingwerf-renovate-reproduction-replacement) "depName": "astellingwerf/renovate-reproduction" DEBUG: No content changed (repository=astellingwerf/renovate-issue-14962, packageFile=Dockerfile, branch=renovate/astellingwerf-renovate-reproduction-replacement) "depName": "astellingwerf/renovate-reproduction" DEBUG: Found a multistage build stage name (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: Found a multistage build stage name (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: Found a multistage build stage name (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: Found a multistage build stage name (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: Branch dep is already updated (repository=astellingwerf/renovate-issue-14962, packageFile=Dockerfile, branch=renovate/astellingwerf-renovate-reproduction-replacement) "depName": "astellingwerf/renovate-reproduction" DEBUG: No content changed (repository=astellingwerf/renovate-issue-14962, packageFile=Dockerfile, branch=renovate/astellingwerf-renovate-reproduction-replacement) "depName": "astellingwerf/renovate-reproduction" DEBUG: No package files need updating (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: No updated lock files in branch (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: No files to commit (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: Checking if we can automerge branch (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: mergeStatus=no automerge (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: Ensuring PR (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: There are 0 errors and 0 warnings (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: getBranchPr(renovate/astellingwerf-renovate-reproduction-replacement) (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: findPr(renovate/astellingwerf-renovate-reproduction-replacement, undefined, open) (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: findPr(renovate/astellingwerf-renovate-reproduction-replacement, undefined, closed) (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) DEBUG: Creating PR (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) "prTitle": "Replace dependency astellingwerf/renovate-reproduction with astellingwerf/renovate-reproduction 1.0.0-flavour2" DEBUG: Creating PR (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) "title": "Replace dependency astellingwerf/renovate-reproduction with astellingwerf/renovate-reproduction 1.0.0-flavour2", "head": "astellingwerf:renovate/astellingwerf-renovate-reproduction-replacement", "base": "master", "draft": false DEBUG: Pull request creation error (repository=astellingwerf/renovate-issue-14962, branch=renovate/astellingwerf-renovate-reproduction-replacement) "err": { "name": "HTTPError", "code": "ERR_NON_2XX_3XX_RESPONSE", "timings": { "start": 1649281858630, "socket": 1649281858630, "lookup": 1649281858632, "connect": 1649281858634, "secureConnect": 1649281858638, "upload": 1649281858638, "response": 1649281858816, "end": 1649281858817, "phases": { "wait": 0, "dns": 2, "tcp": 2, "tls": 4, "request": 0, "firstByte": 178, "download": 1, "total": 187 } }, "message": "Response code 422 (Unprocessable Entity)", "stack": "HTTPError: Response code 422 (Unprocessable Entity)\n at Request. (/usr/src/app/node_modules/got/dist/source/as-promise/index.js:117:42)\n at runMicrotasks ()\n at processTicksAndRejections (node:internal/process/task_queues:96:5)", "options": { "headers": { "user-agent": "RenovateBot/32.12.0 (https://github.com/renovatebot/renovate)", "accept": "application/vnd.github.v3+json", "authorization": "***********", "content-type": "application/json", "content-length": "1245", "accept-encoding": "gzip, deflate, br" }, "url": "https://api.github.com/repos/astellingwerf/renovate-issue-14962/pulls", "hostType": "github", "username": "", "password": "", "method": "POST", "http2": false }, "response": { "statusCode": 422, "statusMessage": "Unprocessable Entity", "body": { "message": "Validation Failed", "errors": [ { "resource": "PullRequest", "code": "custom", "message": "A pull request already exists for astellingwerf:renovate/astellingwerf-renovate-reproduction-replacement." } ], "documentation_url": "https://docs.github.com/rest/reference/pulls#create-a-pull-request" }, "headers": { "server": "GitHub.com", "date": "Wed, 06 Apr 2022 21:50:58 GMT", "content-type": "application/json; charset=utf-8", "content-length": "292", "x-oauth-scopes": "repo, workflow", "x-accepted-oauth-scopes": "", "github-authentication-token-expiration": "2022-05-06 19:13:57 UTC", "x-github-media-type": "github.v3; format=json", "x-ratelimit-limit": "5000", "x-ratelimit-remaining": "4976", "x-ratelimit-reset": "1649285411", "x-ratelimit-used": "24", "x-ratelimit-resource": "core", "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", "access-control-allow-origin": "*", "strict-transport-security": "max-age=31536000; includeSubdomains; preload", "x-frame-options": "deny", "x-content-type-options": "nosniff", "x-xss-protection": "0", "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "content-security-policy": "default-src 'none'", "vary": "Accept-Encoding, Accept, X-Requested-With", "x-github-request-id": "0405:2769:E8DFB5:299A79F:624E0B42", "connection": "close" }, "httpVersion": "1.1" } } DEBUG: getBranchPr(renovate/astellingwerf-renovate-reproduction-replacement) (repository=astellingwerf/renovate-issue-14962) DEBUG: findPr(renovate/astellingwerf-renovate-reproduction-replacement, undefined, open) (repository=astellingwerf/renovate-issue-14962) DEBUG: findPr(renovate/astellingwerf-renovate-reproduction-replacement, undefined, closed) (repository=astellingwerf/renovate-issue-14962) DEBUG: Closing Dependency Dashboard (repository=astellingwerf/renovate-issue-14962) DEBUG: Removing any stale branches (repository=astellingwerf/renovate-issue-14962) DEBUG: config.repoIsOnboarded=true (repository=astellingwerf/renovate-issue-14962) DEBUG: Branch lists (repository=astellingwerf/renovate-issue-14962) "branchList": ["renovate/astellingwerf-renovate-reproduction-replacement"], "renovateBranches": ["renovate/astellingwerf-renovate-reproduction-replacement"] DEBUG: remainingBranches= (repository=astellingwerf/renovate-issue-14962) DEBUG: No branches to clean up (repository=astellingwerf/renovate-issue-14962) DEBUG: Repository timing splits (milliseconds) (repository=astellingwerf/renovate-issue-14962) "splits": {"init": 1503, "extract": 340, "lookup": 3464, "update": 1142}, "total": 6470 DEBUG: http statistics (repository=astellingwerf/renovate-issue-14962) "urls": { "https://api.github.com/graphql (POST)": 3, "https://api.github.com/repos/actions/checkout/releases (GET)": 1, "https://api.github.com/repos/actions/checkout/tags (GET)": 1, "https://api.github.com/repos/astellingwerf/renovate-issue-14962/pulls (GET)": 1, "https://api.github.com/repos/renovatebot/github-action/releases (GET)": 1, "https://api.github.com/repos/renovatebot/github-action/tags (GET)": 1, "https://api.github.com/repositories/252754603/releases (GET)": 8, "https://api.github.com/repositories/252754603/tags (GET)": 8, "https://auth.docker.io/token (GET)": 1, "https://index.docker.io/v2/ (GET)": 1, "https://index.docker.io/v2/astellingwerf/renovate-reproduction/blobs/sha256:71de1148337f4d1845be01eb4caf15d78e4eb15a1ab96030809826698a5b7e30 (GET)": 1, "https://index.docker.io/v2/astellingwerf/renovate-reproduction/manifests/1.0.0-flavour1 (GET)": 1, "https://index.docker.io/v2/astellingwerf/renovate-reproduction/tags/list (GET)": 1 }, "hostStats": { "api.github.com": {"requestCount": 24, "requestAvgMs": 345, "queueAvgMs": 0}, "auth.docker.io": {"requestCount": 1, "requestAvgMs": 18, "queueAvgMs": 1}, "index.docker.io": {"requestCount": 4, "requestAvgMs": 55, "queueAvgMs": 0} }, "totalRequests": 29 INFO: Repository finished (repository=astellingwerf/renovate-issue-14962) "durationMs": 6470 DEBUG: Renovate exiting ```

Have you created a minimal reproduction repository?

I've created a rep(r)o with just one packageRule.

viceice commented 2 years ago

This is not a bug, last package rule wins.

astellingwerf commented 2 years ago

This is not a bug, last package rule wins.

But last package rule doesn't apply, right? They both have a matchCurrentVersion, of which only one matches the current version.

astellingwerf commented 2 years ago

My suspicion is on line 295 of lib/modules/datasource/index.ts. Based on whatever config is used for the first fetch of releases for a package, the replacementName and replacementVersion are applied to the object. That object is then stored in cache. Whatever other dependency (with its own config, not necessarily with the same replacement settings) for the same datasource + packageName then retrieves the cached entry, with the replacementName and replacementVersion originating from a entirely different configuration.

@JamieMagee, can you explain why the replacements are applied at the datasource fetching stage?

Edited to add: I now see that 9 months ago, @rarkins already had a hunch that the datasource might not be the right place to implement this feature.

JamieMagee commented 2 years ago

Sorry for the long wait on this one. I declared GitHub notification bankruptcy a while ago.

I think it was conceptually the right place to apply replacements, as we wanted to override any other version that may be pulled from the datasource. Unfortunately, this appears to be bleeding over package rules as a result.

I'd appreciate any input you have on the design, and I'm open to refactoring this code, cache busting, etc. Replacements aren't enabled by default, and are currently marked as experimental, so we have the ability to refactor and fix this.

renovate-release commented 1 year ago

:tada: This issue has been resolved in version 34.22.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: