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:
- A dependency the application runs against, below 1.0.0, comes out
low. The rubric saysmedium, since a minor release below 1.0 may break. For example, gitlab-org/gitlab-zoekt-indexer!1039 (merged) (github.com/prometheus/client_modelv0.6.3 ingo.mod) came outlowevery time. With approvals on, gitlab-bot would approve it. Rewording the prompt didn't fix it reliably. - The pin rule is too broad. Anything pinned in
.tool-versionswashigh, 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 islowand an added line names a version below 1.0.0, it changes the answer tomedium, and the note's first reason says why. It also raises alowanswer 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.tomlandrust-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
loweven below 1.0.0. The below-1.0 →mediumrule covers only what the application runs against. - A lockfile resolving the same declared range rates
lowonly 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.tomlormise.tomlfollows the other rules. - A CI component or template the pipeline includes rates like a runtime dependency.
- A tool used only to develop, lint or test rates
What it changes
- gitlab-org/gitlab (
flows/flow.yml,approve: true) gets the new prompt but notraise_below_one.- Including a CI component or template now needs a person. For example,
gitlab-org/gitlab!259151(pipeline-common) waslowand is nowmedium. - A dev-only dependency below 1.0 can now be
low. - CI images stay
high.
- Including a CI component or template now needs a person. For example,
- zoekt and es-indexer: a Go module below 1.0 rated
lowbecomesmedium. - 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
lowanswers than withmain's prompt. - The CI images stay
high, among themgitlab-org/gitlab!261992(an Elasticsearch service tag).gitlab-org/gitlab!261642(sentry-cli) andgitlab-org/gitlab!242626(CI templates) go up tohigh. - Two runtime dependencies below 1.0, bumped only in the lockfile, still come out
lowunder both prompts:gitlab-org/gitlab!261927(gitlab-orbit-proto) andgitlab-org/gitlab!260517(httparty). This MR doesn't change that, and gitlab-org/gitlab has noraise_below_oneto 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
lowthe model got wrong is gitlab-org/gitlab-zoekt-indexer!1039 (merged), in all 3 runs, andraise_below_oneraised each one. - Every other miss goes to a person rather than to an approval:
- Two grpc bumps alongside other runtime modules come out
mediumwhere the rubric sayshigh. - Some of bench's dev tools come out
mediumorhighwhere it sayslow. editorconfig-checker getshigh, as bench also pins it in.gitlab-ci-asdf-versions.yml, a CI variables file.
- Two grpc bumps alongside other runtime modules come out
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