Raise a low dependency verdict below 1.0, and narrow the pin rule

What does this MR do and why?

Part of #22 (closed). It's needed before the deps pilots (gitlab-org/lab-bench/bench, gitlab-org/gitlab-zoekt-indexer and gitlab-org/gitlab-elasticsearch-indexer) move to approve: true, where gitlab-bot approves a low dependency bump on its own (#17). Label-only doesn't wait for it.

Checking the deps prompt on the pilots' past Renovate merge requests showed two ways its ratings go wrong:

  1. A dependency the application runs against, below 1.0.0, comes out low. The rubric says medium, since a minor release below 1.0 may break. For example, gitlab-org/gitlab-zoekt-indexer!1039 (merged) (github.com/prometheus/client_model v0.6.3 in go.mod) came out low every time. With approvals on, gitlab-bot would approve it. Rewording the prompt didn't fix it reliably.
  2. The pin rule is too broad. Anything pinned in .tool-versions was high, so lint tools like golangci-lint (gitlab-org/gitlab-zoekt-indexer!1077 (closed)) always needed a person.

What changes

  • A new step in the deps flow, raise_below_one, runs after the model answers. If the answer is low and an added line names a version below 1.0.0, it changes the answer to medium, and the note's first reason says why. It also raises a low answer when a manifest's diff is collapsed, too large or empty, since a version below 1.0.0 in it can't be ruled out. It skips lockfiles and the tool pins in .tool-versions, .mise.toml, mise.toml and rust-toolchain.toml.
  • The shared prompt, src/shared/prompts/classify_dependency_risk.system.md, read by both flows:
    • A tool used only to develop, lint or test rates low even below 1.0.0. The below-1.0 → medium rule covers only what the application runs against.
    • A lockfile resolving the same declared range rates low only for a dependency at 1.0.0 or above.
    • A pinned language, runtime or image version stays high, by tag or digest, including an image a CI job or service runs, whatever the job does. Another tool pinned in .tool-versions, .mise.toml or mise.toml follows the other rules.
    • A CI component or template the pipeline includes rates like a runtime dependency.

What it changes

  • gitlab-org/gitlab (flows/flow.yml, approve: true) gets the new prompt but not raise_below_one.
    • Including a CI component or template now needs a person. For example, gitlab-org/gitlab!259151 (pipeline-common) was low and is now medium.
    • A dev-only dependency below 1.0 can now be low.
    • CI images stay high.
  • zoekt and es-indexer: a Go module below 1.0 rated low becomes medium.
  • bench: dev tools below 1.0, like uv or cargo-zigbuild, can be low. Once approvals are on, bench's own rules (#29: never-approve list, patch-only) still decide which of those gitlab-bot may approve.
  • The pilots are label-only today, so until approvals are on, this changes their labels and notes only.

Checked against real merge requests

All runs are read-only: the classifier on the merge request's diff, with no labels or notes written.

gitlab-org/gitlab, 30 deps merge requests where the rules differ (CI images and variables, CI components and templates, version files, dependencies below 1.0, qa), plus controls:

  • No merge request gets more low answers than with main's prompt.
  • The CI images stay high, among them gitlab-org/gitlab!261992 (an Elasticsearch service tag). gitlab-org/gitlab!261642 (sentry-cli) and gitlab-org/gitlab!242626 (CI templates) go up to high.
  • Two runtime dependencies below 1.0, bumped only in the lockfile, still come out low under both prompts: gitlab-org/gitlab!261927 (gitlab-orbit-proto) and gitlab-org/gitlab!260517 (httparty). This MR doesn't change that, and gitlab-org/gitlab has no raise_below_one to catch it.

The pilots, 37 Renovate merge requests, 3 runs each:

Matches the rubric Wrong low
main's prompt 71 of 96 8
This MR, after raise_below_one 72 of 96 0
  • The only low the model got wrong is gitlab-org/gitlab-zoekt-indexer!1039 (merged), in all 3 runs, and raise_below_one raised each one.
  • Every other miss goes to a person rather than to an approval:
    • Two grpc bumps alongside other runtime modules come out medium where the rubric says high.
    • Some of bench's dev tools come out medium or high where it says low. editorconfig-checker gets high, as bench also pins it in .gitlab-ci-asdf-versions.yml, a CI variables file.

raise_below_one on the pilots' 1,207 Renovate merge requests, if each answer were low:

  • It raises 368 on zoekt and 124 on es-indexer, the same with or without the tool-pin skip.
  • On bench it raises none, where without the skip it would raise the 10 that bump a dev tool below 1.0.
  • None of them has a manifest diff that isn't shown.

How to set up and validate locally

make check

🤖 Generated with Claude Code

Edited by Igor Braga

Merge request reports

Loading
Loading