Fix update reviewers request when none is assigned
What does this MR do and why?
This MR fixes an issue where reviewers update requests with empty reviewers_ids
params causing HTTP 500
.
Screenshots or screen recordings
Please see the screen recording to demonstrate the error in the related issue.
How to set up and validate locally
- Ensure a SaaS (Gitlab.com) environment
- One way of doing this is to add a
env.runit
file to the root GDK folder with the following snippetexport GITLAB_SIMULATE_SAAS=1
- One way of doing this is to add a
- Set ultimate license on a group
http://gdk.test:3000/admin/groups
- Create a project in the ultimate group or use an existing one, e.g.
http://gdk.test:3000/gitlab-org/gitlab-test
- Set the feature flag on rails console
bundle exec rails c
project = Project.find(2) Feature.enable(:suggested_reviewers_control, project)
- Enable
suggested_reviewers_enabled
project settingsproject.project_setting.update!(suggested_reviewers_enabled: true)
- Create a merge request on the project
- Use some existing project members
suggested_reviewers = ["lea_mclaughlin", "ken"=]
- Add some suggestions to an existing open MR
mr = MergeRequest.find(7) mr.build_predictions mr.predictions.update!(suggested_reviewers: { reviewers: suggested_reviewers })
- Navigate to the MR view page and click on the reviewers dropdown
- Click on tooltip (
?
) icon next to theSuggestions
headert but do not assign any reviewers - Click outside of the dropdown
- Confirm that there is no error shown on the flash message
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #385012 (closed)
Edited by Tan Le