Rate gitlab-zoekt-indexer's merge requests with the MR Risk Labeler, approving low ratings
What does this MR do and why?
Adds gitlab-org/gitlab-zoekt-indexer back to the config, rating every merge request with the MR Risk Labeler (mr_risk), and approving the ones it rates low. It ran the MR Dependency Risk Labeler (deps) until !4542 (merged) took it out, ahead of that flow's deletion from the AI Catalog. components/agents-and-flows/gitlab-merge-request!119 (merged) removes the deps flow from components/agents-and-flows/gitlab-merge-request, and rates this project in mr-risk against instructions/46649240/.
approve is true, with scopes: all and low_scopes: all, as asked in review. The flow runs on every merge request, not only the dependency bot's, and gitlab-bot approves each one it rates low. Two things bound that today, and one is left to do:
- One area. The rules cover
depsalone, so only a merge request that stays inside it can rate low. A merge request touching any other path is refused by name, where the flow did not run on it before. - Test mode. The project's rules file does not say
mode: live, and nothing approves on a test-mode rating. Approvals start with the gitlab-merge-request change that setsmode: liveininstructions/46649240/. - Before the rules go live. The
depsarea takes whole files,.gitlab-ci.ymlamong them, and the rubric rates a change there that moves no version low. It was written for the dependency bot's merge requests, so a person's script edit in one of those files could rate low and be approved. The rubric ininstructions/46649240/has to rate such a change above low beforemode: live. Tracked in components/agents-and-flows/gitlab-merge-request#48 (closed).
For the project's maintainers:
- What is read now: a Go module bump is rated by the diff of its two published versions. The check downloads them from proxy.golang.org and holds them to sum.golang.org and go.sum. A
.tool-versionspin and a version in.gitlab-ci.ymlhave no diff to read, so they rate medium. - Your agreed list is at the end of the medium list in
deps.md, as words the rater applies rather than a step. It names golang and go, github.com/sourcegraph/zoekt, any gitaly module, github.com/golang-jwt/jwt/v5, and the go and toolchain lines in go.mod. - What goes: the version-number rubric, and the step that raised a version below 1.0.0. The model rating it is fixed for gitlab-org, as it is for gitlab-org/gitlab.
- Labels:
test-gitlab-bot::auto-approveor::manual-approve,test-gitlab-bot::risk::<tier>,test-deps-risk::<tier>andtest-gitlab-bot::category::project-rules, in place ofgitlab-bot::*,dependency-risk::*andgitlab-bot::category::deps. - Refused by name: a merge request touching any path outside the
depsarea, which a person then reads. A major bump that rewrites import paths in Go source is one.
Before this is ready
- components/agents-and-flows/gitlab-merge-request!119 (merged) is merged and tagged (0.32.0), and the catalog sync created this project's consumer for flow 1020378,
13801290.consumer_idis set to it. -
@ai-mr-risk-labeler-gitlab-orgis a Developer in the project. The sync added it when it created the consumer. - config_spec's mapping example passes with
AI_CATALOG_MAPPING_PATHpointed at the.ai-catalog-mapping.jsonthat 0.32.0's catalog sync wrote tomain, in components/agents-and-flows/gitlab-merge-request@4068b628. It checks thisconsumer_idagainst the mapping, and CI skips it. It fails against the copy in the 0.32.0 tag, which predates the sync. - The flow can reach proxy.golang.org and sum.golang.org. Duo sessions here run in sandbox-runtime with only GitLab's own hosts allowed, the default with no
.gitlab/duo/agent-config.yml. Until the project allows those two hosts, every module isnot downloadedand rates medium. gitlab-org/gitlab-zoekt-indexer!1119 (merged) allows them.
The nine labels the flow writes need nothing by hand. It creates each as a project label the first time it writes it, as it does in gitlab-org/gitlab and the catalogue. To choose their colours, edit them in the project after the first run, rather than creating gitlab-org group labels, which would sit beside gitlab-org/gitlab's project labels of the same names.
Order
- !4542 (merged) takes this project, gitlab-elasticsearch-indexer and bench out of the config, so triage-ops stops starting the deps flow.
- components/agents-and-flows/gitlab-merge-request!119 (merged) merged, and 0.32.0 is tagged. Its catalog sync deleted the deps flow and its consumers, and created this project's
mr_riskconsumer. - This merges with that consumer's ID.
Between steps 1 and 3 the project runs no flow. One of three pilot merge requests, each based on master, with gitlab-elasticsearch-indexer in !4530 (merged) and bench in !4532 (merged). Their spec changes are worded alike, so they conflict only in the list of pilots, and each one that merges after another rebases to keep both entries.
After it merges
- Remove
dependency-risk::*,gitlab-bot::auto-approve,gitlab-bot::manual-approveandgitlab-bot::category::depsfrom the bot merge requests still open with them. Nothing else removes them, and mr-risk adds its own labels beside them on their next push.