Migrate Code Review Summary prompt to AIGW

What does this MR do and why?

Migrate code review summary to use AIGW prompt.

Summarize Review prompt was migrate some time ago #495131 (closed), but Duo Code Review still using legacy prompt.

References

Contributes to #501321 (closed)

How to set up and validate locally

  1. In rails console enable the feature flag
    Feature.enable(:prompt_migration_review_merge_request)
  2. From your GDK directory run gdk tail gitlab-ai-gateway to watch AIGW logs
  3. Visit http://gdk.test:3000/gitlab-duo/test/-/merge_requests/1 and request review
  4. GitLab Duo should provide review summary
  5. Logs should show something like (slightly truncated):
2025-06-05_14:28:58.81672 gitlab-ai-gateway       : 2025-06-05 16:28:58 [info     ] Returning prompt from the registry correlation_id=1 prompt_id=summarize_review/base prompt_name='Claude 3.7 Summarize Review' prompt_version=2.0.0

2025-06-05_14:29:02.62132 gitlab-ai-gateway       : 2025-06-05 16:29:02 [info     ] 127.0.0.1:51467 - "POST /v1/prompts/summarize_review HTTP/1.1" 200 client_ip=127.0.0.1 client_port=51467 content_type=application/json correlation_id=1 cpu_s=0.02 duration_request=0.30614709854125977 duration_s=3.824813915998675 enabled-instance-verbose-ai-logs=False enabled_feature_flags= first_chunk_duration_s=3.8247983750188723 gitlab_feature_enabled_by_namespace_ids=1000000 gitlab_feature_enablement_type=duo_enterprise gitlab_global_user_id='' gitlab_host_name=gdk.test gitlab_instance_id=123 gitlab_language_server_version=None gitlab_realm=saas gitlab_saas_duo_pro_namespace_ids=None gitlab_version=18.1.0 http_version=1.1 meta.feature_category=ai_abstraction_layer method=POST path=/v1/prompts/summarize_review status_code=200 url=http://127.0.0.1:5052/v1/prompts/summarize_review user_agent=Ruby

POST /v1/prompts/summarize_review indicates that request went to the prompt endpoint.

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.

Merge request reports

Loading