Initial MR flow

Related to #622605.

What does this MR do?

Introduces a low-risk test flow that determines the required approval path for small, documentation-only merge requests. The flow only applies labels: it does not approve or merge merge requests.

To avoid noise, the flow runs only when its service account is explicitly:

  • Mentioned in a comment.
  • Assigned as a merge request reviewer.

The flow then:

  1. Extracts the target MR IID from the trigger context.
  2. Fetches the MR metadata and diff.
  3. Verifies eligibility using deterministic rules:
    • The MR is open, not a draft, and has the docs-only label.
    • It does not have the Community contribution label.
    • All changes are Markdown files under doc/development/ or doc-locale/.
    • The diff contains 1–10 files, fewer than 10 changed lines, and less than 10 KB of diff text.
    • The returned diff contains fewer than 20 files, and every file is measurable.
    • Paths associated with sensitive legal, pricing, or release subjects are excluded.
  4. Sends eligible diffs to an agent that classifies their impact as low, medium, high, or severe.
  5. Applies one of these label combinations:
    • gitlab-bot::auto-approve and docs-impact::low when the agent classifies the change as low.
    • gitlab-bot::manual-approve and docs-impact::medium when the agent classifies the change as medium.
    • gitlab-bot::manual-approve and docs-impact::high when the agent classifies the change as high.
    • gitlab-bot::manual-approve and docs-impact::severe when the agent classifies the change as severe or returns an invalid result.
  6. Removes labels previously applied by the flow when the MR becomes ineligible or processing fails.
  7. Leaves unrelated MR labels unchanged.

This MR also adds regression tests for the deterministic rules, a live end-to-end test harness, local workflow tooling, and usage documentation.

Edited by Paulo Martins

Merge request reports

Loading
Loading