Don't automerge if package version is 0.x
stephenwade opened this issue · comments
Which Renovate are you using?
WhiteSource Renovate App
Which platform are you using?
GitHub.com
Have you checked the logs? Don't forget to include them if relevant
I don't have access to them since I'm just a contributor, not a organization member. But I don't think they're relevant.
What would you like to do?
I want to automerge minor updates, but only if a package version is > 0.x
.
{
"packageRules": [
{
"updateTypes": ["minor", "patch"],
"matchCurrentVersion": "!/^0/",
"automerge": true
}
]
}
Thanks @rarkins!
Still having a bit of trouble putting this together. I tested on my own copy of the repo so I can provide logs now.
My config:
{
// start with default Renovate settings
"extends": [
"config:base"
],
// rules for specific subsets of packages
"packageRules": [
{
// for all patch updates
"updateTypes": ["patch"],
"automerge": true
},
{
// for minor updates that aren't 0.x
"updateTypes": ["minor"],
"matchCurrentVersion": "!/^0/",
"automerge": true
}
],
// bump the range even if the new version satisfies the existing range, e.g. ^1.0.0 -> ^1.1.0
"rangeStrategy": "bump",
// update lock files (default schedule is once a week)
"lockFileMaintenance": {
"enabled": true
}
}
I think this should automerge all patch updates, but only automerge minor updates if the version is not 0.x
. However, https://github.com/stephenwade/web-test-renovate/pull/128 is a minor update to a 0.x
package, and the PR says that automerge is enabled. What am I doing wrong?
Renovate logs
DEBUG: getBranchPr(renovate/d4kmor-launch-0.x)(branch="renovate/d4kmor-launch-0.x")
DEBUG: findPr(renovate/d4kmor-launch-0.x, undefined, open)(branch="renovate/d4kmor-launch-0.x")
DEBUG: Found PR #128(branch="renovate/d4kmor-launch-0.x")
DEBUG: Returning from graphql open PR list(branch="renovate/d4kmor-launch-0.x")
DEBUG: processBranch with 1 upgrades(branch="renovate/d4kmor-launch-0.x")
DEBUG: Setting current branch to master(branch="renovate/d4kmor-launch-0.x")
DEBUG: latest commit(branch="renovate/d4kmor-launch-0.x")
{
"branchName": "master",
"latestCommitDate": "2020-11-17T21:05:02-05:00"
}
DEBUG: getBranchPr(renovate/d4kmor-launch-0.x)(branch="renovate/d4kmor-launch-0.x")
DEBUG: findPr(renovate/d4kmor-launch-0.x, undefined, open)(branch="renovate/d4kmor-launch-0.x")
DEBUG: Found PR #128(branch="renovate/d4kmor-launch-0.x")
DEBUG: Returning from graphql open PR list(branch="renovate/d4kmor-launch-0.x")
DEBUG: branchExists=true(branch="renovate/d4kmor-launch-0.x")
DEBUG: Branch pr rebase requested: false(branch="renovate/d4kmor-launch-0.x")
DEBUG: Branch has 1 upgrade(s)(branch="renovate/d4kmor-launch-0.x")
DEBUG: Checking if PR has been edited(branch="renovate/d4kmor-launch-0.x")
DEBUG: Found existing branch PR(branch="renovate/d4kmor-launch-0.x")
DEBUG: Checking schedule(at any time, null)(branch="renovate/d4kmor-launch-0.x")
DEBUG: No schedule defined(branch="renovate/d4kmor-launch-0.x")
DEBUG: Branch already exists(branch="renovate/d4kmor-launch-0.x")
DEBUG: getBranchPr(renovate/d4kmor-launch-0.x)(branch="renovate/d4kmor-launch-0.x")
DEBUG: findPr(renovate/d4kmor-launch-0.x, undefined, open)(branch="renovate/d4kmor-launch-0.x")
DEBUG: Found PR #128(branch="renovate/d4kmor-launch-0.x")
DEBUG: Returning from graphql open PR list(branch="renovate/d4kmor-launch-0.x")
DEBUG: Branch does not need rebasing(branch="renovate/d4kmor-launch-0.x")
DEBUG: Using reuseExistingBranch: true(branch="renovate/d4kmor-launch-0.x")
DEBUG: manager.getUpdatedPackageFiles()(branch="renovate/d4kmor-launch-0.x")
{
"reuseExistingBranch": true,
"branchName": "renovate/d4kmor-launch-0.x"
}
DEBUG: npm.updateDependency(): dependencies.@d4kmor/launch = ^0.7.0(branch="renovate/d4kmor-launch-0.x")
DEBUG: No package files need updating(branch="renovate/d4kmor-launch-0.x")
DEBUG: Getting updated lock files(branch="renovate/d4kmor-launch-0.x")
DEBUG: lock file dirs(branch="renovate/d4kmor-launch-0.x")
{
"dirs": {
"yarnLockDirs": [],
"npmLockDirs": [],
"pnpmShrinkwrapDirs": [],
"lernaDirs": []
}
}
DEBUG: Writing package.json files(branch="renovate/d4kmor-launch-0.x")
{
"packageFiles": [
"integration/test-runner/package.json",
"package.json",
"packages/browser-logs/package.json",
"packages/config-loader/package.json",
"packages/dev-server-core/package.json",
"packages/dev-server-esbuild/package.json",
"packages/dev-server-hmr/package.json",
"packages/dev-server-import-maps/package.json",
"packages/dev-server-legacy/package.json",
"packages/dev-server-rollup/package.json",
"packages/dev-server-storybook/package.json",
"packages/dev-server/package.json",
"packages/parse5-utils/package.json",
"packages/polyfills-loader/package.json",
"packages/rollup-plugin-copy/package.json",
"packages/rollup-plugin-html/package.json",
"packages/rollup-plugin-import-meta-assets/package.json",
"packages/rollup-plugin-polyfills-loader/package.json",
"packages/rollup-plugin-workbox/package.json",
"packages/test-runner-browserstack/package.json",
"packages/test-runner-chrome/package.json",
"packages/test-runner-cli/package.json",
"packages/test-runner-commands/package.json",
"packages/test-runner-core/package.json",
"packages/test-runner-coverage-v8/package.json",
"packages/test-runner-junit-reporter/package.json",
"packages/test-runner-mocha/package.json",
"packages/test-runner-playwright/package.json",
"packages/test-runner-puppeteer/package.json",
"packages/test-runner-saucelabs/package.json",
"packages/test-runner-selenium/package.json",
"packages/test-runner-visual-regression/package.json",
"packages/test-runner/package.json"
]
}
DEBUG: Writing any updated package files(branch="renovate/d4kmor-launch-0.x")
DEBUG: No updated lock files in branch(branch="renovate/d4kmor-launch-0.x")
DEBUG: No files to commit(branch="renovate/d4kmor-launch-0.x")
DEBUG: Checking if we can automerge branch(branch="renovate/d4kmor-launch-0.x")
DEBUG: mergeStatus=no automerge(branch="renovate/d4kmor-launch-0.x")
DEBUG: Ensuring PR(branch="renovate/d4kmor-launch-0.x")
DEBUG: There are 0 errors and 0 warnings(branch="renovate/d4kmor-launch-0.x")
DEBUG: getBranchPr(renovate/d4kmor-launch-0.x)(branch="renovate/d4kmor-launch-0.x")
DEBUG: findPr(renovate/d4kmor-launch-0.x, undefined, open)(branch="renovate/d4kmor-launch-0.x")
DEBUG: Found PR #128(branch="renovate/d4kmor-launch-0.x")
DEBUG: Returning from graphql open PR list(branch="renovate/d4kmor-launch-0.x")
DEBUG: Found existing PR(branch="renovate/d4kmor-launch-0.x")
DEBUG: getBranchStatus(renovate/d4kmor-launch-0.x)(branch="renovate/d4kmor-launch-0.x")
DEBUG: branch status check result(branch="renovate/d4kmor-launch-0.x")
{
"state": "pending",
"statuses": []
}
DEBUG: check runs result(branch="renovate/d4kmor-launch-0.x")
{
"checkRuns": [
{
"name": "Verify windows",
"status": "in_progress",
"conclusion": null
},
{
"name": "Verify linux (14.x)",
"status": "in_progress",
"conclusion": null
},
{
"name": "Verify linux (12.x)",
"status": "in_progress",
"conclusion": null
},
{
"name": "Verify linux (14.x)",
"status": "in_progress",
"conclusion": null
},
{
"name": "Verify linux (12.x)",
"status": "completed",
"conclusion": "success"
},
{
"name": "Verify windows",
"status": "in_progress",
"conclusion": null
}
]
}
DEBUG: Processing existing PR(branch="renovate/d4kmor-launch-0.x")
DEBUG: getBranchStatus(renovate/d4kmor-launch-0.x)(branch="renovate/d4kmor-launch-0.x")
DEBUG: branch status check result(branch="renovate/d4kmor-launch-0.x")
{
"state": "pending",
"statuses": []
}
DEBUG: check runs result(branch="renovate/d4kmor-launch-0.x")
{
"checkRuns": [
{
"name": "Verify windows",
"status": "in_progress",
"conclusion": null
},
{
"name": "Verify linux (14.x)",
"status": "in_progress",
"conclusion": null
},
{
"name": "Verify linux (12.x)",
"status": "in_progress",
"conclusion": null
},
{
"name": "Verify linux (14.x)",
"status": "in_progress",
"conclusion": null
},
{
"name": "Verify linux (12.x)",
"status": "completed",
"conclusion": "success"
},
{
"name": "Verify windows",
"status": "in_progress",
"conclusion": null
}
]
}
DEBUG: getBranchStatus() result(branch="renovate/d4kmor-launch-0.x")
{
"branchStatus": "yellow",
"branchName": "renovate/d4kmor-launch-0.x"
}
DEBUG: Pull Request #128 does not need updating(branch="renovate/d4kmor-launch-0.x")
DEBUG: Checking #128 for automerge(branch="renovate/d4kmor-launch-0.x")
{
"automerge": true,
"automergeType": "pr",
"automergeComment": "automergeComment"
}
DEBUG: PR is configured for automerge(branch="renovate/d4kmor-launch-0.x")
DEBUG: PR is not ready for merge(branch="renovate/d4kmor-launch-0.x")
{
"canMergeReason": "mergeStateStatus = UNSTABLE"
}
You need to add "separateMinorPatch": true
to your config. But also note that in semver even patch updates to 0.x
versions may be breaking.
I updated my config to include "separateMinorPatch": true
, but the issue is still happening.
Another PR: https://github.com/stephenwade/web-test-renovate/pull/127
Renovate logs
DEBUG: getBranchPr(renovate/d4kmor-cli-0.x)(branch="renovate/d4kmor-cli-0.x")
DEBUG: findPr(renovate/d4kmor-cli-0.x, undefined, open)(branch="renovate/d4kmor-cli-0.x")
DEBUG: Found PR #127(branch="renovate/d4kmor-cli-0.x")
DEBUG: Returning from graphql open PR list(branch="renovate/d4kmor-cli-0.x")
DEBUG: processBranch with 1 upgrades(branch="renovate/d4kmor-cli-0.x")
DEBUG: Setting current branch to master(branch="renovate/d4kmor-cli-0.x")
DEBUG: latest commit(branch="renovate/d4kmor-cli-0.x")
{
"branchName": "master",
"latestCommitDate": "2020-11-18T06:02:54+00:00"
}
DEBUG: getBranchPr(renovate/d4kmor-cli-0.x)(branch="renovate/d4kmor-cli-0.x")
DEBUG: findPr(renovate/d4kmor-cli-0.x, undefined, open)(branch="renovate/d4kmor-cli-0.x")
DEBUG: Found PR #127(branch="renovate/d4kmor-cli-0.x")
DEBUG: Returning from graphql open PR list(branch="renovate/d4kmor-cli-0.x")
DEBUG: branchExists=true(branch="renovate/d4kmor-cli-0.x")
DEBUG: Branch pr rebase requested: true(branch="renovate/d4kmor-cli-0.x")
DEBUG: Branch has 1 upgrade(s)(branch="renovate/d4kmor-cli-0.x")
DEBUG: Checking if PR has been edited(branch="renovate/d4kmor-cli-0.x")
DEBUG: Found existing branch PR(branch="renovate/d4kmor-cli-0.x")
DEBUG: Checking schedule(at any time, null)(branch="renovate/d4kmor-cli-0.x")
DEBUG: No schedule defined(branch="renovate/d4kmor-cli-0.x")
DEBUG: Branch already exists(branch="renovate/d4kmor-cli-0.x")
DEBUG: getBranchPr(renovate/d4kmor-cli-0.x)(branch="renovate/d4kmor-cli-0.x")
DEBUG: findPr(renovate/d4kmor-cli-0.x, undefined, open)(branch="renovate/d4kmor-cli-0.x")
DEBUG: Found PR #127(branch="renovate/d4kmor-cli-0.x")
DEBUG: Returning from graphql open PR list(branch="renovate/d4kmor-cli-0.x")
DEBUG: Manual rebase requested via PR checkbox for #127(branch="renovate/d4kmor-cli-0.x")
DEBUG: Using reuseExistingBranch: false(branch="renovate/d4kmor-cli-0.x")
DEBUG: manager.getUpdatedPackageFiles()(branch="renovate/d4kmor-cli-0.x")
{
"reuseExistingBranch": false,
"branchName": "renovate/d4kmor-cli-0.x"
}
DEBUG: npm.updateDependency(): dependencies.@d4kmor/cli = ^0.7.1(branch="renovate/d4kmor-cli-0.x")
DEBUG: Updating packageFile content(packageFile="package.json", branch="renovate/d4kmor-cli-0.x")
{
"depName": "@d4kmor/cli"
}
DEBUG: Updated 1 package files(branch="renovate/d4kmor-cli-0.x")
DEBUG: Getting updated lock files(branch="renovate/d4kmor-cli-0.x")
DEBUG: lock file dirs(branch="renovate/d4kmor-cli-0.x")
{
"dirs": {
"yarnLockDirs": [
"yarn.lock"
],
"npmLockDirs": [],
"pnpmShrinkwrapDirs": [],
"lernaDirs": []
}
}
DEBUG: Writing package.json files(branch="renovate/d4kmor-cli-0.x")
{
"packageFiles": [
"integration/test-runner/package.json",
"package.json",
"packages/browser-logs/package.json",
"packages/config-loader/package.json",
"packages/dev-server-core/package.json",
"packages/dev-server-esbuild/package.json",
"packages/dev-server-hmr/package.json",
"packages/dev-server-import-maps/package.json",
"packages/dev-server-legacy/package.json",
"packages/dev-server-rollup/package.json",
"packages/dev-server-storybook/package.json",
"packages/dev-server/package.json",
"packages/parse5-utils/package.json",
"packages/polyfills-loader/package.json",
"packages/rollup-plugin-copy/package.json",
"packages/rollup-plugin-html/package.json",
"packages/rollup-plugin-import-meta-assets/package.json",
"packages/rollup-plugin-polyfills-loader/package.json",
"packages/rollup-plugin-workbox/package.json",
"packages/test-runner-browserstack/package.json",
"packages/test-runner-chrome/package.json",
"packages/test-runner-cli/package.json",
"packages/test-runner-commands/package.json",
"packages/test-runner-core/package.json",
"packages/test-runner-coverage-v8/package.json",
"packages/test-runner-junit-reporter/package.json",
"packages/test-runner-mocha/package.json",
"packages/test-runner-playwright/package.json",
"packages/test-runner-puppeteer/package.json",
"packages/test-runner-saucelabs/package.json",
"packages/test-runner-selenium/package.json",
"packages/test-runner-visual-regression/package.json",
"packages/test-runner/package.json"
]
}
DEBUG: Writing any updated package files(branch="renovate/d4kmor-cli-0.x")
DEBUG: Writing package.json(branch="renovate/d4kmor-cli-0.x")
DEBUG: No npmrc file found in repository(branch="renovate/d4kmor-cli-0.x")
DEBUG: Writing updated .npmrc file to /mnt/renovate/gh/stephenwade/web-test-renovate/.npmrc(branch="renovate/d4kmor-cli-0.x")
DEBUG: Generating yarn.lock for .(branch="renovate/d4kmor-cli-0.x")
DEBUG: Spawning yarn install to create /mnt/renovate/gh/stephenwade/web-test-renovate/yarn.lock(branch="renovate/d4kmor-cli-0.x")
DEBUG: Updating yarn.lock only - skipping node_modules(branch="renovate/d4kmor-cli-0.x")
DEBUG: No node constraint found - using latest(branch="renovate/d4kmor-cli-0.x")
DEBUG: Using docker to execute(branch="renovate/d4kmor-cli-0.x")
DEBUG: No tag or tagConstraint specified(branch="renovate/d4kmor-cli-0.x")
{
"image": "docker.io/renovate/node"
}
DEBUG: Docker image is already prefetched: docker.io/renovate/node(branch="renovate/d4kmor-cli-0.x")
DEBUG: Executing command(branch="renovate/d4kmor-cli-0.x")
{
"command": "docker run --rm --name=renovate_node --label=renovate_child -v \"/mnt/renovate/gh/stephenwade/web-test-renovate\":\"/mnt/renovate/gh/stephenwade/web-test-renovate\" -v \"/tmp/renovate-cache\":\"/tmp/renovate-cache\" -v \"/home/ubuntu/.npmrc\":\"/home/ubuntu/.npmrc\" -e NPM_CONFIG_CACHE -e npm_config_store -e CI -w \"/mnt/renovate/gh/stephenwade/web-test-renovate\" docker.io/renovate/node bash -l -c \"npm i -g yarn && sed -i 's/ steps,/ steps.slice(0,1),/' /home/ubuntu/.npm-global/lib/node_modules/yarn/lib/cli.js && yarn install --ignore-engines --ignore-platform --network-timeout 100000 --ignore-scripts\""
}
DEBUG: exec completed(branch="renovate/d4kmor-cli-0.x")
{
"cmd": "docker run --rm --name=renovate_node --label=renovate_child -v \"/mnt/renovate/gh/stephenwade/web-test-renovate\":\"/mnt/renovate/gh/stephenwade/web-test-renovate\" -v \"/tmp/renovate-cache\":\"/tmp/renovate-cache\" -v \"/home/ubuntu/.npmrc\":\"/home/ubuntu/.npmrc\" -e NPM_CONFIG_CACHE -e npm_config_store -e CI -w \"/mnt/renovate/gh/stephenwade/web-test-renovate\" docker.io/renovate/node bash -l -c \"npm i -g yarn && sed -i 's/ steps,/ steps.slice(0,1),/' /home/ubuntu/.npm-global/lib/node_modules/yarn/lib/cli.js && yarn install --ignore-engines --ignore-platform --network-timeout 100000 --ignore-scripts\"",
"durationMs": 12427,
"stdout": "\n> yarn@1.22.10 preinstall /home/ubuntu/.npm-global/lib/node_modules/yarn\n> :; (node ./preinstall.js > /dev/null 2>&1 || true)\n\n/home/ubuntu/.npm-global/bin/yarn -> /home/ubuntu/.npm-global/lib/node_modules/yarn/bin/yarn.js\n/home/ubuntu/.npm-global/bin/yarnpkg -> /home/ubuntu/.npm-global/lib/node_modules/yarn/bin/yarn.js\n+ yarn@1.22.10\nadded 1 package in 1.575s\nyarn install v1.22.10\n[1/4] Resolving packages...\nsuccess Saved lockfile.\nDone in 6.25s.\n",
"stderr": ""
}
DEBUG: yarn.lock needs updating(branch="renovate/d4kmor-cli-0.x")
DEBUG: updateYarnOffline resolvedPaths(branch="renovate/d4kmor-cli-0.x")
{
"resolvedPaths": []
}
DEBUG: Updated 1 lock files(branch="renovate/d4kmor-cli-0.x")
{
"updatedArtifacts": [
"yarn.lock"
]
}
DEBUG: 2 file(s) to commit(branch="renovate/d4kmor-cli-0.x")
DEBUG: Committing files to branch renovate/d4kmor-cli-0.x(branch="renovate/d4kmor-cli-0.x")
INFO: Branch updated(branch="renovate/d4kmor-cli-0.x")
{
"commitSha": "b6284b0"
}
DEBUG: Checking if we can automerge branch(branch="renovate/d4kmor-cli-0.x")
DEBUG: mergeStatus=no automerge(branch="renovate/d4kmor-cli-0.x")
DEBUG: Ensuring PR(branch="renovate/d4kmor-cli-0.x")
DEBUG: There are 0 errors and 0 warnings(branch="renovate/d4kmor-cli-0.x")
DEBUG: getBranchPr(renovate/d4kmor-cli-0.x)(branch="renovate/d4kmor-cli-0.x")
DEBUG: findPr(renovate/d4kmor-cli-0.x, undefined, open)(branch="renovate/d4kmor-cli-0.x")
DEBUG: Found PR #127(branch="renovate/d4kmor-cli-0.x")
DEBUG: Returning from graphql open PR list(branch="renovate/d4kmor-cli-0.x")
DEBUG: Found existing PR(branch="renovate/d4kmor-cli-0.x")
DEBUG: getBranchStatus(renovate/d4kmor-cli-0.x)(branch="renovate/d4kmor-cli-0.x")
DEBUG: branch status check result(branch="renovate/d4kmor-cli-0.x")
{
"state": "pending",
"statuses": []
}
DEBUG: No check runs found(branch="renovate/d4kmor-cli-0.x")
{
"result": {
"total_count": 0,
"check_runs": []
}
}
DEBUG: Processing existing PR(branch="renovate/d4kmor-cli-0.x")
DEBUG: getBranchStatus(renovate/d4kmor-cli-0.x)(branch="renovate/d4kmor-cli-0.x")
DEBUG: branch status check result(branch="renovate/d4kmor-cli-0.x")
{
"state": "pending",
"statuses": []
}
DEBUG: No check runs found(branch="renovate/d4kmor-cli-0.x")
{
"result": {
"total_count": 0,
"check_runs": []
}
}
DEBUG: getBranchStatus() result(branch="renovate/d4kmor-cli-0.x")
{
"branchStatus": "yellow",
"branchName": "renovate/d4kmor-cli-0.x"
}
DEBUG: updatePr(127, fix(deps): update dependency @d4kmor/cli to ^0.7.1, body)(branch="renovate/d4kmor-cli-0.x")
DEBUG: PR updated(branch="renovate/d4kmor-cli-0.x")
{
"pr": 127
}
INFO: PR updated(branch="renovate/d4kmor-cli-0.x")
{
"pr": 127,
"prTitle": "fix(deps): update dependency @d4kmor/cli to ^0.7.1"
}
DEBUG: Getting comments for #127(branch="renovate/d4kmor-cli-0.x")
DEBUG: Found 0 comments(branch="renovate/d4kmor-cli-0.x")
DEBUG: Checking #127 for automerge(branch="renovate/d4kmor-cli-0.x")
{
"automerge": true,
"automergeType": "pr",
"automergeComment": "automergeComment"
}
DEBUG: PR is configured for automerge(branch="renovate/d4kmor-cli-0.x")
DEBUG: PR is not ready for merge(branch="renovate/d4kmor-cli-0.x")
{
"canMergeReason": "mergeStateStatus = UNSTABLE"
}
Ok, i now have it, matchCurrentVersion
is a regex wich is executed against the current value ^0.5.9
. so your regex doesn't match because of the range marker.
so your regex should be like this "!/^\\^?0/"
Thanks @viceice! I ended up using "matchCurrentVersion": "!/^[~^]?0/"
to match ^0.x.x
as well as ~0.x.x
.