investigating-ci-failures
Fungsinya
Skill ini mengambil satu tes yang gagal atau satu eksekusi CI yang merah dan mencari tahu apakah penyebabnya adalah perubahan Anda, cabang main bersama, atau tes yang tidak stabil. Ditujukan untuk pengembang yang ingin tahu siapa yang perlu bertindak selanjutnya.
Kapan dipakai
- βSaat sebuah tes terus gagal di CI dan Anda ingin tahu apakah tes itu tidak stabil atau memang rusak.
- βSaat seseorang bertanya siapa yang merusak branch main dan Anda memerlukan commit serta penulisnya.
- βSaat Anda ingin tahu kapan kegagalan CI dimulai dan apakah perbaikannya sudah masuk.
Link skill
https://github.com/PostHog/posthog/blob/master/products/engineering_analytics/skills/investigating-ci-failures/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βMengapa tes ini gagal di CI, dan apakah pull request saya yang menyebabkannya atau memang sudah rusak di master?β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Skill mencari catatan kegagalan CI yang tersimpan dan riwayat job, yang menunjukkan setiap commit dan penulisnya. Setelah itu, skill mencocokkan waktu kegagalan dimulai dengan sebuah perubahan dan memeriksa apakah sudah ada perbaikan, tanpa menjalankan ulang CI.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Investigating CI failures
The job: take one failing test or one red run and get to a verdict a developer can act on β yours / trunk-borne / flaky, and when trunk-borne: the culprit SHA, its author, the PR, and whether a fix already landed. Everything below is derivation over data that already exists; you never need to re-run CI to answer.
Two warehouse views are the substrate (both non-materialized β always current, query them freely):
engineering_analytics_ci_failuresβ one row per pytestFAILED <nodeid>line from CI logs, pre-fingerprinted (fingerprint= test id + digit/hex-normalized error). Group byfingerprintto get first/last seen, occurrence count, and branch spread.engineering_analytics_ci_job_historyβ one row per job attempt withconclusionAND commit attribution:head_sha,commit_author_name,commit_message,commit_pr_number(the merged PR that produced the commit, the only PR attribution a master push run has). This is where greens live; the logs are failure-only, so every "when did it turn red / green again" question must come from here, never from the logs.
Copy-ready SQL for every step is in references/investigation-queries.md.
Start wide: what's broken right now
For "what CI failures should I care about right now" (before you have a specific test in hand), the
engineering-analytics-broken-tests MCP tool does the shape classification below across all live
failures at once: it groups the last 2 days of failures by fingerprint and labels each
breaking_master / blocking_merge_queue / novel_burst / potentially_resolved / flaky /
pr_only, most urgent first, plus breaking_master_jobs (default-branch jobs whose latest run is
red). Use it as the triage entry point, then drop into the per-failure workflow below to reach a
culprit. It is the automated counterpart to fingerprinting by hand; the manual queries stay the way
to pin a specific failure to a boundary and author.
blocking_merge_queue is the one shape the manual table below does not cover, because it looks like
a single-branch failure and is not. The merge queue runs the full suite on a gate branch
(trunk-merge/pr-<n>/β¦) carrying master, the PR, and every PR queued ahead of it with overlapping
impacted targets (in practice most of the queue), so a failure there is on a commit that already
passed the PR's own CI: a conflict with what landed or queued in between, or a queue-mate's own
break, not that PR's bug by default. Read it as "this stopped a merge", list what the gate branch
ran (query 8), and diff it against trunk rather than reading the PR alone.
The four failure shapes
Fingerprint the failure first (query 1 in the references), then read its shape β the classification falls out of three columns:
| Shape | Reading | Next step |
|---|---|---|
| 1 branch, any window | That PR's own problem | Read its failure lines; done |
1 trunk-merge/pr-<n>/β¦ gate branch |
Queue-mate, or landed since | Query 8, then diff the gate branch against trunk |
| Many branches, dense burst, hits master | Trunk break (master is/was red) | Boundary query β culprit (below) |
| Many branches, sporadic over days/weeks | Flaky | Corroborate with engineering-analytics-flaky-tests |
Why cross-branch means trunk: PR CI runs the PR merged with master, so one bad master commit fails every concurrently-running PR. A failure appearing on many unrelated branches in a tight window is the signature of a master-merge break, not of those PRs' code. Tell the asker explicitly when their PR is not at fault β that is usually the single most valuable sentence in the answer.
Trunk break β culprit
Run the boundary query (query 2): master-only job history for the failing job, ordered by
created_at. The pattern reads directly:
... success success | failure failure ... failure | success ...
^ first red = the culprit row ^ first green = the fix row
The culprit row carries everything: head_sha, commit_author_name, commit_message (which names
what changed), commit_pr_number. The first-green row
Pertanyaan umum
Apakah skill ini menjalankan ulang job CI?
Tidak. Jawabannya berasal dari data yang sudah ada, sehingga tidak ada yang dijalankan ulang.
Apa yang dianggap sebagai tes yang tidak stabil?
Tes yang gagal pada sebagian eksekusi dan lulus pada yang lain. Skill mengelompokkan kegagalan berulang yang menunjukkan error yang sama.
Bisakah skill ini menemukan siapa yang merusak master?
Bisa. Skill mengidentifikasi commit yang memulai kegagalan, penulisnya, dan pull request asalnya.
Detail
Deskripsi asli dari pembuat
Investigates a specific CI failure to a verdict: whose fault, which commit, who wrote it, and whether it's fixed. Use for "who broke master", "why did this test fail in CI", "is this failure my PR's fault or everyone's", "is this test flaky or actually broken", "when did this failure start". Works from the engineering_analytics warehouse views (engineering_analytics_ci_failures, engineering_analytics_ci_job_history) plus the CI failure logs. Not for aggregate CI health, cost, or merge bottlenecks (use diagnosing-ci-and-merge-bottlenecks) and not for building saved insights (use turning-enginee
repo: PostHog/posthog
Popularitas
- Bintang GitHub
- 41k
- Peringkat
- #6865
- Lisensi
- β
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
depot-ci
41kMembantu agent Anda menyiapkan dan menjalankan alur kerja Depot CI, alternatif GitHub Actions, termasuk memigrasikan alur kerja yang ada dan membaca log eksekusi.
depot-container-builds
41kMembantu agent Anda membangun image Docker di builder jarak jauh Depot, termasuk image multi-platform, pengiriman ke registry, dan perbaikan kegagalan build.
depot-github-runners
41kMembantu agent Anda memindahkan job GitHub Actions ke runner yang dikelola Depot, memilih ukuran dan label runner, serta memecahkan masalah pengaturan runner.
editing-agents-md
41kMembantu agent Anda memutuskan apakah sebuah aturan layak masuk ke berkas AGENTS.md atau CLAUDE.md, dan menulisnya agar tetap dipatuhi tanpa membuat berkas membengkak.
Skill serupa
test-driven-development
311kMengajari agent Anda menulis tes yang gagal dulu, melihatnya gagal, lalu menulis kode terkecil yang lulus, sebelum membangun fitur atau perbaikan apa pun.
verification-before-completion
311kMengajari agent Anda menjalankan pemeriksaan nyata dan membaca keluarannya sebelum menyatakan tugas, perbaikan, atau build sudah selesai atau lulus.
migrate-to-shoehorn
310kMengganti type cast berisiko di file tes Anda dengan pustaka shoehorn, sehingga tes bisa memakai data parsial dan tetap lulus pemeriksaan tipe.