Decline a listed tool keyed anywhere in a bench dependency diff

What does this MR do and why?

Part of #29. This is the follow-up !94 (merged) listed under "Not in this MR". On gitlab-org/lab-bench/bench, approval_rules read the title and Renovate's table only. So a never-approve tool bumped in another file of the same MR, for example a push that adds a rust bump to .mise.toml, was left to the model.

How it works

On bench (tool_keys: true), once the title and table checks pass, the step reads the added lines of the files where mise pins tools and takes each line's first key:

File Line Read as
Any TOML file, such as .mise.toml, mise.toml or .config/mise.toml A key followed by =: rust = { version = "1.98.1", … }, "aqua:docker/buildx" = "0.39.0", 'cargo:cargo-zigbuild' = "0.23.5", indented or not The key
.tool-versions, in any directory A name followed by a version: protoc 36.2 The name
rust-toolchain.toml channel = "1.98.1" rust, because a rust bump on bench changes this line and .mise.toml together (gitlab-org/lab-bench/bench!96 (merged))

If the key is on the never-approve list (the whole name, ignoring case, as for the title), low becomes medium. The note's first reason is Never approved in this project: .mise.toml changes rust.

It reads every TOML file, not only .mise.toml and mise.toml, because mise also reads other config files (.config/mise.toml, mise.local.toml), all of them TOML. It reads nothing else. Outside .tool-versions, a name followed by a space is a command or prose (go test ./...). Outside TOML, key = is code (buf = append(buf, b...)).

These stay low:

  • a listed name inside a longer key: rustfmt, zigmod, "github:pseudomuto/protoc-gen-doc", cargo.binstall
  • a listed name in a value (run = "cd config && buf lint"), in a comment, or as a YAML key (go:)
  • a listed name followed by a space outside .tool-versions: go test ./... in a Makefile, go func() { in Go, prose in Markdown, buf lint in a script, go 1.26.0 in go.mod
  • a key = line outside TOML files: GO = go in a Makefile, buf = append(buf, b...) in Go
  • a removed or unchanged line
  • channel outside rust-toolchain.toml

The scan runs after the title and table checks. An MR whose own dependency is listed keeps the reason it has today, for example Never approved in this project: docker-cli.

Fails closed

On bench, a TOML or .tool-versions diff that comes back collapsed, too large or empty now raises with … did not come back whole, the same way go.mod does on the Go projects. Diffs of other files, lockfiles included, are left to the other rules. incomplete_go_file is now incomplete_file, and takes the files to check. The step still exits zero on any input.

Checked against real merge requests

On 2026-10-30, every bot MR on bench (53, all states) and the 100 most recent on each of zoekt and es-indexer (192 of them still have a diff) were run through reason_for from main and from this branch. Every MR got the same outcome. On bench, the only listed keys in these diffs belong to MRs whose title already names the tool. The diffs are what the MRs hold now, which may differ from what the flow saw when it ran.

Not in this MR

  • The Go projects. zoekt and es-indexer keep tool_keys: false. Turning it on would also decline a golang line in .tool-versions on a module bump. Their Go-version rule points that way, but their maintainers haven't been asked.
  • Other ways to write a pin. A [tools.rust] sub-table with version = … on its own line, a dotted key (rust.version = …), a listed tool under another backend name (core:go, aqua:bufbuild/buf), or a rust-toolchain file without .toml. bench writes none of these.

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