Rate gitlab-org/container-registry's merge requests with the MR Risk Labeler, approving low ratings

What does this MR do and why?

Step 3 of onboarding a project to the MR Risk Labeler, for gitlab-org/container-registry (13831684), for gitlab-org/gitlab#638927.

The project is listed with approve: true and one flow, mr_risk:

  • scopes: all, so the flow runs on every merge request without waiting for a label.
  • low_scopes: all, so gitlab-bot approves each merge request the flow rates low. Nothing approves until the project's rules say mode: live; components/agents-and-flows/gitlab-merge-request!168 (merged) added them in test mode.
  • No sample, so the team sees every rating while the rubrics are new. Add sample: <1-99> to cut the volume while a rubric is corrected.
  • excluded_labels: [automation:prevent-risk-flow], the same escape hatch as every other project the flow runs in.

config_spec.rb lists the project in risk_pilots, so the pilot example pins its whole entry.

The work item lists this project for dependency bumps only. The scope is still all, as for every other pilot. As merged in components/agents-and-flows/gitlab-merge-request!168 (merged), the rules keep a low rating to dependency bumps: a deps area over go.mod and go.sum, and an other area over every other path, floored at high.

Draft until its Duo sessions are checked

consumer_id is 14549701, the consumer the catalog sync of gitlab-merge-request 0.37.0 created for this project.

  • components/agents-and-flows/gitlab-merge-request!168 (merged) is merged.
  • A tag that includes it, 0.37.0, is pushed in gitlab-merge-request, and its catalog sync has created this project's consumer for flow 1020378.
  • consumer_id is set to it, in the config and in risk_pilots. It is the number after ItemConsumer/ in the project's entry in gitlab-merge-request's .ai-catalog-mapping.json.
  • The placeholder comment above consumer_id is removed.
  • @ai-mr-risk-labeler-gitlab-org is a Developer in the project. The sync added it when it created the consumer.
  • The mapping example passes with AI_CATALOG_MAPPING_PATH pointed at the new .ai-catalog-mapping.json. CI skips it.
  • The project's Duo sessions can run the flow. Every step is a ruby command, so a session image without Ruby needs it added first, as gitlab-org/cli!4355 (merged) does for CLI.

This touches the same lines as the other open "add a project" merge requests, so whichever merges later needs master merged in.

How to validate locally

SIMPLECOV=0 AI_CATALOG_MAPPING_PATH=../gitlab-merge-request/.ai-catalog-mapping.json \
  bundle exec rspec spec/processor/mr_approval_flow/config_spec.rb

Every example passes, the one that holds each consumer ID to the mapping included.

🤖 Generated with Claude Code

Edited by Connor Sanders

Merge request reports

Loading
Loading