Rate the AI Gateway's merge requests with the MR Risk Labeler

What does this MR do and why?

This is step 3 of onboarding the AI Gateway (39903947) to the MR Risk Labeler, for the pilot issue. It adds the project with approve: false, so the labeler rates and labels merge requests but nothing gets approved yet. Approvals come in !4599 (merged).

The flow runs on every merge request (scopes: all) with no sample. The AI Gateway's rules from gitlab-merge-request!120 only rate model-selection changes and refuse everything else before calling a model, so the volume stays small. It has the same automation:prevent-risk-flow escape hatch as every other project.

config_spec.rb adds the project and runs the existing escape-hatch and no-approval checks over it. This and !4530 (merged) both edit the pilot list there, so whichever merges second needs a small rebase.

Nothing is left to set up. The catalog sync created the consumer (13801288) and added ai-mr-risk-labeler-gitlab-org to the project as a Developer.

How to validate locally

SIMPLECOV=0 bundle exec rspec spec/processor/mr_approval_flow/config_spec.rb

The mapping check only runs when AI_CATALOG_MAPPING_PATH points at .ai-catalog-mapping.json on gitlab-merge-request's main. The copy in the 0.32.0 tag is older and fails.

Edited by Nathan Weinshenker

Merge request reports

Loading
Loading