Add support for instance-wide code review custom instructions
What does this MR do and why?
Introduce a new instance setting to keep a reference to the instance-wide custom instructions applied to all Duo Code Review sessions in that instance, similarly to what was done for groups in !230090 (merged).
This new instance setting is only applied for self-managed instances and should not be visible in the SaaS version.
References
Related to #600996 (closed)
How to set up and validate locally
Group settings - nothing has changed
- Choose a group where Duo Agent Platform is enabled (e.g.
gitlab-duo) - Navigate to
Settings > General > GitLab Duo features: http://gdk.test:3000/groups/gitlab-duo/-/edit#js-gitlab-duo-settings - Check
Custom review instructions for groupssection - Change/select a project with custom instructions following the docs
Instance settings - new setting
- Navigate to
Admin > GitLab Duo > Change Configuration: http://gdk.test:3000/admin/gitlab_duo/configuration - Check
Custom review instructions for groupssection - Change/select a project with custom instructions following the docs
Validating backend
You can run the following commands to check if your custom instructions were applied properly after following the steps above:
project = Project.last
merge_request = project.merge_requests.first
::Gitlab::Duo::CodeReview::CustomInstructionsResolver.new(project).execute(merge_request).as_jsonMR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Wanderson Policarpo

