Rate gitlab-elasticsearch-indexer and container-registry with the MR Risk Labeler, approving low ratings
What does this MR do and why?
Adds gitlab-org/gitlab-elasticsearch-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/2953390/.
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/2953390/. - 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/2953390/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, any gitaly module, the gitlab-code-parser Go bindings, gitlab.com/gitlab-org/go/icu, any aws-sdk-go-v2 module, 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.
Also adds gitlab-org/container-registry
This merge request now carries gitlab-org/container-registry (13831684) as well, moved here from !4618 (closed) at Karan Bhatia's request, so the team has one merge request to review and the two no longer conflict. !4618 (closed) is closed.
The entry is the one from !4618 (closed): approve: true and one flow, mr_risk, with consumer 14549701 from the 0.37.0 catalog sync, scopes: all, low_scopes: all, the automation:prevent-risk-flow exclusion and no sample. Nothing approves until the project's rules say mode: live; components/agents-and-flows/gitlab-merge-request!168 (merged) added them in test mode. Every item on !4618 (closed)'s checklist was ticked there, including the project's Duo sessions having Ruby, and @ai-mr-risk-labeler-gitlab-org is a Developer in the project.
The api-docs and triage-ops pilots are not in this merge request. The api-docs one is not ready to merge yet, and the triage-ops one is waiting for dev-ex sign-off.
Before this is ready
- !4542 (merged) has merged, and this MR targets
master. GitLab retargets it if !4542 (merged)'s branch is deleted when it merges. - 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,
13801291.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-elasticsearch-indexer!982 (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-zoekt-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. This is one of three pilot merge requests, each based on master: this one, gitlab-zoekt-indexer in !4531 (merged), and bench in !4532 (merged), which also drops the deps flow's service account. 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.