ENGINEERING

GitLab MR coverage-regression gate and labeler

Compares an MR's project coverage percentage against the target branch baseline and, when coverage drops beyond a threshold, applies a coverage-regression label and posts…

CategoryEngineering
Enginesim
Difficultyintermediate
Triggerwebhook
Steps6
Setup~15 min

How it runs

The automated pipeline, trigger to output.

  • TriggerGitLab MR pipeline succeedsGitLabGitLab
  • ActionRead MR total coverageGitLabGitLab
  • ActionLook up target-branch baselinePostgreSQLPostgres
  • LogicCompare delta vs threshold
  • ActionAdd or clear regression labelGitLabGitLab
  • OutputUpsert new branch baselinePostgreSQLPostgres

What it does

This workflow reads the total coverage percentage produced by a merge request pipeline and compares it to the most recent coverage recorded on the target branch. If the MR lowers coverage by more than your allowed delta, it labels the MR `coverage-regression` and posts a note explaining the drop; if it improves or holds, it clears the label.

When to use it

Use it when you enforce a coverage ratchet and want a visible, queryable signal on MRs rather than a hard pipeline failure. The label lets you filter the MR board and configure GitLab merge rules around it without editing CI scripts per project.

How it works

  1. 1A GitLab MR pipeline-success webhook triggers the flow.
  2. 2It reads the MR's total coverage from the GitLab pipeline coverage field.
  3. 3It looks up the stored baseline coverage for the target branch in Postgres.
  4. 4A logic step computes the delta against the allowed threshold.
  5. 5On a regression it adds the `coverage-regression` label and posts a note; otherwise it removes the label.
  6. 6It upserts the new branch baseline into Postgres for the next comparison.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect GitLabRepos, MRs, pipelines, registry.
  2. 2
    Connect PostgresAny Postgres URL — query, write, migrate.
  3. 3
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  4. 4
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  5. 5
    Test, then turn it onRun once against a sample, confirm the output, then enable the trigger.

Run this workflow in your colony.

14-day trial. No DevOps. No Sales call. Provisioned in under a minute.