DEVOPS

Detect GitLab CI cache hit-rate drops and pin the offending commit

Watches GitLab CI pipelines for a sustained drop in build-cache hit rate and, when it crosses a threshold, bisects recent commits to name the config change that caused it…

CategoryDevOps
Enginesim
Difficultyadvanced
Triggerwebhook
Steps6
Setup~25 min

How it runs

The automated pipeline, trigger to output.

  • TriggerGitLab pipeline completed webhookGitLabGitLab
  • ActionParse job logs and compute cache hit rateGitLabGitLab
  • ActionStore sample and load rolling baselinePostgreSQLPostgres
  • LogicHit rate below threshold for N pipelines?
  • ActionRank commits in window touching cache configGitLabGitLab
  • OutputPost suspected culprit commit to SlackSlack

What it does

It tracks the cache hit rate of your GitLab CI build jobs over a rolling window. When the rate falls below your baseline for several consecutive pipelines, it inspects the commits merged in that window, finds the one that touched cache-relevant config (`.gitlab-ci.yml`, lockfiles, Dockerfile, cache keys), and posts the suspected culprit with a diff link to Slack.

When to use it

Use it when CI times creep up and nobody can say why. A changed cache key, a bumped base image, or a reordered install step silently invalidates the cache and adds minutes to every build. This catches the regression within a few pipelines instead of weeks later.

How it works

  1. 1A GitLab pipeline-completion webhook fires after each build pipeline.
  2. 2The flow parses job logs for cache restore/save stats and computes the hit rate.
  3. 3It stores the sample in Postgres and compares the rolling average against the stored baseline.
  4. 4If the rate is below threshold for N consecutive pipelines, it pulls the commits in the regression window from GitLab and ranks those touching cache-relevant files.
  5. 5It posts the top suspect, the affected jobs, and a compare link to Slack.

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
    Connect SlackChannels, DMs, threads, mentions.
  4. 4
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  5. 5
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  6. 6
    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.