Skip to content
This repository has been archived by the owner on Dec 12, 2020. It is now read-only.

How to not group all lockFileMaintenance updates together? #89

Closed
felixfbecker opened this issue Sep 1, 2018 · 8 comments
Closed

How to not group all lockFileMaintenance updates together? #89

felixfbecker opened this issue Sep 1, 2018 · 8 comments
Assignees

Comments

@felixfbecker
Copy link

Currently, when doing lockfile maintenance, one PR updates all package-lock.json files in the repo. I would like them to be separate PRs instead, so I can test the important projects quickly, while delaying merge of the other. Is that possible?

@rarkins
Copy link
Collaborator

rarkins commented Sep 1, 2018

To be in separate PRs means they need to have separate branch names. To have separate branch names would mean we need it to be something like 'renovate/' + id + 'lock-file-maintenance'. I can't think of any easy way to do that right now except statically provisioning a different branchPrefix per-package file. How many different branches/PRs would you want?

@felixfbecker
Copy link
Author

Right now, it's 4.

Could I define the branch name as something like renovate/lock-file-maintenance/{{path}}?

@rarkins
Copy link
Collaborator

rarkins commented Sep 1, 2018

The nearest we have is packageFile which includes the file name too, and I haven't tried using that in a branch template before. Probably best if we also expose path like you suggest so that a rule can be added to lockFileMaintenance.

@felixfbecker
Copy link
Author

I would like to try packageFile out, what would be the exact config I would have to set?

@rarkins
Copy link
Collaborator

rarkins commented Sep 2, 2018

@felixfbecker Sorry, after trying this myself I realised/remembered that lock file maintenance has a different logic that makes this harder than I first thought. I will have to refactor a little code this week so that package files can be separated. Feel free to raise it as a feature request in main repo is you prefer, otherwise I'll update here when done.

In short: normally every update required is its own "update" object including its package file, dependency name, etc - and then we group them by branch. For lock file maintenance, we jump straight to the combined "group" without making every file their own "update" first.

@rarkins rarkins self-assigned this Sep 2, 2018
@rarkins rarkins changed the title How to not group all package.jsons together? How to not group all lockFileMaintenance updates together? Sep 2, 2018
@felixfbecker
Copy link
Author

What setting would I have to use to just exclude all but one package from the lockfile PRs for now?

@rarkins
Copy link
Collaborator

rarkins commented Sep 6, 2018

Sorry, only way I can think of is to disable that package file completely for now. The logic is hardcoded and I couldn't work out a way to easily undo that without needing to touch 5+ files. I'll see tomorrow if I can get a stable refactoring so that packageRules.paths can be applied.

@rarkins
Copy link
Collaborator

rarkins commented Sep 8, 2018

@felixfbecker I made the refactor yesterday and it should hopefully satisfy your requirements.

Here is how to separate each lock file maintenance into a separate PR, as you originally asked:

    "lockFileMaintenance": {
      "enabled": true,
      "branchTopic": "lock-file-maintenance-{{packageFile}}",
      "commitMessageExtra": "({{packageFile}})"
}

Example PR list:
image

Example PR:
image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants