Developer get error 500 when editing MR with approval rule

Summary

When a developer try to edit an MR that is created from an issue page where the MR has approval rule, the developer will get the error 500 page after clicking Save

Steps to reproduce

  1. Create a group1
  2. Create a subgroupA for the approvers
  3. Add a project1 within group1 group1/project1
  4. create master branch
  5. Go to project Settings > General > Merge request approvals > Add group1/subgroupA as approver
  6. Add a user (userA) as member to the project with developer permission
  7. From here onward complete the actions as userA, create an issue within the project
  8. Go to the created issue > click on Create merge request
  9. Go to the newly created merge > click Edit
  10. Either userA edit or not, userA will get 500 error page when click Save

Note:

  • This only happens when adding subgroup as approvers
  • When others (project owners) edit the MR, it will remove approval rules when click Save, potentially another bug? This leads to develop can edit the MR.

Example Project

https://gitlab.com/gitlab-silver/group-testmr/test-mr/

What is the current bug behavior?

Developer get 500 error when trying to edit an MR.

What is the expected correct behavior?

Give an error message as to why the developer cannot edit the MR instead of error 500. It could be reasonable because editing MR could possibly edit approval rule but maybe editing approval rule could be edited separately?

Output of checks

This bug happens on GitLab.com, GitLab Enterprise Edition 12.7.0-pre e5c967cc

Sentry link: https://sentry.gitlab.net/gitlab/gitlabcom/issues/1157216/?query=is:unresolved%20correlation_id:NEZcpr5hIs1

Affecting Silver customer with 10 seats: https://gitlab.zendesk.com/agent/tickets/143159

Edited by Sokunrotanak Srey (Rotanak)