ENGINEERING

Nightly Flake Scorer: Rank Tests by Failure Rate and Auto-Quarantine the Worst

Runs nightly, queries the last 30 days of CI runs from Postgres to compute a per-test flake rate.

CategoryEngineering
Enginesim
Difficultyintermediate
Triggerschedule
Steps5
Setup~15 min

How it runs

The automated pipeline, trigger to output.

  • TriggerNightly schedule fires after CI completes
  • ActionQuery 30-day pass/fail history per testPostgreSQLPostgres
  • LogicCompute flake rate; bucket stable / watchlist / quarantine
  • ActionOpen skip MR for threshold breachesGitHubGitHub
  • OutputWrite ranked scoreboard and watchlist to PostgresPostgreSQLPostgres

What it does

This scheduled job computes a data-driven flake score for every test from your stored CI history, ranks them by intermittent-failure rate, and acts on the worst offenders. Tests above the quarantine threshold get an automatic skip MR; borderline ones go to a watchlist instead of being skipped prematurely.

When to use it

Use it when you already log CI results to a database and want statistics, not vibes, to decide what to quarantine. It catches slow-burn flakes that only fail a few percent of runs and never trip a single-failure alert.

How it works

  1. 1A nightly schedule trigger fires after the day's CI runs complete.
  2. 2A Postgres query aggregates pass/fail counts per test over a rolling 30-day window and computes each test's failure rate.
  3. 3A logic step sorts tests into three buckets: stable, watchlist, and quarantine-threshold breached.
  4. 4For each threshold breach, it opens a GitHub skip MR with the computed flake rate in the description.
  5. 5It writes the watchlist and the full ranked scoreboard back to Postgres for the next run's trend comparison.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect PostgresAny Postgres URL — query, write, migrate.
  2. 2
    Connect GitHubRepos, issues, pull requests, actions.
  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.