Update DCR prompt to include all diffs in one go

What does this MR do and why?

How to set up and validate locally

Prerequisites:

  • Make sure the AI features are enabled locally using this guide
  • Enable duo_code_review_multi_file feature flag for the user
  • Open a MR with some files where context from multiple files in one-go is relevant such as adding scope in one file and using the wrong scope in another file.
  • Assign GitLabDuo as a reviewer either by commenting /assign_reviewer @GitLabDuo or select GitLabDuo from the reviewers dropdown.

Validate:

  • Make sure GitLabDuo works as expected without duo_code_review_multi_file being enabled.
  • Enable duo_code_review_multi_file and make sure GitLabDuo points out the usage of wrong scope.
  • Make sure there are no unwanted comments from GitLabDuo.

Screenshot

  • Tested a dummy MR where a scope was not defined in the model file and was still used in the controller file. GitLabDuo successfully pointed out the mistake since it did have full MR level context. Screenshot_2025-04-14_at_12.22.59_PM

  • With feature disabled, the GitLabDuo didn't comment on the mistake given it reviewed the files one by one and lacking full MR context Screenshot_2025-04-14_at_12.25.45_PM

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 #532653 (closed)

Edited by Kinshuk Singh

Merge request reports

Loading