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.3k stars 2.26k forks source link

Renovate does not automatically update branch when updates in a PR shrink #21826

Open Mknight492 opened 1 year ago

Mknight492 commented 1 year ago

How are you running Renovate?

Mend Renovate hosted app on github.com

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

No response

If you're self-hosting Renovate, select which platform you are using.

None

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

I am trying to get this working for the first time

Describe the bug

Link to original discussion where explanation of likely cause is in the comments.

I recently came across an issue where I configured Renovate to make all PR with all "minor" and "patch" updates.

This worked as expected, however I also then wanted to filter the PR to only packages which have a major version >1.0.0 so that they were lower risk package updates.

This works as expected for new PR but I don't believe it's working work existing PRs event though the PR summary states it's filtered out the non major version >1.0.0 version.

There's a demonstration repo here.

I first configured renovate to merge all minor and patch packages like so:

{
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
  "enabled": true,
  "packageRules": [
    {
      "groupName": "All non-major go dependencies",
      "matchUpdateTypes": ["minor", "patch"],
    }
  ]
}

Which raised the correct PR updating the packages like so:

github.com/aws/aws-sdk-go-v2 v1.16.1 -> github.com/aws/aws-sdk-go-v2 v1.18.0 github.com/satori/go.uuid v1.1.0 -> github.com/satori/go.uuid v1.2.0 golang.org/x/tools v0.7.0 -> golang.org/x/tools v0.8.0

However after updating the renovate.json to exclude the package with an unstable API:

{
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
  "enabled": true,
  "packageRules": [
    {
      "groupName": "All non-major go dependencies",
      "matchUpdateTypes": ["minor", "patch"],
      "matchCurrentVersion": ">=1.0.0"
    }
  ]
}

the PR claims that it's no-longer updating the golang.org/x/tools package

Yet it's still include in the PR here

Is this intended behavior? image

Is seems as though it's misleading in the PR summary.

Relevant debug logs

