Rate gitlab-org/cli merge requests against its own rules

What does this MR do and why?

Onboards gitlab-org/cli (project 34675721) to the MR Risk Labeler for gitlab-org/gitlab#638927. These are steps 1 and 2 of the onboarding guide:

  • instructions/34675721/ holds the rules file, a rubric per area and a README;
  • the project joins the gitlab-org consumer in src/mr-risk/flow.yml.erb, and flows/mr-risk.yml is recompiled;
  • the project gets a row in instructions/README.md.

Nothing here approves anything. Until gitlab-org/quality/triage-ops!4539 (merged) lists the project, the flow only runs when someone mentions or assigns @ai-mr-risk-labeler-gitlab-org, and its labels carry the test- prefix.

Areas

Every one of the 1,766 tracked paths on main (73349adf) falls into one of seven areas. This was checked with Manifest.area_for against git ls-files.

Area Paths Floor Files
agents AGENTS.md, CLAUDE.md and the other agents' instruction files, .claude/, .gitlab/duo/, .gitlab-dap-factory.yml, the bundled skills and the remote skill registry high 10
specs *_test.go, testdata/, test/, internal/testing/, internal/git/testing/ 681
auth internal/auth/, internal/oauth2/, internal/config/, internal/dockercredhelper/, the auth and token commands, the commands that print, write or cache a token, and the API client's files that decide where a credential goes high 83
deps go.mod, go.sum, .tool-versions, the commit-lint packages 5
docs docs/source/, docs/demos/, docs/*, every other .md 356
code cmd/glab/, the rest of internal/ 524
tooling .gitlab/, cmd/gen-docs/, scripts/, snap/, the Vale and rumdl config, root dotfiles, Makefile, Dockerfile, lefthook.yml 107

What each rubric turns on:

  • code rates what a revert leaves behind: glab runs with users' tokens and main is tagged weekly. A changed flag, exit code or JSON output field (--output json, --output-format, --jq) is high, because scripts parse them. So is a shared package with callers outside the diff, anything glab writes outside its own files, binarymgr, the dependency firewall, telemetry and glab skills, and an existing command's MCP annotation loosened. Every command carries an annotation, so a new command's is part of the new command.
  • auth has a floor of high. The question there is where a token can end up, and a diff cannot show that. internal/config/ is all of it, since that is where the tokens and the keyring live, and the area also takes config get and set, the cluster agent's token cache, artifactregistry login and get-token, and the API client's redirects, transports and custom headers. keyring_testing.go stays out of specs, because its init() runs in every binary, and internal/git/test_helpers.go goes to code for the same reason.
  • docs rates a generated docs/source/ page by whether it matches the help text beside it. A page edited by hand, or regenerated with no source change, is high. configuration.md's environment variable tables are generated too, and the generator's marker sits in an HTML comment the rater never sees, so the rubric names the generated paths instead.
  • deps rates a Go bump by what the upstream block shows. A hash that does not match, an init or cgo change, or code that fetches or runs other code is high; anything the check could not read is medium; low needs every version to match with nothing in the diff. .tool-versions and commit-lint bumps are medium too, since every pin is installed beside a token, by scripts/bootstrap.sh and by this project's Duo session setup. Credential and crypto modules, github.com/docker/cli and go.yaml.in/yaml/v3 among them, the MCP SDK and the dependency firewall's proxy stay high above a patch bump. testify is linked into glab through internal/git/test_helpers.go, so it is not treated as test-only.
  • tooling rates release, signing and packaging, CODEOWNERS (its gitlab-bot lines decide which bot approvals count), credentials and new images as high. So is GO_VERSION, unless it moves by a patch release beside its .tool-versions pin: the release job builds with it, beside the release token.

Both floors and every tier are proposals for the CLI maintainers to correct. instructions/34675721/README.md gives the ordering.

Checked against recent merges to main

Through the gate's path logic, using Manifest.area_for and Diffs::REFUSED_SUBJECTS, over the project's own-branch and dependency-bot merges. Contributors' forks are left out, because triage-ops does not start the flow on them.

Separately, 100 of the 225 merge requests merged in the last 30 days came from contributors' forks or carried Community contribution, and the flow does not rate those.

Before this does anything

  • Consumer. The tag after this merges creates the project's consumer, and gitlab-org/quality/triage-ops!4539 (merged) then takes its ID.
  • Ruby. This project's Duo session image is debian:bookworm-slim, and the flow's run_command steps run ruby. gitlab-org/cli!4355 (merged) installs Ruby and sets a UTF-8 locale. Until that merges, a run here ends at its first Ruby step.
  • Network. The upstream check needs proxy.golang.org and sum.golang.org from this project's Duo sessions. Where it cannot reach them, Go bumps come out not downloaded and rate medium.
  • Labels. The flow creates each test- label as a project label the first time it writes it. Nothing has to be made by hand.
  • Approval paths. gitlab-bot already approves CLI merge requests when Duo Code Review approves them (triage-ops GitlabCli). This changes nothing there. That path is retired when the project takes approvals from the risk verdict, at step 4.

How to set up and validate locally

make check

spec/mr-risk/instructions_spec.rb holds the manifest to the Manifest the flow runs, resolves every rubric, and checks the index.

🤖 Generated with Claude Code

Edited by Connor Sanders

Merge request reports

Loading
Loading