Add data attribute for suggested reviewers

What does this MR do and why?

This clearly identifies suggested users to automated tests (previously the only indicator was relative position, which is less reliable).

To be used in !100890 (merged)
Part of gitlab-org/quality/testcases#3245 (closed)

Screenshots or screen recordings

No visible UI change.

reviewers

How to set up and validate locally

  1. Ensure a SaaS (Gitlab.com) environment
    1. One way of doing this is to add a env.runit file to the root GDK folder with the following snippet export GITLAB_SIMULATE_SAAS=1
  2. Set ultimate license on a group http://gdk.test:3000/admin/groups
  3. Create a project in the ultimate group
  4. Set the feature flags on rails console bin/rails c
project = Project.find(id-of-your-project) in the rail console
Feature.enable(:suggested_reviewers, project)
Feature.enable(:suggested_reviewers_control, project)
  1. Enable the Suggested Reviewers feature via Project > Settings > Merge Requests > Enable suggested reviewers

setting

  1. Create a merge request on the project
  2. Add some members to the group. Let's say a user ronnie
  3. Add some suggestions on rails console bin/rails c
mr = project.merge_requests.first
mr.build_predictions
mr.predictions.update!(suggested_reviewers: { reviewers: ['ronnie'] })
  1. Go to the merge request and click the reviewers. You should see ronnie as suggested
  2. Use developer tools to inspect the DOM. Only the li element for ronnie should have a data-user-suggested="true" attribute.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Mark Lapierre

Merge request reports

Loading