Logs ``` DEBUG: No dangling containers to remove INFO: Repository started { "renovateVersion": "35.58.2" } DEBUG: Using localDir: /mnt/renovate/gh/Mknight492/example DEBUG: PackageFiles.clear() - Package files deleted DEBUG: initRepo("Mknight492/example") DEBUG: Using queue: host=api.github.com, concurrency=10 DEBUG: Mknight492/example default branch = master DEBUG: Using app token for git init DEBUG: Repository cache is restored from revision 13 DEBUG: Resetting npmrc DEBUG: checkOnboarding() DEBUG: isOnboarded() DEBUG: Checking cached config file name DEBUG: Existing config file confirmed DEBUG: Repository config { "fileName": "renovate.json", "config": { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "enabled": true, "packageRules": [ { "groupName": "All non-major go dependencies", "matchUpdateTypes": [ "minor", "patch" ], "matchCurrentVersion": ">=1.0.0" } ] } } DEBUG: Repo is onboarded DEBUG: migrateAndValidate() DEBUG: No config migration necessary DEBUG: massaged config { "config": { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "enabled": true, "packageRules": [ { "groupName": "All non-major go dependencies", "matchUpdateTypes": [ "minor", "patch" ], "matchCurrentVersion": ">=1.0.0" } ], "extends": [ "github>whitesource/merge-confidence:beta" ] } } DEBUG: migrated config { "config": { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "enabled": true, "packageRules": [ { "groupName": "All non-major go dependencies", "matchUpdateTypes": [ "minor", "patch" ], "matchCurrentVersion": ">=1.0.0" } ], "extends": [ "github>whitesource/merge-confidence:beta" ] } } DEBUG: Found repo ignorePaths { "ignorePaths": [ "**/node_modules/**", "**/bower_components/**" ] } DEBUG: No vulnerability alerts found DEBUG: No vulnerability alerts found DEBUG: No baseBranches DEBUG: extract() DEBUG: Cached extract for sha=af640cf415cf2f6df896f8a79042e86f16930ca8 is valid and can be used DEBUG: Deleted cached dep updates INFO: Dependency extraction complete { "baseBranch": "master", "stats": { "managers": { "dockerfile": { "fileCount": 1, "depCount": 1 }, "gomod": { "fileCount": 1, "depCount": 4 } }, "total": { "fileCount": 2, "depCount": 5 } } } DEBUG: PackageFiles.add() - Package file saved for base branch { "baseBranch": "master" } DEBUG: Package releases lookups complete { "baseBranch": "master" } DEBUG: branchifyUpgrades DEBUG: detectSemanticCommits() DEBUG: semanticCommits: returning "enabled" from cache DEBUG: 3 flattened updates found: github.com/aws/aws-sdk-go-v2, github.com/satori/go.uuid, golang.org/x/tools DEBUG: Returning 2 branch(es) DEBUG: config.repoIsOnboarded=true DEBUG: packageFiles with updates { "baseBranch": "master", "config": { "dockerfile": [ { "deps": [ { "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", "currentValue": "onbuild", "datasource": "docker", "depName": "golang", "depType": "final", "packageName": "golang", "replaceString": "golang:onbuild", "skipReason": "invalid-value", "versioning": "docker", "warnings": [], "updates": [] } ], "packageFile": "outyet/Dockerfile" } ], "gomod": [ { "deps": [ { "currentValue": "1.15", "currentVersion": "1.20.3", "datasource": "golang-version", "depName": "go", "depType": "golang", "homepage": "https://go.dev/", "managerData": { "lineNumber": 2 }, "packageName": "go", "registryUrl": "https://raw.githubusercontent.com/golang/website", "sourceUrl": "https://github.com/golang/go", "versioning": "go-mod-directive", "warnings": [], "updates": [] }, { "currentValue": "v1.16.1", "currentVersion": "v1.16.1", "datasource": "go", "depName": "github.com/aws/aws-sdk-go-v2", "depType": "require", "fixedVersion": "v1.16.1", "isSingleVersion": true, "managerData": { "lineNumber": 5, "multiLine": true }, "packageName": "github.com/aws/aws-sdk-go-v2", "sourceUrl": "https://github.com/aws/aws-sdk-go-v2", "versioning": "semver", "warnings": [], "updates": [ { "bucket": "non-major", "newVersion": "v1.18.0", "newValue": "v1.18.0", "releaseTimestamp": "2023-04-24T21:11:42.000Z", "newMajor": 1, "newMinor": 18, "updateType": "minor", "branchName": "renovate/all-non-major-go-dependencies" } ] }, { "currentValue": "v1.1.0", "currentVersion": "v1.1.0", "datasource": "go", "depName": "github.com/satori/go.uuid", "depType": "require", "fixedVersion": "v1.1.0", "isSingleVersion": true, "managerData": { "lineNumber": 6, "multiLine": true }, "packageName": "github.com/satori/go.uuid", "sourceUrl": "https://github.com/satori/go.uuid", "versioning": "semver", "warnings": [], "updates": [ { "bucket": "non-major", "newVersion": "v1.2.0", "newValue": "v1.2.0", "releaseTimestamp": "2018-01-03T15:23:54.000Z", "newMajor": 1, "newMinor": 2, "updateType": "minor", "branchName": "renovate/all-non-major-go-dependencies" } ] }, { "currentValue": "v0.7.0", "currentVersion": "v0.7.0", "datasource": "go", "depName": "golang.org/x/tools", "depType": "require", "fixedVersion": "v0.7.0", "isSingleVersion": true, "managerData": { "lineNumber": 7, "multiLine": true }, "packageName": "golang.org/x/tools", "versioning": "semver", "warnings": [], "updates": [ { "bucket": "non-major", "newVersion": "v0.8.0", "newValue": "v0.8.0", "releaseTimestamp": "2023-04-06T18:59:31.000Z", "newMajor": 0, "newMinor": 8, "updateType": "minor", "branchName": "renovate/golang.org-x-tools-0.x" } ] } ], "packageFile": "go.mod" } ] } } DEBUG: detectSemanticCommits() DEBUG: semanticCommits: returning "enabled" from cache DEBUG: processRepo() DEBUG: Processing 2 branches: renovate/all-non-major-go-dependencies, renovate/golang.org-x-tools-0.x DEBUG: Calculating hourly PRs remaining DEBUG: getPrList success { "pullsTotal": 3, "requestsTotal": 1, "apiQuotaAffected": true } DEBUG: currentHourStart=2023-04-26T14:00:00.000+00:00 DEBUG: PR hourly limit remaining: 2 DEBUG: Calculating prConcurrentLimit (10) DEBUG: getBranchPr(renovate/all-non-major-go-dependencies) DEBUG: findPr(renovate/all-non-major-go-dependencies, undefined, open) DEBUG: Found PR #2 DEBUG: getBranchPr(renovate/golang.org-x-tools-0.x) DEBUG: findPr(renovate/golang.org-x-tools-0.x, undefined, open) DEBUG: Found PR #3 DEBUG: 2 PRs are currently open DEBUG: PR concurrent limit remaining: 8 DEBUG: Calculated maximum PRs remaining this run: 2 DEBUG: PullRequests limit = 2 DEBUG: Calculating hourly PRs remaining DEBUG: currentHourStart=2023-04-26T14:00:00.000+00:00 DEBUG: PR hourly limit remaining: 2 DEBUG: Calculating branchConcurrentLimit (10) DEBUG: 2 already existing branches found: renovate/all-non-major-go-dependencies,renovate/golang.org-x-tools-0.x DEBUG: Branch concurrent limit remaining: 8 DEBUG: Calculated maximum branches remaining this run: 2 DEBUG: Branches limit = 2 DEBUG: syncBranchState()(branch="renovate/all-non-major-go-dependencies") DEBUG: branch.isUpToDate(): using cached result "true"(branch="renovate/all-non-major-go-dependencies") DEBUG: getBranchPr(renovate/all-non-major-go-dependencies)(branch="renovate/all-non-major-go-dependencies") DEBUG: findPr(renovate/all-non-major-go-dependencies, undefined, open)(branch="renovate/all-non-major-go-dependencies") DEBUG: Found PR #2(branch="renovate/all-non-major-go-dependencies") DEBUG: branchExists=true(branch="renovate/all-non-major-go-dependencies") DEBUG: dependencyDashboardCheck=undefined(branch="renovate/all-non-major-go-dependencies") DEBUG: PR rebase requested=false(branch="renovate/all-non-major-go-dependencies") DEBUG: Checking if PR has been edited(branch="renovate/all-non-major-go-dependencies") DEBUG: branch.isModified(): using cached result "false"(branch="renovate/all-non-major-go-dependencies") DEBUG: Found existing branch PR(branch="renovate/all-non-major-go-dependencies") DEBUG: Checking schedule(at any time, null)(branch="renovate/all-non-major-go-dependencies") DEBUG: No schedule defined(branch="renovate/all-non-major-go-dependencies") DEBUG: Branch already exists(branch="renovate/all-non-major-go-dependencies") DEBUG: getBranchPr(renovate/all-non-major-go-dependencies)(branch="renovate/all-non-major-go-dependencies") DEBUG: findPr(renovate/all-non-major-go-dependencies, undefined, open)(branch="renovate/all-non-major-go-dependencies") DEBUG: Found PR #2(branch="renovate/all-non-major-go-dependencies") DEBUG: GET https://api.github.com/repos/Mknight492/example/branches/master/protection = (code=ERR_NON_2XX_3XX_RESPONSE, statusCode=404 retryCount=0, duration=192)(branch="renovate/all-non-major-go-dependencies") DEBUG: No branch protection found(branch="renovate/all-non-major-go-dependencies") DEBUG: Skipping behind base branch check due to rebaseWhen=auto(branch="renovate/all-non-major-go-dependencies") DEBUG: isBranchConflicted(master, renovate/all-non-major-go-dependencies)(branch="renovate/all-non-major-go-dependencies") DEBUG: branch.isConflicted(): using cached result "false"(branch="renovate/all-non-major-go-dependencies") DEBUG: Branch does not need rebasing(branch="renovate/all-non-major-go-dependencies") DEBUG: Using reuseExistingBranch: true(branch="renovate/all-non-major-go-dependencies") DEBUG: Checking if we can automerge branch(branch="renovate/all-non-major-go-dependencies") DEBUG: mergeStatus=no automerge(branch="renovate/all-non-major-go-dependencies") DEBUG: Ensuring PR(branch="renovate/all-non-major-go-dependencies") DEBUG: There are 0 errors and 0 warnings(branch="renovate/all-non-major-go-dependencies") DEBUG: getBranchPr(renovate/all-non-major-go-dependencies)(branch="renovate/all-non-major-go-dependencies") DEBUG: findPr(renovate/all-non-major-go-dependencies, undefined, open)(branch="renovate/all-non-major-go-dependencies") DEBUG: Found PR #2(branch="renovate/all-non-major-go-dependencies") DEBUG: getPrCache()(branch="renovate/all-non-major-go-dependencies") DEBUG: Found existing PR(branch="renovate/all-non-major-go-dependencies") DEBUG: PR cache matches but it has been edited in the past 24hrs, so processing PR(branch="renovate/all-non-major-go-dependencies") DEBUG: Fetching changelog: https://github.com/aws/aws-sdk-go-v2 (v1.16.1 -> v1.18.0)(branch="renovate/all-non-major-go-dependencies") DEBUG: Fetching changelog: https://github.com/satori/go.uuid (v1.1.0 -> v1.2.0)(branch="renovate/all-non-major-go-dependencies") DEBUG: Processing existing PR(branch="renovate/all-non-major-go-dependencies") DEBUG: setPrCache()(branch="renovate/all-non-major-go-dependencies") DEBUG: Pull Request #2 does not need updating(branch="renovate/all-non-major-go-dependencies") DEBUG: PR is not configured for automerge(branch="renovate/all-non-major-go-dependencies") DEBUG: syncBranchState()(branch="renovate/golang.org-x-tools-0.x") DEBUG: branch.isUpToDate(): using cached result "true"(branch="renovate/golang.org-x-tools-0.x") DEBUG: getBranchPr(renovate/golang.org-x-tools-0.x)(branch="renovate/golang.org-x-tools-0.x") DEBUG: findPr(renovate/golang.org-x-tools-0.x, undefined, open)(branch="renovate/golang.org-x-tools-0.x") DEBUG: Found PR #3(branch="renovate/golang.org-x-tools-0.x") DEBUG: branchExists=true(branch="renovate/golang.org-x-tools-0.x") DEBUG: dependencyDashboardCheck=undefined(branch="renovate/golang.org-x-tools-0.x") DEBUG: PR rebase requested=false(branch="renovate/golang.org-x-tools-0.x") DEBUG: Checking if PR has been edited(branch="renovate/golang.org-x-tools-0.x") DEBUG: branch.isModified(): using cached result "false"(branch="renovate/golang.org-x-tools-0.x") DEBUG: Found existing branch PR(branch="renovate/golang.org-x-tools-0.x") DEBUG: Checking schedule(at any time, null)(branch="renovate/golang.org-x-tools-0.x") DEBUG: No schedule defined(branch="renovate/golang.org-x-tools-0.x") DEBUG: Branch already exists(branch="renovate/golang.org-x-tools-0.x") DEBUG: getBranchPr(renovate/golang.org-x-tools-0.x)(branch="renovate/golang.org-x-tools-0.x") DEBUG: findPr(renovate/golang.org-x-tools-0.x, undefined, open)(branch="renovate/golang.org-x-tools-0.x") DEBUG: Found PR #3(branch="renovate/golang.org-x-tools-0.x") DEBUG: Skipping behind base branch check due to rebaseWhen=auto(branch="renovate/golang.org-x-tools-0.x") DEBUG: isBranchConflicted(master, renovate/golang.org-x-tools-0.x)(branch="renovate/golang.org-x-tools-0.x") DEBUG: branch.isConflicted(): using cached result "false"(branch="renovate/golang.org-x-tools-0.x") DEBUG: Branch does not need rebasing(branch="renovate/golang.org-x-tools-0.x") DEBUG: Using reuseExistingBranch: true(branch="renovate/golang.org-x-tools-0.x") DEBUG: Checking if we can automerge branch(branch="renovate/golang.org-x-tools-0.x") DEBUG: mergeStatus=no automerge(branch="renovate/golang.org-x-tools-0.x") DEBUG: Ensuring PR(branch="renovate/golang.org-x-tools-0.x") DEBUG: There are 0 errors and 0 warnings(branch="renovate/golang.org-x-tools-0.x") DEBUG: getBranchPr(renovate/golang.org-x-tools-0.x)(branch="renovate/golang.org-x-tools-0.x") DEBUG: findPr(renovate/golang.org-x-tools-0.x, undefined, open)(branch="renovate/golang.org-x-tools-0.x") DEBUG: Found PR #3(branch="renovate/golang.org-x-tools-0.x") DEBUG: getPrCache()(branch="renovate/golang.org-x-tools-0.x") DEBUG: Found existing PR(branch="renovate/golang.org-x-tools-0.x") DEBUG: PR cache matches but it has been edited in the past 24hrs, so processing PR(branch="renovate/golang.org-x-tools-0.x") DEBUG: Processing existing PR(branch="renovate/golang.org-x-tools-0.x") DEBUG: setPrCache()(branch="renovate/golang.org-x-tools-0.x") DEBUG: Pull Request #3 does not need updating(branch="renovate/golang.org-x-tools-0.x") DEBUG: PR is not configured for automerge(branch="renovate/golang.org-x-tools-0.x") DEBUG: getBranchPr(renovate/all-non-major-go-dependencies) DEBUG: findPr(renovate/all-non-major-go-dependencies, undefined, open) DEBUG: Found PR #2 DEBUG: getPrCache() DEBUG: getBranchPr(renovate/golang.org-x-tools-0.x) DEBUG: findPr(renovate/golang.org-x-tools-0.x, undefined, open) DEBUG: Found PR #3 DEBUG: getPrCache() DEBUG: Closing Dependency Dashboard INFO: Cannot ensure issue because issues are disabled in this repository DEBUG: Removing any stale branches DEBUG: config.repoIsOnboarded=true DEBUG: Branch lists { "branchList": [ "renovate/all-non-major-go-dependencies", "renovate/golang.org-x-tools-0.x" ], "renovateBranches": [ "renovate/all-non-major-go-dependencies", "renovate/configure", "renovate/golang.org-x-tools-0.x" ] } DEBUG: remainingBranches=renovate/configure DEBUG: findPr(renovate/configure, undefined, open) DEBUG: branch.isModified(): using git to calculate DEBUG: Initializing git repository into /mnt/renovate/gh/Mknight492/example DEBUG: Performing blobless clone DEBUG: git clone completed { "durationMs": 944 } DEBUG: latest repository commit { "latestCommit": { "hash": "af640cf415cf2f6df896f8a79042e86f16930ca8", "date": "2023-04-26T10:50:10+12:00", "message": "Update renovate.json", "refs": "HEAD -> master, origin/master, origin/HEAD", "body": "", "author_name": "Mknight492", "author_email": "39689669+Mknight492@users.noreply.github.com" } } DEBUG: branch.isModified() = true { "branchName": "renovate/configure", "lastAuthor": "39689669+Mknight492@users.noreply.github.com", "gitAuthorEmail": "bot@renovateapp.com" } DEBUG: setCachedModifiedResult(): Branch cache not present DEBUG: Orphan Branch is modified - skipping branch deletion INFO: Cannot ensure issue because issues are disabled in this repository DEBUG: PackageFiles.clear() - Package files deleted DEBUG: Branch summary { "cacheModified": true, "baseBranches": [ { "branchName": "master", "sha": "af640cf415cf2f6df896f8a79042e86f16930ca8" } ], "branches": [ { "automerge": false, "baseBranch": "master", "baseBranchSha": "af640cf415cf2f6df896f8a79042e86f16930ca8", "branchName": "renovate/all-non-major-go-dependencies", "branchSha": "b29a38f32b7d22e2526f7d8e71e77e0f0cf76a20", "isModified": false, "isPristine": true }, { "automerge": false, "baseBranch": "master", "baseBranchSha": "af640cf415cf2f6df896f8a79042e86f16930ca8", "branchName": "renovate/golang.org-x-tools-0.x", "branchSha": "82ca8e1261f505567467ae2927eceb1bb39c281b", "isModified": false, "isPristine": true } ], "inactiveBranches": [] } DEBUG: Renovate repository PR statistics { "stats": { "total": 2, "open": 2, "closed": 0, "merged": 0 } } DEBUG: Repository result: done, status: onboarded, enabled: true, onboarded: true DEBUG: Repository timing splits (milliseconds) { "splits": { "init": 1303, "extract": 128, "lookup": 71, "onboarding": 0, "update": 74331 }, "total": 76889 } DEBUG: Package cache statistics { "get": { "count": 59, "avgMs": 1, "medianMs": 0, "maxMs": 18 }, "set": { "count": 25, "avgMs": 2, "medianMs": 2, "maxMs": 3 } } DEBUG: http statistics { "urls": { "https://api.github.com/graphql (POST,200)": 106, "https://api.github.com/repos/Mknight492/example/branches/master/protection (GET,404)": 1, "https://api.github.com/repos/Mknight492/example/contents/renovate.json (GET,200)": 1, "https://api.github.com/repos/Mknight492/example/pulls (GET,200)": 1, "https://api.github.com/repos/aws/aws-sdk-go-v2 (GET,200)": 1, "https://api.github.com/repos/aws/aws-sdk-go-v2/git/blobs/d80ca6e2ab2592db49a90781dae68660d231b854 (GET,200)": 1, "https://api.github.com/repos/aws/aws-sdk-go-v2/git/trees/main (GET,200)": 1, "https://api.github.com/repos/whitesource/merge-confidence/contents/beta.json (GET,200)": 1 }, "hostStats": { "api.github.com": { "requestCount": 113, "requestAvgMs": 583, "queueAvgMs": 0 } }, "totalRequests": 113 } DEBUG: Package lookup durations { "golang-version": { "count": 1, "averageMs": 11, "totalMs": 11, "maximumMs": 11 }, "go": { "count": 3, "averageMs": 18, "totalMs": 54, "maximumMs": 20 } } DEBUG: dns cache { "hosts": [ "api.github.com" ] } INFO: Repository finished { "cloned": true, "durationMs": 76889 } ```

Have you created a minimal reproduction repository?

I have linked to a minimal reproduction in the description above

github-actions[bot] commented 1 year ago

Hi there,

Get your issue fixed faster by creating a minimal reproduction. This means a repository dedicated to reproducing this issue with the minimal dependencies and config possible.

Before we start working on your issue we need to know exactly what's causing the current behavior. A minimal reproduction helps us with this.

To get started, please read our guide on creating a minimal reproduction.

We may close the issue if you, or someone else, haven't created a minimal reproduction within two weeks. If you need more time, or are stuck, please ask for help or more time in a comment.

Good luck,

The Renovate team

Mknight492 commented 1 year ago

Hey @rarkins I've got this minimum a demonstration repo here. Is there something that's missing in this repo though? I'm happy to try and update it if needed?

rarkins commented 1 year ago

Replace the readme with a description of expected vs observed behavior

github-actions[bot] commented 1 year ago

When a bug has been marked as needing a reproduction, it means nobody can work on it until one is provided. In cases where no reproduction is possible, or the issue creator does not have the time to reproduce, we unfortunately need to close such issues as they are non-actionable and serve no benefit by remaining open. This issue will be closed after 7 days of inactivity.

Mknight492 commented 1 year ago

I've updated the readme as requested @rarkins. Is it possible to update this issue so it isn't closed automatically? Thanks