I’m trying to use the API to add approvers/approver groups after pipelines succeed.
I test like this
curl -X PUT -H 'Private-Token: xyzxyz' -H 'Content-Type: application/json' https://gitlab.com/api/v4/projects/group%2Fproject/merge_requests/123/approvers --data '{"approver_ids": [123123], approver_group_ids: [234234]}'
which returns cleanly, but does not change the approvers
and approver_groups
fields in
curl https://gitlab.com/api/v4/projects/group%2Fproject/merge_requests/123/approvals | python -m json.tool
I’ve also tested this GET with merge requests from gitlab-ce, which has lots of approvers and approver groups, but it also shows those fields as empty. For example, https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/30490 and https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/30516, but requests by the API still show
curl https://gitlab.com/api/v4/projects/gitlab-org%2Fgitlab-ce/merge_requests/30490/approvals | python -m json.tool
[...]
"approvers": [],
"approver_groups": [],
[...]
It seems like these fields should contain users and should be modifiable by the API, but perhaps I’m missing something.