ENGINEERING

Page On-Call When a Flaky Test Blocks the GitLab Merge Train

Monitors GitLab merge-train pipeline failures, distinguishes flaky failures from real ones via retry history.

CategoryEngineering
Enginesim
Difficultyadvanced
Triggerwebhook
Steps6
Setup~25 min

How it runs

The automated pipeline, trigger to output.

  • TriggerGitLab merge-train pipeline failsGitLabGitLab
  • ActionInspect job retry history to classify the failureGitLabGitLab
  • LogicBranch: intermittent and train blocked vs. exit
  • ActionPage on-call owner via PagerDutyPagerDutyPagerDuty
  • ActionOpen post-incident tracking ticketLinearLinear
  • OutputPost escalation summary to merge-train SlackSlack

What it does

A flaky test that stalls a merge train blocks everyone behind it, so this workflow treats it as an incident. When a GitLab merge-train pipeline fails, it checks the failing job's retry history to decide if the failure is intermittent. If it is and the train is blocked, it pages the on-call owner via PagerDuty for immediate quarantine and opens a Linear ticket so the fix is tracked after the fire is out.

When to use it

Use this when you run GitLab merge trains and a single flaky test can hold up the whole queue. It escalates fast-moving, high-impact flakes to a human instead of letting them sit in a ticket backlog.

How it works

  1. 1A GitLab webhook fires on a merge-train pipeline failure.
  2. 2The flow inspects the failed job's retry attempts and history to classify flaky vs. real.
  3. 3A branch checks whether the failure is intermittent and the train is currently blocked.
  4. 4If so, PagerDuty pages the on-call owner with the pipeline and job details.
  5. 5A Linear ticket is opened to track the post-incident fix.
  6. 6The merge-train channel in Slack gets the escalation summary.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect GitLabRepos, MRs, pipelines, registry.
  2. 2
    Connect PagerDutyIncidents, on-call, escalations.
  3. 3
    Connect LinearIssues, projects, cycles, triage.
  4. 4
    Connect SlackChannels, DMs, threads, mentions.
  5. 5
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  6. 6
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  7. 7
    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.