Allow gitlab-bot to approve spec-only merge requests

What does this MR do and why?

Adds @gitlab-bot as a code owner of /spec/ and /ee/spec/ in the [Maintainers] section, so its automated approval counts towards that rule.

Triage-ops' ApproveOnVerdict processor approves merge requests labelled gitlab-botauto-approve as gitlab-bot, on the basis that they need no human review. That approval landed only on the All Members any-approver rule, which requires zero approvals, so it changed nothing. The merge request stayed blocked on the /spec/ code owner rule, where gitlab-bot was not an eligible approver, and a human maintainer still had to click approve.

!259703 (merged) is an example. It changes a single file, spec/models/deploy_token_spec.rb:

Rule Type Required Approved
All Members any_approver 0 yes, by gitlab-bot
/spec/ code_owner 1 no, 164 eligible approvers, gitlab-bot not among them

Scope

Only the two lines are changed. A single fallback entry would not have worked: within a CODEOWNERS section only the last matching pattern applies, so * does not cover files owned by a more specific pattern.

Deliberately left alone:

  • /spec/views/ and /ee/spec/views/, which are also owned by @gitlab-org/maintainers/frontend.
  • /spec/tooling/, which sits in ^[Tooling]. The ^ marks the section optional, so it never blocks a merge.
  • Every other section, including [Database], [Application Security], [Authorization], [Authentication], [Compliance] and [Identity Verification]. These still require a human approver.

This does not cover every spec file. A spec matching a later, more specific pattern in [Maintainers], or one owned by a different required section such as [Database], still routes to that owner. Auto-approve will clear plain spec/ and ee/spec/ changes, but not, for example, a migration spec.

References

Screenshots or screen recordings

Not applicable. This change has no UI.

How to set up and validate locally

Not reproducible locally. Code owner approval rules are evaluated by GitLab.com against the target branch's CODEOWNERS file, so this can only be verified once merged, by checking that the next gitlab-botauto-approve merge request touching spec/ satisfies its /spec/ rule.

Reviewers can confirm the current behaviour on !259703 (merged):

glab api "projects/gitlab-org%2Fgitlab/merge_requests/259703/approval_state"

The /spec/ rule reports "approved": false with gitlab-bot absent from eligible_approvers.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

No changelog entry: CODEOWNERS is repository tooling and is not user-facing. No tests or documentation updates apply, as CODEOWNERS has no test harness in this repository and no documented behaviour changes.

Edited by Karan Bhatia

Merge request reports

Loading
Loading