Skip to content

Fix creating an MR when a project approval rule has no approvers

What does this MR do?

Without this change, we assume the regular approval rule is actually an "any_approver" approval rule. An MR can only have one of those, so we get a constraint violation error when the regular approval rule is converted.

It's odd that these rules are entirely valid in the backend, but making them invalid at this stage feels a bit risky.

Screenshots (strongly suggested)

Affected UI, with rules from project

Screenshot_from_2021-04-19_16-25-24

Params sent when pressing button

Screenshot_from_2021-04-19_16-25-55

Created MR with this change

Screenshot_from_2021-04-19_16-50-12

(Ignore bar, I added it between screenshots to ensure that regular project approval rules require a name)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related to #273433 (closed)

Edited by Nick Thomas

Merge request reports