Rate bench's merge requests with the MR Risk Labeler, approving low ratings

What does this MR do and why?

Adds gitlab-org/lab-bench/bench back to the config, rating every merge request with the MR Risk Labeler (mr_risk), and approving the ones it rates low. It ran the MR Dependency Risk Labeler (deps) until !4542 (merged) took it out, ahead of that flow's deletion from the AI Catalog. components/agents-and-flows/gitlab-merge-request!119 (merged) removes the deps flow from components/agents-and-flows/gitlab-merge-request, and rates this project in mr-risk against instructions/79536050/.

approve is true, with scopes: all and low_scopes: all, as asked in review. The flow runs on every merge request, not only the dependency bot's, and gitlab-bot approves each one it rates low. Two things bound that today, and one is left to do:

  • One area. The rules cover deps alone, and every bump in it rates medium today, so nothing rates low yet. A merge request touching any other path is refused by name, where the flow did not run on it before.
  • Test mode. The project's rules file does not say mode: live, and nothing approves on a test-mode rating. Approvals start with the gitlab-merge-request change that sets mode: live in instructions/79536050/.
  • Before the rules go live. The deps area takes whole files, .gitlab-ci.yml among them, and the rubric was written for the dependency bot's merge requests. It rates code a change adds to those files high, but a change that only removes or alters lines there, such as deleting a CI job, moves no version, so it could rate low and be approved. The rubric in instructions/79536050/ has to rate such a change above low before mode: live. Tracked in components/agents-and-flows/gitlab-merge-request#48 (closed).

For the project's maintainers:

  • What is read now: none of bench's bumps. The check has no diff to show for a Cargo crate, a mise or asdf tool, the common-ci-tasks ref or the base image, so every bump rates medium and a person reads it.
  • Your agreed list is at the end of the medium list in deps.md, as words the rater applies rather than a step. It names rust, go, zig, goreleaser, cargo-zigbuild, docker-cli, docker/buildx, protoc and buf, and asks for anything but a patch update.
  • What goes: the version-number rubric, and the step that raised a version below 1.0.0. The model rating it is fixed for gitlab-org, as it is for gitlab-org/gitlab.
  • Labels: test-gitlab-bot::auto-approve or ::manual-approve, test-gitlab-bot::risk::<tier>, test-deps-risk::<tier> and test-gitlab-bot::category::project-rules, in place of gitlab-bot::*, dependency-risk::* and gitlab-bot::category::deps.
  • Refused by name: a merge request touching any path outside the deps area, which a person then reads.

Before this is ready

  • components/agents-and-flows/gitlab-merge-request!119 (merged) is merged and tagged (0.32.0), and the catalog sync created this project's consumer for flow 1020378, 13801289. consumer_id is set to it.
  • @ai-mr-risk-labeler-gitlab-org is a Developer in the project. The sync added it when it created the consumer.
  • config_spec's mapping example passes with AI_CATALOG_MAPPING_PATH pointed at the .ai-catalog-mapping.json that 0.32.0's catalog sync wrote to main, in components/agents-and-flows/gitlab-merge-request@4068b628. It checks this consumer_id against the mapping, and CI skips it. It fails against the copy in the 0.32.0 tag, which predates the sync.

The nine labels the flow writes need nothing by hand. It creates each as a project label the first time it writes it, as it does in gitlab-org/gitlab and the catalogue. To choose their colours, edit them in the project after the first run, rather than creating gitlab-org group labels, which would sit beside gitlab-org/gitlab's project labels of the same names.

Order

  1. !4542 (merged) takes this project, gitlab-zoekt-indexer and gitlab-elasticsearch-indexer out of the config, so triage-ops stops starting the deps flow.
  2. components/agents-and-flows/gitlab-merge-request!119 (merged) merged, and 0.32.0 is tagged. Its catalog sync deleted the deps flow and its consumers, and created this project's mr_risk consumer.
  3. This merges with that consumer's ID.

Between steps 1 and 3 the project runs no flow. One of three pilot merge requests, each based on master, with gitlab-elasticsearch-indexer in !4530 (merged) and gitlab-zoekt-indexer in !4531 (merged). Their spec changes are worded alike, so they conflict only in the list of pilots, and each one that merges after another rebases to keep both entries. With no project left on the deps flow, which 0.32.0 deleted from the AI Catalog, it also removes deps: ai-mr-dependency-risk-labeler-gitlab-org from the gitlab-org service accounts, and flows/deps.yml from the spec's mapping paths.

After it merges

  • Remove dependency-risk::*, gitlab-bot::auto-approve, gitlab-bot::manual-approve and gitlab-bot::category::deps from the bot merge requests still open with them. Nothing else removes them, and mr-risk adds its own labels beside them on their next push.

🤖 Generated with Claude Code

Edited by Connor Sanders

Merge request reports

Loading
Loading