-
-
Notifications
You must be signed in to change notification settings - Fork 163
feature: Update MR reviewer #562
Comments
This feature is relatively new and I believe most self-hosted instances haven't made the upgrade yet. Also, I don't know if there's any endpoint available to get the reviewers (Let me know if you find any). The only endpoint quite close is the Project level Rules under Merge Request approvals API, then we use the eligible approvers list. Do you have any suggestion on what we can do? |
It's possible from the MR get endpoint it's just not documented. It's basically the same thing as {
...
"reviewers": [
{
"id": 2182404,
"name": "Alberts Zemzale",
"username": "zemzale",
"state": "active",
"avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/2182404/avatar.png",
"web_url": "https://gitlab.com/zemzale"
}
],
...
} It seems like updating is not yet possible via API https://gitlab.com/gitlab-org/gitlab/-/issues/292714 . The milestone for that is 13.8 so that is a blocker for updating. Also it doesn't seem like xanzy/go-gitlab has support for reviewer attribute, but I have opend an issue about it xanzy/go-gitlab#1030 |
Seems the reviewers returned are those who have left a review on the MR or those that reviews have been requested from. I tried this on gitlab-org/gitlab repo: → glab api /projects/gitlab-org%2Fgitlab/merge_requests/51578 The response comes with an empty {
...
"assignees": [
{
"id": 1758950,
"name": "Erick Bajao",
"username": "iamricecake",
"state": "active",
"avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/1758950/avatar.png",
"web_url": "https://gitlab.com/iamricecake"
},
{
"id": 4155490,
"name": "Marcel Amirault",
"username": "marcel.amirault",
"state": "active",
"avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/4155490/avatar.png",
"web_url": "https://gitlab.com/marcel.amirault"
}
],
"assignee": {
"id": 1758950,
"name": "Erick Bajao",
"username": "iamricecake",
"state": "active",
"avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/1758950/avatar.png",
"web_url": "https://gitlab.com/iamricecake"
},
"reviewers": [],
...
} |
This merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/51186 has been reviewed: → gl api /projects/gitlab-org%2Fgitlab/merge_requests/51186 {
...
"reviewers": [
{
"id": 142752,
"name": "Gary Holtz",
"username": "garyh",
"state": "active",
"avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/142752/avatar.png",
"web_url": "https://gitlab.com/garyh"
},
{
"id": 236961,
"name": "Marcia Ramos",
"username": "marcia",
"state": "active",
"avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/236961/avatar.png",
"web_url": "https://gitlab.com/marcia"
},
{
"id": 1884221,
"name": "Patrick Bajao",
"username": "patrickbajao",
"state": "active",
"avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/1884221/avatar.png",
"web_url": "https://gitlab.com/patrickbajao"
}
],
...
} |
Would like to work on this one if anyone else haven't pick it yet. :) |
@kousikmitra sure thing. Go ahead and just open a PR. |
It allowes `mr update` to update reviewers with a new flag --reviewers Delivers profclems#562
It allowes `mr update` to update reviewers with a new flag --reviewers Delivers profclems#562
It allowes `mr update` to update reviewers with a new flag --reviewers Delivers profclems#562
Describe the feature or problem you'd like to solve
In GitLab 13.7 there is MR reviewers field https://about.gitlab.com/blog/2020/10/13/merge-request-reviewers/
Currently there is no way how to interact with this from
glab
.Propose a Solution
Add a new flag to
--reviewers
to allow updating that fromglab
Additional context
I actually have not found any API documentation about this. Maybe it's missing, but I didn't dig for too long or just missed it.
The text was updated successfully, but these errors were encountered: