Gerrit group as default reviewer

161 views
Skip to first unread message

Mohan

unread,
Aug 28, 2024, 8:28:21 AM8/28/24
to Repo and Gerrit Discussion
In Gerrit, it is possible to set a group as a default reviewer instead of specifying individual users?

Matthias Sohn

unread,
Aug 28, 2024, 9:49:26 AM8/28/24
to Mohan, Repo and Gerrit Discussion
On Wed, Aug 28, 2024 at 2:28 PM Mohan <moha...@gmail.com> wrote:
In Gerrit, it is possible to set a group as a default reviewer instead of specifying individual users?

I think the reviewers plugin allows to use groups to configure default reviewers on project level.
 
--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/CA%2B4Hw5YxB_w3CW3oRiz_zCpGtVp%2BeojgpJFTvJ7jtVWyz%2BkvBQ%40mail.gmail.com.

Mk

unread,
Aug 29, 2024, 2:19:12 AM8/29/24
to Repo and Gerrit Discussion
Hi Matthias,

I have followed the instructions provided in above guide and i have enabled in etc/reviewers.config file then added below.

  [reviewers]
    enableREST = true
    suggestOnly = false
    ignoreWip = false
    mergeFilters = true


Next, I created a new 'reviewers.config' file in the 'refs/meta/config' branch of the 'android/test' repository. This file contains a filter rule as below.

  [filter "*"]
    reviewer = DevGroup


After committing and pushing these changes to the repository, some modifications were made by my team members. However, when I checked the change request in the UI, I couldn't see the 'DevGroup' listed under the Reviewers section.

Gerrit log i can see below

gerrit  | [2024-08-29 05:59:02,789] [ReceiveCommits-1-for-SSH git-receive-pack android/test (ramesh.rv)] WARN  com.googlesource.gerrit.plugins.reviewers.ReviewersResolver : For the change 381 of project android/test: reviewer DevGroup is neither an account nor a group. [CONTEXT PLUGIN="reviewers" RECEIVE_ID="android/test-1724911142677-840fc005" project="android/test" ]

Is there anything else I should configure to make sure the 'DevGroup' appears in the Reviewers section? 

Any guidance would be greatly appreciated.

Thank you.

Rikard Almgren

unread,
Aug 29, 2024, 2:23:05 AM8/29/24
to Repo and Gerrit Discussion
On Thursday 29 August 2024 at 08:19:12 UTC+2 Mk wrote:
Hi Matthias,

I have followed the instructions provided in above guide and i have enabled in etc/reviewers.config file then added below.

  [reviewers]
    enableREST = true
    suggestOnly = false
    ignoreWip = false
    mergeFilters = true


Next, I created a new 'reviewers.config' file in the 'refs/meta/config' branch of the 'android/test' repository. This file contains a filter rule as below.

  [filter "*"]
    reviewer = DevGroup


After committing and pushing these changes to the repository, some modifications were made by my team members. However, when I checked the change request in the UI, I couldn't see the 'DevGroup' listed under the Reviewers section.

Gerrit log i can see below

gerrit  | [2024-08-29 05:59:02,789] [ReceiveCommits-1-for-SSH git-receive-pack android/test (ramesh.rv)] WARN  com.googlesource.gerrit.plugins.reviewers.ReviewersResolver : For the change 381 of project android/test: reviewer DevGroup is neither an account nor a group. [CONTEXT PLUGIN="reviewers" RECEIVE_ID="android/test-1724911142677-840fc005" project="android/test" ]

Is there anything else I should configure to make sure the 'DevGroup' appears in the Reviewers section? 

Any guidance would be greatly appreciated.

Thank you.

Is "DevGroup" visible to the uploader? (Usually the change owner)
IIRC, if the group is not visible to the change owner/uploader, it cannot automatically add reviewers, as it cannot resolve the group. I believe this is done using the visibility of the uploader, but I could be mistaken.
If the group is not secret by any means, you can also check if the group has "VisibleToAll = True" and try that.

Mk

unread,
Aug 29, 2024, 2:45:11 AM8/29/24
to Repo and Gerrit Discussion
The DevGroup group  after changing the "VisibleToAll = True" it worked as expected. Thanks a lot Rikard and Matthias.
Reply all
Reply to author
Forward
0 new messages