Setting `reviewer_ids` when updating an MR using the API does not seem to work
Summary
When updating an MR using the API, setting the reviewer_ids field does not seem to update the reviewers of the MR.
Steps to reproduce
- Open an MR on a project using the GitLab UI without any reviewers.
- Note the project ID and merge request ID somewhere.
- Generate an API token
- Call the
PUTAPI toprojects/:id/merge_requests/:iidwith a non emptyreviewer_idsattribute, for example[5].
What is the current bug behavior?
The reviewers of the MR are not updated.
What is the expected correct behavior?
The reviewers of the MR are updated.
Relevant logs and/or screenshots
The minimal PUT request that made it not work is something like the following body:
{
"reviewer_ids": [5]
}
The response in that case is:
{"error":"assignee_id, assignee_ids, description, labels, add_labels, remove_labels, milestone_id, remove_source_branch, allow_collaboration, allow_maintainer_to_push, squash, target_branch, title, state_event, discussion_locked are missing, at least one parameter must be provided"}
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Ubuntu 20.04 Proxy: no Current User: git Using RVM: no Ruby Version: 2.7.2p137 Gem Version: 3.1.4 Bundler Version:2.1.4 Rake Version: 13.0.3 Redis Version: 5.0.9 Git Version: 2.29.0 Sidekiq Version:5.2.9 Go Version: unknown GitLab information Version: 13.8.0-ee Revision: 1ae10d09692 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 12.4 URL: https://[hidden] HTTP Clone URL: https://[hidden]/some-group/some-project.git SSH Clone URL: ssh://git@[hidden]:22222/some-group/some-project.git Elasticsearch: yes Geo: no Using LDAP: no Using Omniauth: yes Omniauth Providers: google_oauth2 GitLab Shell Version: 13.15.0 Repository storage paths: - default: /var/opt/gitlab/git-data/repositories GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell Git: /opt/gitlab/embedded/bin/git
(I have hidden our URL since I'd prefer not to put it on the internet)
Results of GitLab application Check
Expand for output related to the GitLab application check
Checking GitLab subtasks ...Checking GitLab Shell ...
GitLab Shell: ... GitLab Shell version >= 13.15.0 ? ... OK (13.15.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Internal API available: OK Redis available via internal API: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Gitaly ...
Gitaly: ... default ... OK
Checking Gitaly ... Finished
Checking Sidekiq ...
Sidekiq: ... Running? ... yes Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Incoming Email ...
Incoming Email: ... Reply by email is disabled in config/gitlab.yml
Checking Incoming Email ... Finished
Checking LDAP ...
LDAP: ... LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab App ...
Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... [a list of only yes] Redis version >= 4.0.0? ... yes Ruby version >= 2.7.2 ? ... yes (2.7.2) Git version >= 2.29.0 ? ... yes (2.29.0) Git user has default SSH configuration? ... yes Active users: ... 14 Is authorized keys file accessible? ... yes GitLab configured to store new projects in hashed storage? ... yes All projects are in hashed storage? ... yes Elasticsearch version 7.x (6.4 - 6.x deprecated to be removed in 13.8)? ... yes (7.8.0)
Checking GitLab App ... Finished
Checking GitLab subtasks ... Finished
Possible fixes
It seems that the reviewer_ids property is just not used yet when updating MR's, since the Rails attribute checker seems to already complain about missing a field.