assign_reviewer quick action not working for groups: Could not apply assign_reviewer command. Failed to find users for 'GROUP_NAME'
Summary
The /assign_reviewer
quick action is no longer setting reviewers when a group is the intended reviewer. There are two failure modes:
- In some situations, the
/assign_reviewer
(and equivalent quick actions) will fail silently. This happens if the quick action is part of a merge request template. - Attempting to use this quick action via a comment (Typing
/assign_reviewer @bcarranza-archive
or similar) will yield an error:
Could not apply assign_reviewer command. Failed to find users for '@GROUP_NAME'.
Steps to reproduce
- Create a project where a group
GROUP_NAME
is a member (I've been testing with the group having the Developer role.) - Populate the project such that you can create a new merge request
- Compose a new merge request with a string like
/assign_reviewer @GROUP_NAME
in the Description - Click Create merge request
- Observe that the MR is created and the list of Reviewers remains empty
- In a comment to the MR, add the
/assign_reviewer @GROUP_NAME
string and click Comment - Observe Applying multiple commands
- Observe a light blue dialog with
Could not apply assign_reviewer command. Failed to find users for '@GROUP_NAME '.
- Observe that the list of Reviewers remains empty
The group we target is a member of the project that the MR is being created in.
Watch both failure modes in this recording on Loom.
Example Project
I have been testing this in the assign_reviewer-quick-action-group project which is Public. I applied /assign_reviewer @bcarranza-archive
and observed the behavior reported above in the MRs in that example project.
What is the current bug behavior?
The group/group members are not set as reviewers for the MR. Sometimes the failure is silent. Sometimes the Could not apply assign_reviewer command. Failed to find users for '@GROUP_NAME'.
error message is observed.
What is the expected correct behavior?
The list of reviewers should be updated properly with the members of the group targeted by the /assign_reviewer
quick action.
Note: The docs for this quick action do not explicitly say that a group can be used with this quick action. However, this has worked previously for the customer who originally reported this. GitLab team member with access to Zendesk can learn more in the ticket.
Relevant logs and/or screenshots
Output of checks
This bug happens on GitLab.com.
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)
Possible fixes
I am not sure of the line of code in particular but I would take a look at: