Migrate Duo Code Review prompt to AI Gateway (ReviewMergeRequest)
As discussed in &14259 (comment 2081292282), we'd like to migrate the prompt to AIGW.
See https://docs.gitlab.com/development/ai_features/actions/#how-to-migrate-an-existing-action-to-the-ai-gateway for more information on how to migrate a prompt to AIGW.
Proposal: #501321 (comment 2193541092)
Implementation details
Sketching a plan according to steps described in https://docs.gitlab.com/development/ai_features/actions/
- Add your action to the Cloud Connector feature list: Already exists
- Create a prompt definition in the AI gateway (here) MR: gitlab-org/modelops/applied-ml/code-suggestions/ai-assist!2465 (merged)
- Potentially combine Single file and Multi file prompts.
- Create Completions class under
ee/lib/gitlab/llm/ai_gateway/completions/: !191007 (merged) - Create service class: Already exists
- Modify AI feature in the catalogue. Feature exists
- Add AIGW service class: !191007 (merged)
- Create
prompt_migration_review_merge_requestfeature flag: !191007 (merged) - Add a default prompt version query to
ee/lib/gitlab/llm/prompt_versions.rb: !191007 (merged)
Port missing gaps
Port missing gaps between Anthropic and AiGateway classes. Known MRs:
- Log more DCR comments metrics for debugging (!192342 - merged) via !193145 (merged)
- Add Event Tracking for Duo Code Review Responses (!191057 - merged) via !193131 (merged)
- Include unit_primitive in review_merge_request ... (!191895 - merged) via !193002 (merged)
- Add FF to allow all DCR comments to be shown (!191437 - merged) via !193005 (merged)
- Exclude binary files from ai_reviewable_files a... (!191453 - merged) via !193003 (merged)
- Memoize review_bot method (!191452 - merged) via !192999 (merged)
- Updated Duo Code review progress note to not se... (!190978 - merged) via !192999 (merged)
-
Only log error message after retry fails (!190872 - merged)no logs on Rails side
Edited by Vitali Tatarintev