0

We use RenovateBot to update our dependencies in GitLab. To avoid that every request have to be approved by a specific amount of persons, I want to auto approve all MRs of renovate.

In the documentation I found autoApprove, but that seems to be just for azure. For GitLab I found gitLabIgnoreApprovals, but here regarding to the documentation also auto merging is necessary.

Is there a way to auto approve all MRs of renovate bot, but not auto merge it?

JuliusH4
  • 11
  • 3
  • 1
    Not sure to see the value of auto approve if you don't auto merge. – Gaël J Jun 15 '23 at 18:43
  • 1
    @GaëlJ The value would be to have the full control about the merge, but not passing the whole approval process. Normally we have strict approval rules, but in this case the approval process won't be necessary, since its just an increment of one or multiple versions. – JuliusH4 Jun 26 '23 at 12:49

3 Answers3

0

If you go to your project's Merge Request settings, you can set approval rules. Try adding your RenovateBot as a user for a new rule and set 'Approvals Required' to 0.

I'm not sure if this will override whatever default rules you have set for all users, or if that's how approval rules even work to be honest. I can't test this on my environment for obvious security reasons.

Gitlab's documentation on approval rules

steven s
  • 11
  • 4
  • I do not see a way to just apply this rule only for renovate branches. I only can select between `all branches`, `all protected branches` or `specific branch` but I can not define a rule for branches based on a specific schema. – JuliusH4 Jun 14 '23 at 16:41
0

As JuliusH4 mentioned, there is no option to regex the renovate-branches to disable the approval rule :(

For now the only workaround I found is to disable the creation of a Merge Request and therefore you don't need to approve it. It gets disabled by "branch" as automergeType. So add these two lines:

"automerge": true,
"automergeType": "branch"

In our case this works, since we have a commit webhook, that also runs all tests and renovate will only automerge if this pipeline is successfull. The disadvantage is that you won't get notified via Mail.

Adrian Mole
  • 49,934
  • 160
  • 51
  • 83
dja
  • 1
  • 1
0

The feature was added in a newer version of Renovate Bot. Just add "autoApprove": true to your renovate.json and Renovate will add one approval to the merge request.

GitLab was also added to the documentation.

JuliusH4
  • 11
  • 3