4

I would like to prevent Renovate from making major upgrades for some dependencies but still allow minor and patch upgrade for those dependencies. Using ignoreDeps excludes them completely which is not optimal. I also need to have all suggested upgrades of each run in one Gitlab merge request, so using separate matchUpdateTypes groups does not suit my use-case.

Is there a way to achieve what I am looking for?

Concrete example in a project using Angular 14, that Renovate should not try to upgrade to 15 but still give me the latest 14.x upgrades:

"@angular/router": "14.2.7",   // what I have now
"@angular/router": "14.2.10",  // what should be suggested
"@angular/router": "15.0.0",   // what should be avoided

My general package rules across all repos looks like following:

"packageRules": [
  {
    "groupName": "all dependencies",
    "groupSlug": "all",
    "matchPackagePatterns": [
      "*"
    ],
    "matchUpdateTypes": [
      "major",
      "minor",
      "patch"
    ]
  }
],

And I specify the specific dependencies to ignore in the renovate.json file of each repo like such:

{
  "$schema": "https://docs.renovatebot.com/renovate-schema.json"
  "ignoreDeps": [
    "@angular/router"
  ]
}

But this prevents all updates. I've tried playing around with the schema, this did just ignore the config altogether:

// BROKEN
{
  "$schema": "https://docs.renovatebot.com/renovate-schema.json"
  "major": {
    "ignoreDeps": [
      "@angular/router"
    ]
  }
}

And overriding the packageRules at repo level was also unsuccessful.

AdrienW
  • 3,092
  • 6
  • 29
  • 59

1 Answers1

2

You could try something like this:

"packageRules": [
...
  {
    "matchPackageNames": ["@angular/router"],
    "allowedVersions": "<15.0.0"
  },
...
]
Matthias Hoefel
  • 325
  • 3
  • 6
  • Do you know if this would also be possible to configure at the repo level (in the `renovate.json` file)? I may want to forbid major updates of some lib for one repo but allow it for another one. EDIT: I realize now, I could rewrite my `renovate.json` to use `packageRules` instead of `ignoreDeps` and have that kind of granular control at the repo level. Correct? I'll try this and report back. – AdrienW Feb 16 '23 at 13:29
  • Works as advertised! I was also able to use `matchPackagePatterns` to ignore all `@angular/*` packages. – AdrienW May 08 '23 at 05:49