Skip to content

Guardrails

gitlab ​

7 guardrails, all at version v1.

GuardrailDefault severityWhat it checks
gitlab/codeowners-catch-allwarningA section that requires approval declares a rule matching every path, so a file nobody thought about still has an owner who must approve it.
gitlab/codeowners-no-unowned-ruleserrorNo rule in CODEOWNERS ends up with no owners, counting the default owners it inherits from its section header, so no section claims a path without naming someone for it.
gitlab/codeowners-owners-per-rulewarningEvery rule in CODEOWNERS ends up with between the minimum and maximum number of owners, counting the default owners it inherits from its section header, so review depends neither on a single person nor on everyone.
gitlab/codeowners-parseserrorEvery line of CODEOWNERS that isn't a comment is either a section header or a rule, so no ownership is silently lost to a line GitLab ignores.
gitlab/codeowners-presentwarningThe project has a CODEOWNERS file in one of the three places GitLab reads it from, and at least one section of it declares a rule, so every change has someone to review it.
gitlab/codeowners-team-ownedwarningEvery rule in CODEOWNERS ends up owned by at least one GitLab group, so ownership survives changes in who is on the team.
gitlab/job-timeout-setinfoEvery job declares how long it may run, so a hung job is cut off rather than holding a runner until the project's own limit.

Shared inputs ​

Every gitlab guardrail declares these inputs. Individual guardrails can add their own.

InputDescriptionDefault
pipelinesComma separated globs naming the GitLab CI files to read..gitlab-ci.yml,.gitlab-ci.yaml

Shared collectors ​

Every gitlab guardrail receives the facts these collectors gather. Individual guardrails can ask for more collectors of their own.

CollectorGathers
gitlabWhat GitLab itself reads out of the repository: the .gitlab-ci.yml, read as GitLab writes it, and the CODEOWNERS file, read as sections of rules. For the pipeline, the stages it declares, what it includes, and for every job the stage it sits in, the image and runner tags it asks for, how long it may run, the rules that decide whether it runs at all, and each script section with the variables it interpolates. For CODEOWNERS, every section with whether it is optional and how many approvals it needs, the rules under each, and the owners that apply to the paths a guardrail asks about, resolved per section the way GitLab resolves them. Names and shapes only, never a secret, a variable value or an environment value.

You configure every guardrail in this category the same way, in the guardrails.checks array of buildnote.json. Configuring guardrails lists every option, and Guardrails lets you search the whole library.

Buildnote Limited
Registered in England and Wales, Reg: 16140412