How do the package rules actually work in matching packages (for NPM)? #24163
-
How are you running Renovate?Self-hosted If you're self-hosting Renovate, tell us what version of Renovate you run.36.57 If you're self-hosting Renovate, select which platform you are using.gitlab.com Was this something which used to work for you, and then stopped?I never saw this working Wanted end result.I have a few NPM repos on so the correct end results would be something like this:
However, I can not seem to get this working, and the more things I try, the more confused I get about the package rules. What you tried so far.General Questions I have are
What we have triedSo far this is the only config that captures ALL upgrades correctly, but it groups things into 2 PRs only, so it's not the grouping strategy we want {
"extends": ["config:recommended", ":disableMajorUpdates"],
"ignoreDeps": ["private-repos"],
"rangeStrategy": "bump",
...
"packageRules": [
{ "matchDepTypes": ["peerDependencies"], "enabled": false },
{
"matchDepTypes": ["devDependencies"],
"groupName": "devDependencies",
"rangeStrategy": "bump"
},
{
"matchDepTypes": ["dependencies"],
"groupName": "dependencies",
"rangeStrategy": "bump"
}
],
"prConcurrentLimit": 0,
"prHourlyLimit": 0,
...
} This ONLY generates PRs on the mono repos but nothing else {
"extends": ["group:monorepos", ":disableMajorUpdates"],
"ignoreDeps": ["private-repos"],
"rangeStrategy": "bump",
...
"packageRules": [
{ "matchDepTypes": ["peerDependencies"], "enabled": false }
],
"prConcurrentLimit": 0,
"prHourlyLimit": 0,
...
} This just doesn't produce any PRs for some reason, is this rule {
"extends": ["group:monorepos", ":disableMajorUpdates"],
"ignoreDeps": ["private-repos"],
"rangeStrategy": "bump",
...
"packageRules": [
{ "matchDepTypes": ["peerDependencies"], "enabled": false }
{ "matchPackagePatterns": ["*"], "groupName": null }
],
"prConcurrentLimit": 0,
"prHourlyLimit": 0,
} Manually grouping mono repos without using presets, this also does NOT create PRs for any other individual packages {
"extends": [":disableMajorUpdates"],
"ignoreDeps": ["private-repos"],
"rangeStrategy": "bump",
...
"packageRules": [
{ "matchDepTypes": ["peerDependencies"], "enabled": false }
{
"extends": "monorepo:babel",
"groupName": "babel monorepo"
},
{
"extends": "monorepo:date-io",
"groupName": "date-io monorepo"
},
{
"extends": "monorepo:emotion",
"groupName": "emotion monorepo"
},
{
"extends": "monorepo:jest",
"groupName": "jest monorepo"
},
{
"extends": "monorepo:material-ui",
"groupName": "mui monorepo"
},
{
"extends": "monorepo:react",
"groupName": "react monorepo"
},
{
"extends": "monorepo:react-router",
"groupName": "react-router monorepo"
},
{
"extends": "monorepo:storybook",
"groupName": "storybook monorepo"
},
...etc.
],
"prConcurrentLimit": 0,
"prHourlyLimit": 0,
} The most basic one, this again, produces NO PRs {
"extends": [":disableMajorUpdates"],
"ignoreDeps": ["private-repos"],
"rangeStrategy": "bump",
...
"packageRules": [
{ "matchDepTypes": ["peerDependencies"], "enabled": false }
],
"prConcurrentLimit": 0,
"prHourlyLimit": 0,
...
} Manually grouping packages based on what our repo has, this again, ONLY produces PRs for the defined groups, but nothing else. {
"extends": ["config:recommended", ":disableMajorUpdates"],
"ignoreDeps": ["private-repos"],
"rangeStrategy": "bump",
...
"packageRules": [
{ "matchDepTypes": ["peerDependencies"], "enabled": false },
{
"matchPackagePrefixes": ["@mui"],
"groupName": "MUI"
},
{
"matchPackagePrefixes": ["@emotion"],
"groupName": "Emotion"
},
{
"matchPackagePrefixes": ["react"],
"groupName": "React"
},
{
"matchPackagePrefixes": ["eslint"],
"groupName": "ESLint"
},
...etc.
],
"prConcurrentLimit": 0,
"prHourlyLimit": 0,
...
} Relevant debug logsLogs
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 17 replies
-
All PackageRules are getting individually, serially and in the order in which they are defined evaluated. Renovate always tries to reach the desired state, therefore branches are getting deleted and PRs closed. So what you want should be this: {
"extends": ["config:recommended", ":disableMajorUpdates"],
"ignoreDeps": ["private-repos"],
"rangeStrategy": "bump",
"packageRules": [
{ "matchDepTypes": ["peerDependencies"], "enabled": false },
{
"matchDepTypes": ["devDependencies"],
"groupName": "devDependencies",
"rangeStrategy": "bump"
},
{
"matchDepTypes": ["dependencies"],
"groupName": "dependencies",
"rangeStrategy": "bump"
},
{
"matchPackagePrefixes": ["@mui"],
"groupName": "MUI"
},
{
"matchPackagePrefixes": ["@emotion"],
"groupName": "Emotion"
},
{
"matchPackagePrefixes": ["react"],
"groupName": "React"
},
{
"matchPackagePrefixes": ["eslint"],
"groupName": "ESLint"
},
"...":"..."
],
"prConcurrentLimit": 0,
"prHourlyLimit": 0
} If not, create a reproduction repo. |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
OK I found out what's wrong, turns out it was this config
recreateWhen
By default it's set to "auto", and for some reason, that seems to make Renovate "randomly" reopen some closed MRs but not others, and the odd things is that different MRs are re-opened each time, this was the root for all the inconsistency & confusions we are getting, is this an actual bug in Renovate?
Either way, when setting it to
"recreateWhen": "always"
, PRs are now (re)created consistently & correctly