Weekly Buildkite CI health email for engineering leads

Every Monday, your engineering leads get one email with build pass rates, the slowest and most-failing pipelines, and the flakiest tests to fix, all pulled from Buildkite.

Agentic Task
BuildkiteGmailEngineeringAI ReportsEmail AutomationDaily Digests
PromptCreate

Every Monday at 8:00am, run automatically on a cron schedule and email our engineering leads a CI health digest covering the past seven days of activity in Buildkite. The email should be a short, skimmable executive summary of how our continuous integration is doing, with the key numbers first and the ranked detail below. All queries are scoped to our Buildkite organization, so discover the organization slug first if you need it.

First, gather build reliability data. Use Buildkite's List Builds for an Organization operation, filtered to builds from the last seven days (pass the date filter, and branch and state filters if useful), paginating so the counts cover the full window. From those builds compute: total build volume, the pass rate and fail rate, the average build duration, and the slowest builds. Then identify the pipelines and the branches that failed most often over the week. Also pull the previous seven-day window with the same operation so you can report the week-over-week direction of the key metrics.

Next, find likely flaky tests using Buildkite Test Engine. Call List Test Suites to enumerate our suites, then for each suite call List Test Runs to get the recent runs, and for those runs call Get a Test Run's Failed Executions. Aggregate the failed executions across recent runs to spot tests that fail intermittently, meaning they fail in some runs but pass in others, and rank these as our likely flaky offenders. The Buildkite REST API has no single flakiness score, so infer flakiness by counting how often each test appears in failed executions across runs while not failing consistently.

Write a short executive summary at the top of the email. Lead with the headline numbers (build volume, pass and fail rate, average and slowest durations), state the week-over-week direction for the key metrics (are we improving or regressing versus the prior week), and call out the top three things to fix. Keep the tone concise and decision-oriented.

Lay the email out to be skimmable: the key metrics first, then a ranked list of the worst pipelines and branches by failure count, then a ranked list of the flakiest tests. Include links back to Buildkite for the failing pipelines, builds, and tests so leads can click straight through. Finally, send the digest using Gmail's Send a Message operation to our engineering leads, with a clear subject line such as 'Weekly CI health digest' plus the date range.

Additional information

What does this prompt do?
  • Rolls up the past week of Buildkite builds into build volume, pass and fail rates, and average and slowest build times.
  • Ranks the pipelines and branches that failed most often so you can see where reliability is slipping.
  • Flags tests that pass sometimes and fail other times across recent runs as likely flaky offenders, with links to investigate.
  • Emails a short executive summary with the headline numbers, the week-over-week trend, and the top three things to fix.
What do I need to use this?
  • A Buildkite account with recent builds, and Test Engine test suites if you want the flaky-test section.
  • A Gmail account to send the digest from.
  • The email addresses of the engineering leads who should receive it.
How can I customize it?
  • Change the day and time it goes out (the default is Monday at 8am).
  • Swap or add recipients, or point it at a shared team inbox or alias.
  • Adjust the lookback window or limit the metrics to specific pipelines and branches.

Frequently asked questions

How often does the digest go out?
By default it runs every Monday at 8am and covers the previous seven days. You can change it to any day or time you like.
Where do the flaky test rankings come from?
The agent looks across your recent Buildkite Test Engine runs and finds tests that pass in some runs and fail in others, then ranks the worst offenders so your team can prioritize fixes. There is no single flakiness score in Buildkite, so it infers this by aggregating failures across runs.
Can I send it to more than one person?
Yes. Add as many engineering leads as you want, or point it at a shared team inbox or distribution alias.
Will it work if we don't use Buildkite Test Engine?
The build health metrics still work from your regular builds. The flaky test section needs Test Engine test suites to have run data to analyze.
Can I send this to Slack instead of email?
This version emails the digest, but the same summary can be routed to a Slack channel if your team prefers chat.

Stop guessing whether your CI is getting healthier.

Get a clear weekly read on build reliability and flaky tests, written for your team and delivered to their inbox.