renovatebot / config-help

Please use the Discussions feature of https://github.com/renovatebot/renovate instead
https://github.com/renovatebot/renovate/discussions
MIT License
27 stars 16 forks source link

Groupings no longer work after gitlab settings change #954

Closed vegerot closed 4 years ago

vegerot commented 4 years ago

Which Renovate are you using?

WhiteSource Renovate App (unsure. See https://github.com/renovatebot/config-help/issues/936#issuecomment-714589748 )

Which platform are you using?

GitLab self-hosted

What would you like to do?

I want to do the same thing I wanted to do back in https://github.com/renovatebot/config-help/issues/936 . To reiterate:

I want to:

  • automerge all patch devDependency updates
  • group all minor devDependency updates into one MR
  • group all patch dependency updates into one MR
  • make individual MRs for every minor and major dependency update

I was advised to change my config to

{
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
  "extends": [
    "config:base"
  ],
  "separateMinorPatch": true,
  "packageRules": [
    {
      "depTypeList": ["devDependencies"],
      "updateTypes": ["patch"],
      "automerge": true
    },
    {
      "depTypeList": ["devDependencies"],
      "updateTypes": ["minor"]
    },
    {
      "depTypeList": ["dependencies"],
      "updateTypes": ["patch"]
    }
  ]
}

So I did. A bit after that, I changed my GitLab repo config to use the semi-linear merge strategy. And now none of my groups are grouping.

Right now my MRs on GitLab look like image (and there's a lot more where that came from!)

Anyways, I would like to do what I said at the top. Have minor devDependencies grouped together, have patch Dependencies grouped together, and have individual MRs for each minor/major Dependency update.

@viceice and @rarkins were very helpful before, thanks!

viceice commented 4 years ago

You missed the groupName option in your package rules.

vegerot commented 4 years ago

@viceice thanks! In that case, I must have misunderstood what you meant here (https://github.com/renovatebot/config-help/issues/936#issuecomment-714515006), because that's what I had before, no?

viceice commented 4 years ago

Sorry, maybe I mean asked that too before. See following docs link for explanation

https://docs.renovatebot.com/configuration-options/#groupname

vegerot commented 4 years ago

So I did read that. Are you saying that you were incorrect in your suggestion (https://github.com/renovatebot/config-help/issues/936#issuecomment-714515006) before? If I do add the groupName field, how do I stop it from making names like (patch) (patch) like in https://github.com/renovatebot/config-help/issues/936 ?

viceice commented 4 years ago

Ok, sorry again, my suggestion was not clear. I mean remove the (patch) and (minor) string from groupName. Renovate will / should take care of not grouping minor and patch together, because you use separateMinorPatch.

Renovate will automatically add the updateType to prTitle, see: https://github.com/renovatebot/renovate/blob/9aff7a955ffa586c84b35bacbd14ce995b91b2d3/lib/workers/repository/updates/generate.ts#L239-L249 https://github.com/renovatebot/renovate/blob/c33da16aba2e3fff357ead02c79343ca614f827a/lib/workers/repository/updates/branch-name.ts#L30-L43

So my new suggestion is to try the following config:

{
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
  "extends": [
    "config:base"
  ],
  "separateMinorPatch": true,
  "packageRules": [
    {
      "depTypeList": ["devDependencies"],
      "updateTypes": ["patch"],
      "groupName": "devDependencies",
      "automerge": true
    },
    {
      "depTypeList": ["devDependencies"],
      "updateTypes": ["minor"],
      "groupName": "devDependencies"
    },
    {
      "depTypeList": ["dependencies"],
      "updateTypes": ["patch"],
      "groupName": "Dependencies"
    }
  ]
}
rarkins commented 4 years ago

I'm actually not sure they'll go into separate groups if the groupName is the same

viceice commented 4 years ago

See my links above, I think they will go to different branches and so to different pr

rarkins commented 4 years ago

I think you're right, here's an example: https://github.com/rarkins/test2/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc

vegerot commented 4 years ago

Thanks both of you! Will update this issue after trying the suggestion

vegerot commented 4 years ago

Works like a charm!