Config-help: Directly push `patch` and `minor` to master and create seperate PRs for major updates

Created on 12 Nov 2017  Â·  14Comments  Â·  Source: renovatebot/config-help

I'm trying setup my config to directly push minor and patches to the master branch and creating seperate PRs for each major updates. My renovate.json looks like this:

{
  "automerge": true,
  "automergeType": "branch-push",
  "major": {
    "automerge": false,
    "automergeType": "pr"
  },
  "multipleMajorPrs": true
}

Is this looking good? I've change updated config like 20 min ago and nothing happend yet. Are there any logs when using your github app?

(Also wondering why you have a "multipleMajorPrs" and not just a "multiplePrs" inside of the "major", "minor" part.)

All 14 comments

The hosted Renovate App runs hourly, so you may need to wait 1-60 minutes for updates to take effect.

To explain the configuration options, consider if you are currently on v1.0.0 and there exists upgrades to v1.0.8, v1.1.0, v2.0.0 and v3.0.0

Renovate's default behaviour is to offer you at most one minor and one major upgrade, which means v1.1.0 and v3.0.0. If you set multipleMajorPrs to true then you will get PRs for v1.1.0, v2.0.0 and v3.0.0 (3 separate PRs). Hence why it's called mutipleMajorPrs and not multiplePrs - as you already get multiple PRs regardless.

I'm guessing what you mean is push any patch or minor updates directly to master (after passing tests) but for major updates then raise them as PRs? Assuming you don't need PRs for every major upgrade as described above, your config could be simplified to:

{
  "automergeType": "branch-push",
  "minor": {
    "automerge": true,
  }
}

The above will work because both patch and minor upgrades will be caught by that minor configuration. The branch-push configuration is harmless to apply at root level because automerge will be false for major anyway.

It can also be simplified further by using preset names:

{
  "extends": [
    ":automergeMinor",
    ":automergeBranchPush"
  ]
}

I also recommend you add "extends": ["config:base"] first - essentially this contains my recommended defaults, which may update/improve over time, and then anything you add to your config after will override it if necessary.

The full recommended config is therefore:

{
  "extends": [
    "config:base",
    ":automergeMinor",
    ":automergeBranchPush"
  ]
}

Thanks for your quick and detailed response! I'll try your config and see how it works out.

Renovate's default behaviour is to offer you at most one minor and one major upgrade, which means v1.1.0 and v3.0.0. If you set multipleMajorPrs to true then you will get PRs for v1.1.0, v2.0.0 and v3.0.0 (3 separate PRs). Hence why it's called mutipleMajorPrs and not multiplePrs - as you already get multiple PRs regardless.

I though it would create a PR for every major upgrade per dependency. So if I've for example:

  • React on 15.4.1 and they released 16.0
  • AWS on 2.13.7 and they release 3.0
    it would create 2 seperate PR request and I can merge them manually. Is something like this possible? Or is it even a good idea? Mhh..

Yes it's also default behaviour to split PRs per-dependency as you want

Okay cool, thanks!

Mh still doesn't work as expected. It creates new branches (w/o PR) instead of pushing it directly to my master as you can see here:
image
image

Sorry for any confusion. It never just commits directly to master. It always creates a branch first, waits for test results, and then pushes the passing commit to master before deleting the branch. It's usually not a good idea to simply push commits directly as you will end up "breaking" your master branch sooner or later, even with minor updates only.

If your repository doesn't have any tests enabled (i.e there's nothing to pass), then you can set this setting to tell Renovate to not wait for any passing tests:

"requiredStatusChecks": null

Okay seems logical. I'll get test soonâ„¢ but using this for now. Thanks though!

I've finally some tests and removed the requiredStatusChecks line but now it won't push any changes to my master branch.
image

I assum renovate create a new branch -> modify the package.json -> test are triggered -> if test are good -> merge but since I have directly push to master there might be a bug?

It should delete the branch after test run complete and push the same change to master to avoid merge commits.

I can take a look at the server logs and see if that gives us enough info to solve it. Please let me know the repository name and which particular dependency/branch you are expecting to have been automerged

Repo name: Skaronator/HHB-Frontend
Mainbranch: master
Renovate Branch: renovate/redux-form-7.x
Dependency: redux-form from 7.1.2 to 7.2.0

Hope this helps, thanks!

Thanks, I'll get back to you soon. I think I actually broke it yesterday (by inadvertently skipping the automerge check) with this commit: https://github.com/renovateapp/renovate/commit/eabff37a15375973549dc7ec374d30d77900a3c1

Alright take your time. Thanks!

@Skaronator I think you should find that the redux-form branch has now been automerged. It was indeed being prevented by the faulty logic I mentioned above, now fixed and running in the app.

Yup just saw the commit, awesome! Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Joge97 picture Joge97  Â·  6Comments

augi picture augi  Â·  5Comments

billyto picture billyto  Â·  9Comments

simoneb picture simoneb  Â·  10Comments

jugaltheshah picture jugaltheshah  Â·  4Comments