Add ability to trigger Duo Code Review automatically
What does this MR do and why?
Add ability to trigger Duo Code Review automatically by enabling it via project setting. DCR would not be executed automatically if the MR status is draft. It will get executed once the MR becomes ready.
There will be a follow up frontend MR for adding the project setting to the UI.
References
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
- Follow these instructions to set up Duo features in your local environment.
- Enable
:ai_review_merge_requestand:duo_code_review_chatFFs - Ensure you have a user with a developer role who has
Duo Enterpriseadd-on - Enable
auto_duo_code_reviewproject setting on the project via Rails console by doing something likeproject.project_setting.update_attribute(:auto_duo_code_review, true) - Create a merge request with some changes as the user
- Observe
@GitLabDuogets added as a reviewer and Duo Code Review gets executed - Create another MR as a
Draft - Observe
@GitLabDuodoesn't gets added as a reviewer - Mark the MR as ready either by clicking
Mark as readyvia UI or/readyvia note quickaction - Observe
@GitLabDuogets added as a reviewer and Duo Code Review gets executed
MR 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.
Related to #506537 (closed)
Edited by Sincheol (David) Kim