Rate gitlab-org/auth/iam'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/auth/iam (74293132), for gitlab-org/gitlab#638927.

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

  • consumer_id: 14281048, the project's consumer for flow 1020378, from .ai-catalog-mapping.json in gitlab-merge-request.
  • scopes: all, so the flow runs on every merge request without waiting for a label. The project's rules (components/agents-and-flows/gitlab-merge-request!130 (merged)) cover every tracked path. all matches whoever the author is, so this includes IAM's Renovate bot, which is a project access token rather than @gitlab-dependency-update-bot.
  • No sample. IAM opens about ten merge requests a day, so its team sees every rating while the rubrics are new. Add sample: <1-99> to cut the volume while a rubric is corrected.
  • low_scopes: all, as asked in review, so gitlab-bot approves each merge request the flow rates low. Nothing approves yet: IAM's rules file is in test mode, and approvals start with the gitlab-merge-request change that sets mode: live in instructions/74293132/.
  • 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, beside bench, which master gained with !4532 (merged). The pilot example there pins its whole entry and expects approval on low ratings, and the project joins risk_projects and the project list through it.

What this leaves alone

  • IAM's own review setup: Duo Code Review, and the independent-approval gate from gitlab-org/auth/review-gate-policy. Nothing approves while IAM's rules file is in test mode, and every label the flow writes carries the test- prefix. How a gitlab-bot approval sits with the independent-approval gate is to settle before the rules go live.
  • gitlab-bot approving on Duo Code Review's behalf in IAM, the approach in !4534 (closed). That MR is closed.

Checked before leaving draft

  • components/agents-and-flows/gitlab-merge-request!130 (merged) is merged and tagged (0.36.0), and the catalog sync created this project's consumer for flow 1020378: 14281048.
  • @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 .ai-catalog-mapping.json from gitlab-merge-request main. CI skips it.

The flow creates each test- label as a project label the first time it writes it. IAM's .gitlab/duo/agent-config.yml (gitlab-org/auth/iam!1144 (merged)) sets only a network_policy, so the flow runs in the default Duo session image, which has the Ruby every step needs, and it can reach the Go module proxy to read Go module bumps.

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. Without AI_CATALOG_MAPPING_PATH, and with no checkout of gitlab-merge-request next to triage-ops, the mapping example is skipped.

🤖 Generated with Claude Code

Edited by Connor Sanders

Merge request reports

Loading
Loading