Skip to content

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

#506537 (closed)

Screenshots or screen recordings

Before After

How to set up and validate locally

  1. Follow these instructions to set up Duo features in your local environment.
  2. Enable :ai_review_merge_request and :duo_code_review_chat FFs
  3. Ensure you have a user with a developer role who has Duo Enterprise add-on
  4. Enable auto_duo_code_review project setting on the project via Rails console by doing something like project.project_setting.update_attribute(:auto_duo_code_review, true)
  5. Create a merge request with some changes as the user
  6. Observe @GitLabDuo gets added as a reviewer and Duo Code Review gets executed
  7. Create another MR as a Draft
  8. Observe @GitLabDuo doesn't gets added as a reviewer
  9. Mark the MR as ready either by clicking Mark as ready via UI or /ready via note quickaction
  10. Observe @GitLabDuo gets 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

Merge request reports

Loading