Renovate: Possibility to reset approvals count in gitlab merge request when gitLabAutomerge set to true

Created on 13 Mar 2020  路  17Comments  路  Source: renovatebot/renovate

What would you like Renovate to be able to do?
Gitlab allow to configure approvals count per repo, but dont have setting to auto-configure it per-mergre request depending on conditions. This is blocks automerge of merge request from renovate.

Describe the solution you'd like
I want to have setting like gitLabResetApprovers possibly with Automerge postfix but it seems too long for setting. When set to true merge request would be created, approvals count set to zero and than automerge enabled.

Describe alternatives you've considered
Right now it possible to achieve with disabling automerge in renovate and adjust approvals count with subsequent automerge through additional job and gitlab api but this is frustrating.

gitlab

Most helpful comment

The approvals requirement reminds me of this:
image

All 17 comments

Is it really possible that a user or bot has permissions to "bypass" approvals for its own MRs?

Yes. You can edit mr required approvals count even in merge request ui. At least in our configuration.

I don't think this feature is available in the opensource version. If I remember correctly it is a paid feature, named approval rules or something like that.

It is configured by default approvals count in project settings, and than can be customized in concrete mr by manual editing. Just test it in cloud version at https://gitlab.com/SkReD/test/-/merge_requests/1. User with developer access can edit mr approvals count there.

ok. So if it is in paid version only, it should not be supported? And, anyway, in cloud it is supported on free plan (but this is strange)

I don't say that we shouldn't support that scenario. I only want to mentions that this is a paid feature, see https://about.gitlab.com/pricing/

So it can be difficult to implement without a paid seat. (I personally don't have a paid seat)

Anyway I'm not sure, if this is a feature for the renovate bot. Maybe this should be done with another bot. like we use for our own approvals on github: renovate-approve

Cant find official way for creating such app for gitlab.
I thought that adding such setting directly in renovate would be in line with gitLabAutomerge setting, that is already exists.

Even if it's a feature for paid-only, I think it's fine to support. Our first decision is whether it belongs in Renovate or not. i.e. should Renovate have the option to bypass reviewers for its own MRs, or should there be "another bot". I'm thinking it's useful if Renovate can do it.

Next questions are how (which API endpoint or setting) and then finally naming.

ok, here is the api. Will be very complex, because the rules seems to need to be check on several levels

We use this one https://docs.gitlab.com/ee/api/merge_request_approvals.html#change-approval-configuration in our pipelines. What other levels beside mr itself shoud be checked?

this api is deprecated and will probably be remove with v13 (coming in may 2020?)
image

Is this problem related to https://github.com/renovatebot/config-help/issues/936#issuecomment-714681076 ? It would be nice to have renovate auto-merge its MRs

I've added the custom approval rule
image

So it seems to be getting us closer...
image

I think you are also interested in https://github.com/renovatebot/renovate/issues/6577

The approvals requirement reminds me of this:
image

haha 馃槅 , how can I get around this two-foot wide fence?!!!

Was this page helpful?
0 / 5 - 0 ratings