Loading
Skip MR coach assignment for docs-only community MRs when a TW is available
What does this MR do and why?
Improves the @gitlab-bot ready command so it does not assign an MR coach when a community MR is docs-only and a technical writer can be identified automatically via CODEOWNERS.
Problem
When a contributor runs @gitlab-bot ready on a docs-only MR, two reviewers were being assigned:
- A random MR coach (via
CommandMrRequestReview) - A technical writer (via
AutomatedReviewRequestDoc, triggered by theworkflow::ready for reviewlabel)
This caused unnecessary pings and confusion. Real-world example: gitlab-org/gitlab-runner!7146 (merged) where @gitlab-bot ready assigned both @sabadi1 (coach) and @ashrafkhamis (TW).
Solution
In CommandMrRequestReview, before falling back to the random-coach path:
- Docs-only detection: uses the existing
Triage::ChangedFileList#only_change?method with%r{\Adocs?/}to check whether every changed file is underdocs/ordoc/. - TW availability check: calls
Triage::DocumentationCodeOwner#most_specific_approversto confirm a TW would actually be assigned. - Skip coach and skip comment: if both conditions are true, no human-facing comment is posted (the
AutomatedReviewRequestDocprocessor already posts its own comment when it assigns the TW). Only quick actions are posted:/unlabel ~"automation:author-reminded",/ready, and/label ~"workflow::ready for review", soAutomatedReviewRequestDocruns and assigns the TW. - Fallback safety: if the MR is docs-only but no TW approver is found, the coach is still assigned so the MR is never left without a reviewer.
- Explicit reviewers / current reviewers: unaffected — the skip only applies to the random-coach path.
Action items
-
If adding environment variables forreactive processors, updateconfig/triage-web.yamland.gitlab/ci/triage-web.yml -
(If applicable) Add documentation to the handbook pages forTriage Operations=> - (If applicable) Identify the affected groups and how to communicate to them:
-
/cc @person_or_group=> -
Relevant Slack channels => -
Engineering week-in-review
-
Closes #1050 (closed) Related to #1701
Edited by Ben Bodenmiller