Expose accepted reviewers to GraphQL query
What does this MR do and why?
Update GraphQL API to query suggested reviewers and accepted suggestions.
- This API is gated behind a feature flag
suggested_reviewers_control
. - This query is in Alpha and hence will not require a deprecation process.
Screenshots or screen recordings
How to set up and validate locally
- Ensure a SaaS (Gitlab.com) environment
- One way of doing this is to add a
env.runit
file to the root GDK folder with the following snippetexport GITLAB_SIMULATE_SAAS=1
- One way of doing this is to add a
- Set ultimate license on a group
http://gdk.test:3000/admin/groups
- Create a project in the ultimate group or use an existing one, e.g.
http://gdk.test:3000/gitlab-org/gitlab-test
- Set the feature flag on rails console
bundle exec rails c
project = Project.find(2) Feature.enable(:suggested_reviewers_control, project)
- Enable
suggested_reviewers_enabled
project settingsproject.project_setting.update!(suggested_reviewers_enabled: true)
- Create a merge request on the project
- Use some existing project members
accepted_reviewers = ["ken"] suggested_reviewers = ["lea_mclaughlin", "ken"]
- Add some suggestions to an existing open MR
mr = MergeRequest.find(7) mr.build_predictions mr.predictions.update!(accepted_reviewers: { reviewers: accepted_reviewers }, suggested_reviewers: { reviewers: suggested_reviewers })
- Go to http://gdk.test:3000/-/graphql-explorer
- Excute the following query and confirm the output
{ mergeRequest(id: "gid://gitlab/MergeRequest/7") { suggestedReviewers { accepted suggested } } }
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Tan Le