Add MR title and description to duo code review prompt
What does this MR do and why?
- This MR adds MR title and description to duo code review prompt
- I ran a bunch of tests on LangSmith with MR title and description and the results appear positive so far.
LangSmith tests summary using the latest Claude 3.7 model
Test Case 1 (Security-Related Change):
- Link: https://smith.langchain.com/public/53f76cdb-70fd-404d-93c0-e87e4b2da784/r
- Understood why the code was changed and didn't complain about removed code
- Found real problems while respecting the purpose of the changes
- Correctly marked which issues were important and which were just suggestions
Test case 2 (Intentional Code Removal):
- Link: https://smith.langchain.com/public/7b7fff9e-bc4a-4943-ad03-9b3e3ba4b754/r
- The AI understood why the code was changed and didn't complain about removed code
- Found a real improvement while respecting the purpose of the changes
Test case 3 (Refactoring with Intentional Changes):
- Link: https://smith.langchain.com/public/e3ef2404-e29f-4c2b-9fea-d71479dbe729/r
- The AI understood why the code was changed and didn't complain about the major refactoring
- Found real problems while respecting the purpose of the changes
Test case 4 (Enterprise SSO Integration with Complex Description):
- Link: https://smith.langchain.com/public/cb8e9e05-f324-4f07-ba42-de6241d8a47a/r
- AI effectively focused on code despite extremely lengthy description with non-essential elements
- Identified critical security issues in SAML parsing and authentication state verification
- Found practical edge case and error handling issues
- Provided specific, actionable fixes with appropriate priority levels
How to set up and validate locally
Prerequisites:
- Make sure the AI features are enabled locally using this guide
- Open a MR (please add informative title and description) with some files being removed / refactored and assign
GitLabDuoas a reviewer either by commenting/assign_reviewer @GitLabDuoor selectGitLabDuofrom the reviewers dropdown.
Validate:
-
Make sure GitLabDuodoesn't comment on obvious removal of outdated files. -
Make sure there are no unwanted comments from GitLabDuo.
Screenshot
-
Tested a dummy MR where a bunch of files were removed and a new file was added with wrong code. GitLabDuodidn't comment about removal of files since the reasoning was provided in the title and description and successfully pointed out the mistake in the code
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 #466684 (closed)
Edited by Kinshuk Singh (PTO June 4-19)
