Apply each pilot project's approval rules in the deps flow

What does this MR do and why?

Part of #29 (Deps rollout, #19). It adds the per-project approval rules each pilot's maintainers asked for, so a low rating can't lead to an approval they didn't agree to. It builds on !91 (merged).

How it works

A new step, approval_rules, runs after the model's answer and before raise_below_one. When a rule applies, or can't be checked, it turns low into medium, with the rule as the note's first reason. The MR is then gitlab-bot::manual-approve from the start. medium and high answers are left alone.

Project Rules
gitlab-org/lab-bench/bench Never approve rust, go, zig, goreleaser, cargo:cargo-zigbuild, docker-cli, aqua:docker/buildx, protoc, buf (#15 note). Patch updates only.
gitlab-org/gitlab-zoekt-indexer Never approve golang or go, or a changed go or toolchain line in any go.mod or go.work (#29 note). Always manual: github.com/sourcegraph/zoekt, gitlab.com/gitlab-org/gitaly/*, github.com/golang-jwt/jwt/v5 (#15 note).
gitlab-org/gitlab-elasticsearch-indexer The same Go rules. Always manual: gitlab.com/gitlab-org/gitaly/*, gitlab.com/gitlab-org/rust/gitlab-code-parser/bindings/go (#15 note), gitlab.com/gitlab-org/go/icu, github.com/aws/aws-sdk-go-v2/* (#15 note).

"Always manual" entries go on the same list as "never approve", since both turn low into medium. A project with no entry gets no rules. A spec checks that every project in the flow's consumers: has an entry.

Matching

  • Never-approve compares whole names, ignoring case, against both the title's dependency and the package in Renovate's table. Either one on the list declines. protoc doesn't match protoc-gen-doc.
  • A path ending in /* also covers its root and every module path under it: gitaly/* covers gitaly/v18, and aws-sdk-go-v2/* covers github.com/aws/aws-sdk-go-v2 itself, where the request signer lives. It doesn't cover gitlab.com/gitlab-org/gitalyctl.
  • Listed modules in go.mod. On the Go projects, a changed line in go.mod or go.work naming a listed module also declines, since bumping one module can move another's require line, and dropping icu's replace line changes what gets built.
  • Patch-only reads the Update column of Renovate's table, found by column name.
  • Title against table. A person may cut a long module path in the title, to its last part (otelgrpc) or to .../otelgrpc, and Renovate may change its case. So this check accepts a table package that ends in /<name>. The never-approve list never uses that suffix match.

Fails closed

The rules count as unchecked, which means medium with the reason, when:

  • the title isn't one Renovate update;
  • the table isn't one row with a package and an update, or names a different package from the title;
  • the title's version isn't on an added line outside a lockfile, because Renovate pushes a few seconds before it rewrites the title and table;
  • the diff tool says it left files out;
  • on the Go projects, a go.mod or go.work diff came back collapsed, too large or empty;
  • mr.json or mr_diff.json can't be read.

The step exits zero on any input. An error in a check, or a file it can't open, raises the tier with the reason in the note. That matters because the executor reports a non-zero exit as success, so a crash would otherwise leave the model's answer to be labelled.

Checked against real merge requests

I ran the step over all 1,210 Renovate MRs on the three pilot repos that still have a diff, on 2026-10-29. Each MR counts as its model answer being low:

Project Stays low Never approved Go version line Patch-only Couldn't check
bench 11 19 23 0
zoekt 106 21 12 555
es-indexer 303 102 22 36
  • The always-manual lists apply to 70 MRs, 53 gitaly and 17 gitlab-code-parser bumps, all named in the title. They move 63 of them to a person; the other 7 already declined on the Go version line.
  • No MR moved a listed module in go.mod without naming it. No aws-sdk-go-v2 bump has opened yet. The 116 github.com/aws/aws-sdk-go bumps that stay low are the v1 SDK, which es-indexer no longer uses.
  • Almost all of zoekt's "couldn't check" MRs are older titles in another format (Update module …, without chore(deps):), plus digest pins (update github.com/sourcegraph/zoekt digest to <sha>). Both go to a person, which is the safe direction.
  • Every MR still labelled low is an ordinary module or tool bump, and none of them names a listed dependency.

Not in this MR

  • Listed tools elsewhere in the diff. The rules read the title, the table, and go.mod and go.work on the Go projects. On bench, a listed tool bumped in another file of the same MR, for example a push that adds a rust bump to .mise.toml, is left to the model. Scanning added lines anchored at the start of a key would catch that; on the data above it changes no outcome. It's worth a follow-up.
  • Shared lockfile list. raise_below_one and this step each have their own lockfile pattern, copied as is.

After merge

The next tag syncs the deps flow to the three pilots. They're all label-only, so a rule shows up as a medium label and a note, never as a withdrawn approval. Approvals stay off until #17's other blockers are done, among them #27: zoekt resets approvals on every push and Renovate pushes to its own MRs (note), so a re-run that keeps the same labels has to re-approve.

How to set up and validate locally

  1. make check
  2. git diff origin/main -- flows/flow.yml is empty.

🤖 Generated with Claude Code

Edited by Connor Sanders

Merge request reports

Loading
Loading