renovate icon indicating copy to clipboard operation
renovate copied to clipboard

Support filters for `lockFileMaintenance` to update only defined files

Open pmwmedia opened this issue 2 years ago • 4 comments

What would you like Renovate to be able to do?

I have multiple package-lock.json files in my project. However, I want that renovate bot will update only one of them. Therefore, I would like to have a filter attribute for lockFileMaintenance, which allows to define which files should be updated and which should be ignored.

In my case, the reason is that some of my package-lock.json files have dependencies to generated OpenAPI packages, which are only present when running a Maven command before lockFileMaintenance. As renovate cannot execute Maven commands, I want to exclude all related package-lock.json files.

{
    "$schema": "https://docs.renovatebot.com/renovate-schema.json",
    "extends": [
        "config:base"
    ],
    "lockFileMaintenance": {
        "enabled": true
        // Update "project-a/package-lock.json`, but ignore "project-b/package-lock.json`
    }
}

I have created a minimal reproduction repository: https://github.com/pmwmedia/lock-file-maintenance-reproduction-repo

Originally, I posted my use case in the discussion section (#18936). There, rarkins has recommended to open a feature request.

If you have any ideas on how this should be implemented, please tell us here.

Is this a feature you are interested in implementing yourself?

No

pmwmedia avatar Nov 17 '22 17:11 pmwmedia

We maybe need a boolean setting like refreshLockFiles to control this, so that it's not tied to lockFileMaintenance.enabled

rarkins avatar Nov 17 '22 17:11 rarkins

Hello,

Just checking whether this is a stale request as I'm looking for the same thing, this is still not possible as of today, right?

Marsup avatar Oct 19 '23 15:10 Marsup

You can maybe exclude files using https://docs.renovatebot.com/configuration-options/#excludecommitpaths but I'm not sure if it can be customized down to the branch/update or if it won't cause other side effects

rarkins avatar Oct 19 '23 16:10 rarkins

We'd like to filter lock file maintenance, but at the manager level. So far I haven't figured out a good way to accomplish this.

jalaziz avatar Apr 17 '24 06:04 jalaziz