Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(engineering-analytics): pare back overview and test health (#74263)

Raúl Negrón-Oterofb7ce3b29066
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index 48f3a6216a46..e28a4e2bc372 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -5847,21 +5847,17 @@ snapshots:
scenes-app-discussions--threads--light:
hash: v1.k794b7964.28ac830bf83be5cbb6d7a397d67c9b9c61711904a822de38402b82220b0f7a49.7wENY7hvo1-qAJwq5fcsvKGJsfRAF_vDkpnM8iqFZcc
scenes-app-engineering-analytics-repo-overview--repo-overview--dark:
- hash: v1.k794b7964.2f6a03768f7fd744209d68ad0d4ed30f8f13e6457c005caee001711bce72559a.wGhGJXZVT2RMHTY1nYDEsKOe8gs15i8OKJTOiHy6M2A
+ hash: v1.k794b7964.e9d318d698bc28adcb595d2777160017c2d7b891c6fbecc16b2fec2c380f0534.4C0Kv7dgxXX6anYHBO-NKS2RvwhJt52I22zkzxM-MZ0
scenes-app-engineering-analytics-repo-overview--repo-overview--light:
- hash: v1.k794b7964.fa63ebe5edc3d998537561d334db2ca368d4f68a6eb62ae51d05f005af379311.n3sBaR2EfJiLyoFcIhsp_z4thfRlGElFns_X7qaNQII
- scenes-app-engineering-analytics-repo-overview--repo-overview-failing--dark:
- hash: v1.k794b7964.0fe8332bfa26e030a0ff01303d1fcce2c57442e90e979ef0b7aa42530720119a.G2CN2Y5L8tUETotqOpviY8y6o9IAWJHCzYs9xYRc1Mw
- scenes-app-engineering-analytics-repo-overview--repo-overview-failing--light:
- hash: v1.k794b7964.4e1ed6c540fca8e95dad14c8d479a3ffc5b8a0eec6083ddddeed1e2ceabfe5b6.UC2p5Di8xVfGABNMYuqx6WqTIf5fC3pr8WsFSlB0J5o
+ hash: v1.k794b7964.71bf30defa9c6821564b7c1b2406818b8cd34ba465b29f5c9aa58932c34317a0.5l4d1N7wInmykrgxNe2hT--AlLXmygTtADyOBC9MMuE
scenes-app-engineering-analytics-run-activity-chart--default--dark:
hash: v1.k794b7964.7f17c5ac7c6862493f7c4d59e6e3c3146c42e3d7b08908ee1716d387c129ba64.lPsE9KrOSZee9wJq8zjqYnvk09numvEFWOn4mdCOgJE
scenes-app-engineering-analytics-run-activity-chart--default--light:
hash: v1.k794b7964.f63752ff3ebf3bbee3be4ddc83d1ff657d9cdd11ee71e7283c30ce5a1aefde72.yTb8kpRqcG51TbM2CqgRmC5YvgE7-6pV1Trc7y5wuto
scenes-app-engineering-analytics-test-health--flaky-test-leaderboard--dark:
- hash: v1.k794b7964.c98cc471c1295d40d038bf9c6a736938a5ec83a8a234c097d6ade53af5030e6b.Iw4Vnxse9g4724P6L0DE6v4VMaIK5iSA4Ff5qrn7QNY
+ hash: v1.k794b7964.08e498898aa4436459dfa3b9afcb743d9ef5bddef4b887544a7dd5ada869a319.SuwJaPoLme6T0CusTJ4qMfeL8ieOiczYKySe06STXhQ
scenes-app-engineering-analytics-test-health--flaky-test-leaderboard--light:
- hash: v1.k794b7964.49559d09c657cd6bebf3727cacf099920163509135d94e6bec2083d985b660cd.olM5jO2nt6jwnO34JFgHbesl3JNJblIFf03bx7WUY7s
+ hash: v1.k794b7964.b241a075f9538da83fab55dfb1af54896ec9c6f43cfc3db4d374fcedef606777.0UlzoD6n70FR5PA_Lj8S8L4xtah1AqdGsy9VrKZQ5is
scenes-app-error-project-unavailable--access-revoked--dark:
hash: v1.k794b7964.30ace8f015100159e1dedbed07ff9f0b0b770535870d5c98ea764b10ff1f7621.dTVw9qLa7D_e7ZNme4tVuPZov-0Gg1o84aiDl5zihF0
scenes-app-error-project-unavailable--access-revoked--light:
diff --git a/products/engineering_analytics/frontend/components/BrokenTestStateTag.tsx b/products/engineering_analytics/frontend/components/BrokenTestStateTag.tsx
deleted file mode 100644
index e33a512c9af3..000000000000
--- a/products/engineering_analytics/frontend/components/BrokenTestStateTag.tsx
+++ /dev/null
@@ -1,27 +0,0 @@
-import { IconCheckCircle, IconInfo, IconWarning, IconWrench } from '@posthog/icons'
-import { LemonTag, LemonTagType } from '@posthog/lemon-ui'
-
-import { BrokenTestState } from '../scenes/engineeringAnalyticsLogic'
-
-// PROTOTYPE: mirrors PullRequestStateTag's shape — a state→config map rendered as a LemonTag.
-const STATE_CONFIG: Record<BrokenTestState, { label: string; type: LemonTagType; icon: JSX.Element }> = {
- breaking_master: { label: 'Breaking master', type: 'danger', icon: <IconWarning /> },
- novel_burst: { label: 'Novel burst', type: 'warning', icon: <IconWarning /> },
- potentially_resolved: { label: 'Maybe resolved', type: 'success', icon: <IconCheckCircle /> },
- flaky: { label: 'Flaky', type: 'muted', icon: <IconWrench /> },
- pr_only: { label: 'PR-only', type: 'default', icon: <IconInfo /> },
-}
-
-export function BrokenTestStateTag({ state }: { state: BrokenTestState }): JSX.Element {
- // Fall back to a muted tag of the raw value if a state ever lands outside the enum.
- const { label, type, icon } = STATE_CONFIG[state] ?? {
- label: state,
- type: 'muted' as LemonTagType,
- icon: <IconInfo />,
- }
- return (
- <LemonTag type={type} icon={icon}>
- {label}
- </LemonTag>
- )
-}
diff --git a/products/engineering_analytics/frontend/components/PushHistorySparkline.tsx b/products/engineering_analytics/frontend/components/PushHistorySparkline.tsx
index 4dd6365efd97..535d06f47712 100644
--- a/products/engineering_analytics/frontend/components/PushHistorySparkline.tsx
+++ b/products/engineering_analytics/frontend/components/PushHistorySparkline.tsx
@@ -76,7 +76,6 @@ export function PushHistorySparkline({
height={barHeight}
fill={pushRoundColor(round)}
fillOpacity={round.failed ? 1 : round.pending ? 0.9 : 0.55}
- className={cn(round.pending && 'animate-pulse')}
/>
{/* Full-height transparent hit area so hovering a short bar still shows its title. */}
<rect x={offset + i} y={0} width={1} height={VIEW_HEIGHT} fill="transparent">
diff --git a/products/engineering_analytics/frontend/components/Section.tsx b/products/engineering_analytics/frontend/components/Section.tsx
index 5f4e02e45397..8f88c45c438d 100644
--- a/products/engineering_analytics/frontend/components/Section.tsx
+++ b/products/engineering_analytics/frontend/components/Section.tsx
@@ -10,10 +10,6 @@ function sectionDomId(id: string): string {
return `ea-section-${id}`
}
-export function scrollToSection(id: string): void {
- document.getElementById(sectionDomId(id))?.scrollIntoView({ behavior: 'smooth', block: 'start' })
-}
-
export function Section({
id,
title,
diff --git a/products/engineering_analytics/frontend/components/StatCard.tsx b/products/engineering_analytics/frontend/components/StatCard.tsx
index 224fe6389718..b19355e02a6a 100644
--- a/products/engineering_analytics/frontend/components/StatCard.tsx
+++ b/products/engineering_analytics/frontend/components/StatCard.tsx
@@ -8,8 +8,8 @@ import { humanFriendlyNumber } from 'lib/utils/numbers'
export type StatTone = 'default' | 'danger' | 'warning' | 'success'
/** A compact right-now count: number over a small label, colored only when it's a pressure. Optionally
- * doubles as a filter toggle (onClick + active) — the compact sibling of StatCard, shared by the hub
- * hero and the PR list strip so both read the same. */
+ * doubles as a filter toggle (onClick + active) — the compact sibling of StatCard, used by the PR
+ * list's stat strip. */
export function HeroStat({
label,
value,
@@ -23,7 +23,7 @@ export function HeroStat({
label: string
value: number | null | undefined
tone?: StatTone
- /** 'end' in the hub hero's right cluster; 'start' in the PR list's left strip. */
+ /** Horizontal alignment of the number/label stack; the PR list's left strip uses 'start'. */
align?: 'start' | 'end'
loading?: boolean
onClick?: () => void
diff --git a/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsAuthorScene.tsx b/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsAuthorScene.tsx
index b756ec218c07..0e3bbd66a11a 100644
--- a/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsAuthorScene.tsx
+++ b/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsAuthorScene.tsx
@@ -70,7 +70,7 @@ export function EngineeringAnalyticsAuthorScene(): JSX.Element {
const singleRepo = repoSlugs.length === 1 ? prs[0] : null
return (
- <SceneContent>
+ <SceneContent className="pb-16">
<SceneTitleSection name="Author" resourceType={{ type: 'health' }} />
<ScopeBar
repoSlot={
diff --git a/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsScene.tsx b/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsScene.tsx
index 05295a462d57..577caf909b09 100644
--- a/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsScene.tsx
+++ b/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsScene.tsx
@@ -74,7 +74,7 @@ export function EngineeringAnalyticsScene(): JSX.Element {
return (
<BindLogic logic={engineeringAnalyticsLogic} props={{}}>
- <SceneContent>
+ <SceneContent className="pb-16">
<SceneTitleSection
name="Engineering analytics"
description={VIEW_DESCRIPTIONS[activeView]}
diff --git a/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsTeamScene.tsx b/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsTeamScene.tsx
index 86833b6dae1d..ab07ca311c6c 100644
--- a/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsTeamScene.tsx
+++ b/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsTeamScene.tsx
@@ -81,7 +81,7 @@ export function EngineeringAnalyticsTeamScene(): JSX.Element {
]
return (
- <SceneContent>
+ <SceneContent className="pb-16">
<SceneTitleSection name="Team CI health" resourceType={{ type: 'health' }} />
<div className="flex items-start justify-between gap-3">
<EntityHeader
diff --git a/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsTestHealth.stories.tsx b/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsTestHealth.stories.tsx
index 60efaffcb07b..717813379e9b 100644
--- a/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsTestHealth.stories.tsx
+++ b/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsTestHealth.stories.tsx
@@ -6,15 +6,7 @@ import { urls } from 'scenes/urls'
import { mswDecorator } from '~/mocks/browser'
-import type {
- BrokenTestsResultApi,
- FlakyTestListApi,
- GitHubSourceApi,
- QuarantineFileApi,
-} from '../generated/api.schemas'
-
-// A fixed 24-slot hourly sparkline (oldest first) with the given recent tail — mirrors the endpoint's trend_24h.
-const spark = (tail: number[]): number[] => [...new Array(24 - tail.length).fill(0), ...tail]
+import type { FlakyTestListApi, GitHubSourceApi, QuarantineFileApi } from '../generated/api.schemas'
const FLAKY_TESTS: FlakyTestListApi = {
items: [
@@ -95,79 +87,6 @@ const QUARANTINE: QuarantineFileApi = {
generated_at: '2026-07-02T12:00:00Z',
}
-const BROKEN_TESTS: BrokenTestsResultApi = {
- rows: [
- {
- fingerprint: 'products/checkout/test_flow.py::test_checkout | assert N == N',
- test_id: 'products/checkout/test_flow.py::test_checkout',
- error_signature: 'AssertionError: expected 200, got 500',
- job_name: 'Django tests – Core (12/22)',
- repo: 'PostHog/posthog',
- state: 'breaking_master',
- first_seen: '2026-06-30T08:00:00Z',
- last_seen: '2026-07-02T11:40:00Z',
- occurrences: 41,
- branches: 5,
- master_hits: 6,
- latest_run_id: 9001,
- latest_branch: 'master',
- trend_24h: spark([1, 3, 6, 8]),
- },
- {
- fingerprint: 'posthog/api/test_serializer.py::test_contract | KeyError: N',
- test_id: 'posthog/api/test_serializer.py::test_contract',
- error_signature: 'KeyError: managed_viewset',
- job_name: 'Django tests – Core (4/22)',
- repo: 'PostHog/posthog',
- state: 'novel_burst',
- first_seen: '2026-07-02T05:00:00Z',
- last_seen: '2026-07-02T11:50:00Z',
- occurrences: 9,
- branches: 4,
- master_hits: 0,
- latest_run_id: 9002,
- latest_branch: 'feat/data-catalog',
- trend_24h: spark([2, 7]),
- },
- {
- fingerprint: 'posthog/temporal/test_async.py::test_race | ConnectionResetError',
- test_id: 'posthog/temporal/test_async.py::test_race',
- error_signature: 'ConnectionResetError',
- job_name: 'Playwright (2/8)',
- repo: 'PostHog/posthog',
- state: 'flaky',
- first_seen: '2026-06-28T14:00:00Z',
- last_seen: '2026-07-02T10:00:00Z',
- occurrences: 7,
- branches: 3,
- master_hits: 0,
- latest_run_id: 9004,
- latest_branch: 'fix/async-teardown',
- trend_24h: spark([1, 0, 1, 0, 0, 1]),
- },
- {
- fingerprint: 'posthog/flags/test_rollout.py::test_flag | Timeout',
- test_id: 'posthog/flags/test_rollout.py::test_flag',
- error_signature: 'Timeout waiting for flag',
- job_name: 'Frontend CI (3/6)',
- repo: 'PostHog/posthog',
- state: 'potentially_resolved',
- first_seen: '2026-06-29T09:00:00Z',
- last_seen: '2026-07-02T04:00:00Z',
- occurrences: 12,
- branches: 3,
- master_hits: 2,
- latest_run_id: 9003,
- latest_branch: 'master',
- trend_24h: spark([]),
- },
- ],
- breaking_master_jobs: ['Django tests – Core (12/22)'],
- window_days: 2,
- truncated: false,
- limit: 200,
-}
-
const SOURCES: GitHubSourceApi[] = [{ id: 'src-1', repo: 'PostHog/posthog', prefix: '' }]
const meta: Meta = {
@@ -187,7 +106,6 @@ const meta: Meta = {
mswDecorator({
get: {
'api/projects/:team_id/engineering_analytics/flaky_tests/': FLAKY_TESTS,
- 'api/projects/:team_id/engineering_analytics/broken_tests/': BROKEN_TESTS,
'api/projects/:team_id/engineering_analytics/quarantine/': QUARANTINE,
'api/projects/:team_id/engineering_analytics/sources/': SOURCES,
'api/projects/:team_id/engineering_analytics/ci_cards/': {
diff --git a/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsTestHealth.tsx b/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsTestHealth.tsx
index b7058ef958ed..5bbdc7503cca 100644
--- a/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsTestHealth.tsx
+++ b/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsTestHealth.tsx
@@ -10,8 +10,6 @@ import {
LemonMenu,
LemonSegmentedButton,
LemonSelect,
- LemonSkeleton,
- LemonSwitch,
LemonTable,
LemonTableColumns,
LemonTag,
@@ -20,19 +18,16 @@ import {
Tooltip,
} from '@posthog/lemon-ui'
-import { Sparkline } from 'lib/components/Sparkline'
import { dayjs } from 'lib/dayjs'
import { cn } from 'lib/utils/css-classes'
import { humanFriendlyNumber } from 'lib/utils/numbers'
import { pluralize } from 'lib/utils/strings'
-import { BrokenTestStateTag } from '../components/BrokenTestStateTag'
import { ConnectGitHubSource } from '../components/ConnectGitHubSource'
import { QuarantineTestModal } from '../components/QuarantineTestModal'
import { ScopeBar, SourceScopeChip } from '../components/ScopeBar'
import { StatCard } from '../components/StatCard'
import {
- BrokenTestRow,
FlakyTestClassification,
FlakyTestRow,
FlakyTestWindow,
@@ -96,249 +91,6 @@ function RelativeTime({ iso }: { iso: string }): JSX.Element {
)
}
-// Reads the `broken_tests` product endpoint: the failure fingerprints, the classifier that ranks
-// them, and the two cluster reads it merges all run server-side. The row expansion lazy-loads the
-// failing log lines for the row's latest run via run_failure_logs.
-function BrokenTestDrilldown({ row }: { row: BrokenTestRow }): JSX.Element {
- const { runFailureLogsByRun, runFailureLogsByRunLoading, brokenTestsWindowDays } =
- useValues(engineeringAnalyticsLogic)
- const logs = row.latestRunId ? runFailureLogsByRun[row.latestRunId] : undefined
- const runUrl = row.repo && row.latestRunId ? `https://github.com/${row.repo}/actions/runs/${row.latestRunId}` : null
-
- return (
- <div className="flex flex-col gap-2 p-2">
- <div className="flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-secondary">
- <span>
- Latest failing run on <span className="font-mono">{row.latestBranch || 'unknown branch'}</span>
- </span>
- <span>·</span>
- <span>
- {pluralize(row.occurrences, 'failure')} across {pluralize(row.branches, 'branch', 'branches')} in
- the last {brokenTestsWindowDays} days
- </span>
- {runUrl && (
- <Link to={runUrl} target="_blank" className="inline-flex items-center gap-1">
- View run on GitHub <IconExternal />
- </Link>
- )}
- </div>
- {!row.latestRunId ? (
- <span className="text-xs text-tertiary">No run id recorded for this failure — can't fetch logs.</span>
- ) : runFailureLogsByRunLoading && !logs ? (
- <LemonSkeleton className="h-24 w-full" />
- ) : !logs || !logs.logs_available || logs.jobs.length === 0 ? (
- <span className="text-xs text-tertiary">
- No failure logs for this run — it didn't fail, or the logs aged out of the short Logs retention.
- </span>
- ) : (
- <div className="flex flex-col gap-3">
- {logs.jobs.map((job) => (
- <div key={job.job_id} className="flex flex-col gap-1">
- <div className="font-mono text-xs font-semibold text-secondary">
- {job.branch || 'unknown'} · job {job.job_id} · {job.conclusion}
- {job.truncated && ' · truncated'}
- </div>
- <pre className="m-0 overflow-x-auto rounded border bg-bg-3000 p-2 font-mono text-xs leading-snug">
- {job.lines.map((line, idx) => (
- <div
- key={idx}
- className={cn(line.original_line === null && 'italic text-tertiary')}
- >
- <span className="mr-3 inline-block w-12 select-none text-right text-tertiary">
- {line.original_line ?? ''}
- </span>
- {line.text}
- </div>
- ))}
- </pre>
- </div>
- ))}
- </div>
- )}
- </div>
- )
-}
-
-function BrokenTestsPanel(): JSX.Element {
- const {
- visibleBrokenTests,
- brokenTestsData,
- brokenTestsDataLoading,
- brokenTestsError,
- brokenTestsWindowDays,
- breakingMasterJobs,
- hiddenBrokenTestCount,
- showPrOnlyBrokenTests,
- } = useValues(engineeringAnalyticsLogic)
- const { setShowPrOnlyBrokenTests, loadRunFailureLogs } = useActions(engineeringAnalyticsLogic)
-
- const columns: LemonTableColumns<BrokenTestRow> = [
- {
- title: 'State',
- key: 'state',
- width: 160,
- render: (_, row) => <BrokenTestStateTag state={row.state} />,
- },
- {
- title: 'Test',
- key: 'testId',
- width: 320,
- render: (_, row) => (
- <Tooltip title={row.testId}>
- <span className="block max-w-[20rem] truncate font-mono text-xs">{row.testId}</span>
- </Tooltip>
- ),
- },
- {
- title: 'Error',
- key: 'errorSignature',
- render: (_, row) =>
- row.errorSignature ? (
- <Tooltip title={row.errorSignature}>
- <span className="line-clamp-2 max-w-[22rem] text-xs text-secondary">{row.errorSignature}</span>
- </Tooltip>
- ) : (
- <span className="text-tertiary">—</span>
- ),
- },
- {
- title: 'Occurrences',
- key: 'occurrences',
- width: 110,
- align: 'right',
- sorter: (a, b) => a.occurrences - b.occurrences,
- render: (_, row) => <span className="tabular-nums">{humanFriendlyNumber(row.occurrences)}</span>,
- },
- {
- title: 'Branches',
- key: 'branches',
- width: 100,
- align: 'right',
- sorter: (a, b) => a.branches - b.branches,
- render: (_, row) => <span className="tabular-nums">{humanFriendlyNumber(row.branches)}</span>,
- },
- {
- title: 'Master hits',
- key: 'masterHits',
- width: 110,
- align: 'right',
- sorter: (a, b) => a.masterHits - b.masterHits,
- render: (_, row) =>
- row.masterHits > 0 ? (
- <span className="tabular-nums font-semibold text-danger">
- {humanFriendlyNumber(row.masterHits)}
- </span>
- ) : (
- <span className="tabular-nums text-tertiary">0</span>
- ),
- },
- {
- title: 'First seen',
- key: 'firstSeen',
- width: 110,
- align: 'right',
- sorter: (a, b) => a.firstSeen.localeCompare(b.firstSeen),
- render: (_, row) => <RelativeTime iso={row.firstSeen} />,
- },
- {
- title: 'Last seen',
- key: 'lastSeen',
- width: 110,
- align: 'right',
- sorter: (a, b) => a.lastSeen.localeCompare(b.lastSeen),
- render: (_, row) => <RelativeTime iso={row.lastSeen} />,
- },
- {
- title: 'Trend (24h)',
- key: 'trend',
- width: 140,
- tooltip: 'Failures per hour over the last 24 hours — a climbing bar means it is escalating right now.',
- render: (_, row) => {
- const series = row.trend
- return series && series.some((n) => n > 0) ? (
- <Sparkline data={series} type="bar" color="danger" maximumIndicator={false} className="h-8 w-28" />
- ) : (
- <span className="text-tertiary">—</span>
- )
- },
- },
- ]
-
- return (
- <div className="flex flex-col gap-4">
- <div className="flex items-start justify-between gap-2">
- <div className="flex flex-col gap-0.5">
- <h3 className="m-0 text-base font-semibold">Currently broken tests</h3>
- <p className="m-0 max-w-2xl text-xs text-tertiary">
- Failures over the last {brokenTestsWindowDays} days, grouped by whether they're breaking trunk
- right now, resolving, or just flaky — inferred from CI logs + master job history. Expand a row
- for the latest failing run's logs.
- </p>
- </div>
- <LemonSwitch
- label="Show PR-only failures"
- checked={showPrOnlyBrokenTests}
- onChange={setShowPrOnlyBrokenTests}
- size="small"
- bordered
- />
- </div>
- {brokenTestsError ? (
- <LemonBanner type="error">Couldn't load broken tests: {brokenTestsError}</LemonBanner>
- ) : brokenTestsDataLoading && !brokenTestsData ? (
- <LemonSkeleton className="h-48 w-full" />
- ) : (
- <>
- {breakingMasterJobs.length > 0 ? (
- <LemonBanner type="error">
- Breaking master: {pluralize(breakingMasterJobs.length, 'job group')} —{' '}
- {breakingMasterJobs.join(', ')}
- </LemonBanner>
- ) : (
- <LemonBanner type="success">
- Nothing is flagged as breaking master right now. Failures that hit trunk only show here once
- their job's latest master run is known to be red, so this needs the job-level source synced.
- </LemonBanner>
- )}
- <LemonTable
- data-attr="engineering-analytics-broken-tests-table"
- size="small"
- columns={columns}
- dataSource={visibleBrokenTests}
- rowKey={(row) => row.fingerprint}
- loading={brokenTestsDataLoading}
- pagination={{ pageSize: 10 }}
- useURLForSorting={false}
- emptyState="No broken tests to show. Nothing is breaking trunk right now."
- nouns={['broken test', 'broken tests']}
- expandable={{
- noIndent: true,
- onRowExpand: (row) => {
- if (row.latestRunId) {
- loadRunFailureLogs({ runId: row.latestRunId })
- }
- },
- expandedRowRender: (row) => <BrokenTestDrilldown row={row} />,
- }}
- />
- {brokenTestsData?.truncated && (
- <div className="text-xs text-tertiary">
- Showing the top {brokenTestsData.limit} by urgency — more distinct failures matched than
- fit.
- </div>
- )}
- {hiddenBrokenTestCount > 0 && !showPrOnlyBrokenTests && (
- <div className="text-xs text-tertiary">
- {pluralize(hiddenBrokenTestCount, 'PR-only failure')} hidden — toggle "Show PR-only
- failures" to include them.
- </div>
- )}
- </>
- )}
- </div>
- )
-}
-
const FLAKY_CLASSIFICATION: Record<FlakyTestClassification, { label: string; type: LemonTagType; tooltip: string }> = {
confirmed_flake: {
label: 'Confirmed flake',
@@ -521,7 +273,6 @@ export function EngineeringAnalyticsTestHealth(): JSX.Element {
<div className="flex flex-col gap-8">
{/* Tab-level: both sections read the same source, so the picker scopes them together. */}
<ScopeBar repoSlot={<SourceScopeChip />} showDate={false} />
- <BrokenTestsPanel />
<ActiveTestHealthQueue />
<QuarantineRegister />
{/* Rendered once for the whole tab: the queue rows, the register rows, and the
diff --git a/products/engineering_analytics/frontend/scenes/PullRequestDetailScene.tsx b/products/engineering_analytics/frontend/scenes/PullRequestDetailScene.tsx
index 2bbe5138d915..efdc5c5833bb 100644
--- a/products/engineering_analytics/frontend/scenes/PullRequestDetailScene.tsx
+++ b/products/engineering_analytics/frontend/scenes/PullRequestDetailScene.tsx
@@ -268,10 +268,7 @@ function LifecycleStrip({ summary, openedAt, commitGroups }: LifecycleStripProps
} · ${pushRoundVerdictLabel(node.round)}`}
>
<span
- className={cn(
- 'w-2.5 rounded-t-sm',
- node.round.pending && 'animate-pulse'
- )}
+ className="w-2.5 rounded-t-sm"
// eslint-disable-next-line react/forbid-dom-props
style={{
height: barPx(node.round),
@@ -684,7 +681,7 @@ export function PullRequestDetailScene(): JSX.Element {
if (loadFailed) {
return (
- <SceneContent>
+ <SceneContent className="pb-16">
<SceneTitleSection name="Pull request" resourceType={{ type: 'health' }} />
<div className="flex items-center gap-3">
<span className="text-secondary">
@@ -699,7 +696,7 @@ export function PullRequestDetailScene(): JSX.Element {
}
return (
- <SceneContent>
+ <SceneContent className="pb-16">
<SceneTitleSection
name="Pull request"
resourceType={{ type: 'health' }}
diff --git a/products/engineering_analytics/frontend/scenes/RepoOverviewScene.stories.tsx b/products/engineering_analytics/frontend/scenes/RepoOverviewScene.stories.tsx
index b02ae32ceb43..8fc1393a4689 100644
--- a/products/engineering_analytics/frontend/scenes/RepoOverviewScene.stories.tsx
+++ b/products/engineering_analytics/frontend/scenes/RepoOverviewScene.stories.tsx
@@ -8,7 +8,6 @@ import { mswDecorator } from '~/mocks/browser'
import type {
GitHubSourceApi,
- MasterFailureGroupApi,
PullRequestListApi,
RepoOverviewApi,
WorkflowHealthItemApi,
@@ -118,20 +117,6 @@ const WORKFLOW_HEALTH: WorkflowHealthItemApi[] = [
healthItem('Frontend CI', 71.9, [0, 1, 0, 0, 2, 0, 1], 0.95),
]
-// The latest run recovered, but the 24-hour failure feed still includes the earlier failure. The hero
-// must stay green while the triage section preserves that history.
-const RECENT_FAILURES: MasterFailureGroupApi[] = [
- {
- repo: { provider: 'github', owner: 'PostHog', name: 'posthog' },
- workflow_name: 'Backend CI',
- failed_job: 'Backend tests',
- run_count: 1,
- first_seen: '2026-07-01T12:00:00Z',
- last_seen: '2026-07-01T12:00:00Z',
- latest_run_id: 8999,
- },
-]
-
const PULL_REQUESTS: PullRequestListApi = {
items: [
{
@@ -237,13 +222,6 @@ const meta: Meta = {
get: {
'api/projects/:team_id/engineering_analytics/sources/': SOURCES,
'api/projects/:team_id/engineering_analytics/repo_overview/': OVERVIEW,
- 'api/projects/:team_id/engineering_analytics/current_branch_health/': {
- default_branch: 'master',
- settled_workflows: WORKFLOW_HEALTH.length,
- failing_workflows: 0,
- failing_workflow_names: [],
- },
- 'api/projects/:team_id/engineering_analytics/master_failures/': RECENT_FAILURES,
'api/projects/:team_id/engineering_analytics/repo_run_activity/': ACTIVITY,
'api/projects/:team_id/engineering_analytics/ci_cards/': {
open_prs: 18,
@@ -265,21 +243,3 @@ export const RepoOverview: Story = {
render: () => <App />,
parameters: { pageUrl: urls.engineeringAnalytics() },
}
-
-// The red verdict: failing workflows drive the danger styling, the names subline, and the jump link.
-export const RepoOverviewFailing: Story = {
- render: () => <App />,
- parameters: { pageUrl: urls.engineeringAnalytics() },
- decorators: [
- mswDecorator({
- get: {
- 'api/projects/:team_id/engineering_analytics/current_branch_health/': {
- default_branch: 'master',
- settled_workflows: WORKFLOW_HEALTH.length,
- failing_workflows: 2,
- failing_workflow_names: ['Backend CI', 'E2E - Playwright'],
- },
- },
- }),
- ],
-}
diff --git a/products/engineering_analytics/frontend/scenes/RepoOverviewScene.tsx b/products/engineering_analytics/frontend/scenes/RepoOverviewScene.tsx
index f6fbda679c17..a8d25add93d2 100644
--- a/products/engineering_analytics/frontend/scenes/RepoOverviewScene.tsx
+++ b/products/engineering_analytics/frontend/scenes/RepoOverviewScene.tsx
@@ -1,14 +1,12 @@
-// The repo hub landing page: stat tiles with deltas, then master health, failing runs, PRs needing
-// attention, workflows, and cost as sections on one page.
+// The repo hub landing page: PRs needing attention, then windowed trends, master health, and
+// workflows as sections on one page.
import { useActions, useValues } from 'kea'
import { router } from 'kea-router'
-import { LemonButton, LemonCard, LemonSkeleton, LemonTable, LemonTag, Link, Spinner, Tooltip } from '@posthog/lemon-ui'
+import { LemonButton, LemonCard, LemonSkeleton, Link, Spinner, Tooltip } from '@posthog/lemon-ui'
import { TimeSeriesLineChart, useChartTheme } from '@posthog/quill-charts'
-import { TZLabel } from 'lib/components/TZLabel'
-import { cn } from 'lib/utils/css-classes'
import { humanFriendlyNumber } from 'lib/utils/numbers'
import { teamLogic } from 'scenes/teamLogic'
import { urls } from 'scenes/urls'
@@ -16,16 +14,13 @@ import { urls } from 'scenes/urls'
import { CIAnalyticsLoadError } from '../components/CIAnalyticsLoadError'
import { ConnectGitHubSource } from '../components/ConnectGitHubSource'
import { RepoEntityHeader } from '../components/EntityHeader'
-import { FailureLogGroups } from '../components/FailureLogs'
import { PullRequestTable } from '../components/PullRequestTable'
import { formatAxisMinutes, hasEnoughRunActivity } from '../components/RunActivityChart'
import { RunActivityMiniBars } from '../components/RunActivityMiniBars'
import { ScopeDateFilter, SourceScopeChip } from '../components/ScopeBar'
-import { Section, scrollToSection } from '../components/Section'
-import { HeroStat } from '../components/StatCard'
+import { Section } from '../components/Section'
import { TrendCard } from '../components/TrendCard'
import { WorkflowHealthTable } from '../components/WorkflowHealthTable'
-import type { MasterFailureGroupApi } from '../generated/api.schemas'
import { compactHoursLabel, compactMinutes, compactUsd, percent } from '../lib/format'
import { githubCommitUrl } from '../lib/github'
import { HUB_PREVIEW_MAX } from '../lib/preview'
@@ -33,205 +28,6 @@ import { withCurrentScope, withScope } from '../lib/scope'
import { engineeringAnalyticsLogic } from './engineeringAnalyticsLogic'
import { repoOverviewLogic } from './repoOverviewLogic'
-function withSource(url: string, sourceId: string | null): string {
- return withCurrentScope(url, sourceId)
-}
-
-/** The page's thesis: is the pipeline healthy right now? Default-branch verdict plus open-PR backlog
- * pressure, both current-state, so it sits above the date filter that scopes everything below. */
-function PipelineVerdictHero({
- summary,
- loading,
- failed,
- defaultBranch,
- backlog,
-}: {
- summary: { settledWorkflows: number; failingNow: number; failingWorkflowNames: string[] }
- loading: boolean
- failed: boolean
- defaultBranch: string
- backlog: { open: number | null; failingCi: number | null; stuck: number | null }
-}): JSX.Element {
- const failingCount = summary.failingNow
- const failing = !loading && !failed && summary.settledWorkflows > 0 && failingCount > 0
- const unknown = failed || summary.settledWorkflows === 0
- const dotColor = loading || unknown ? 'var(--muted)' : failing ? 'var(--danger)' : 'var(--success)'
- const status = loading
- ? 'Checking'
- : failed
- ? 'Unavailable'
- : summary.settledWorkflows === 0
- ? 'No completed runs'
- : failing
- ? `${failingCount} failing`
- : 'Passing'
- // Only the failing state earns a subline (which workflows broke). "Passing" already says the rest.
- const failingNames =
- summary.failingWorkflowNames.slice(0, 3).join(', ') + (failingCount > 3 ? ` +${failingCount - 3}` : '')
- return (
- <LemonCard
- hoverEffect={failing}
- onClick={failing ? () => scrollToSection('now') : undefined}
- className={cn(
- 'flex flex-wrap items-center justify-between gap-x-8 gap-y-4 px-6 py-5',
- failing && 'bg-fill-error-tertiary'
- )}
- >
- <div className="flex min-w-0 flex-col gap-1.5">
- <Tooltip title="Default-branch workflows whose latest completed run failed in the last 24 hours.">
- <span className="w-fit cursor-default font-mono text-xs text-tertiary">{defaultBranch}</span>
- </Tooltip>
- <span className="flex items-baseline gap-2.5">
- <span
- className="inline-block size-2.5 shrink-0 translate-y-[-0.15em] rounded-full"
- // eslint-disable-next-line react/forbid-dom-props
- style={{ backgroundColor: dotColor }}
- />
- <span
- className={cn(
- 'text-3xl font-bold leading-none tracking-tight',
- loading || unknown ? 'text-tertiary' : failing ? 'text-danger' : 'text-primary'
- )}
- >
- {status}
- </span>
- {failing && <span className="text-sm font-medium text-danger">View →</span>}
- </span>
- {failing && <span className="truncate text-xs text-secondary">{failingNames}</span>}
- </div>
- <div className="flex items-center gap-6">
- <HeroStat label="Open PRs" value={backlog.open} />
- <HeroStat label="Failing CI" value={backlog.failingCi} tone="danger" />
- <HeroStat label="Stuck >7d" value={backlog.stuck} tone="warning" />
- </div>
- </LemonCard>
- )
-}
-
-function MasterFailuresSection(): JSX.Element {
- const { masterFailures, masterFailuresLoading, failureLogs, failureLogsLoading, currentDefaultBranch } =
- useValues(repoOverviewLogic)
- const { loadLogsForRun } = useActions(repoOverviewLogic)
- const { sourceId } = useValues(engineeringAnalyticsLogic)
-
- return (
- <Section id="now" title={`Failing on ${currentDefaultBranch}`} note="Last 24 hours">
- <LemonCard hoverEffect={false} className="overflow-hidden p-0">
- <LemonTable<MasterFailureGroupApi>
- // Namespaces the page/order search params so paging can't move other tables sharing this URL.
- id="master-failures"
- dataSource={masterFailures}
- loading={masterFailuresLoading}
- embedded
- rowKey={(group) => `${group.workflow_name}:${group.failed_job}`}
- expandable={{
- noIndent: true,
- onRowExpand: (group) => loadLogsForRun(group.latest_run_id),
- expandedRowRender: (group) => {
- const logs = failureLogs[group.latest_run_id]
- return (
- <div className="p-2">
- <div className="mb-1.5 flex items-center gap-2 text-xs font-semibold">
- Failure excerpt
- <span className="font-mono font-normal text-tertiary">
- latest run #{group.latest_run_id}
- </span>
- <span className="ml-auto font-normal">
- <Link
- to={withSource(
- urls.engineeringAnalyticsWorkflowRun(
- group.repo.owner,
- group.repo.name,
- group.latest_run_id
- ),
- sourceId
- )}
- >
- Open run →
- </Link>
- </span>
- </div>
- <FailureLogGroups logs={logs} loading={failureLogsLoading} />
- </div>
- )
- },
- }}
- columns={[
- {
- title: 'Workflow',
- key: 'workflow',
- render: (_, group) => (
- <span className="flex items-center gap-2 font-medium">
- <span className="inline-block size-2 shrink-0 rounded-full bg-danger" />
- <Link
- to={withSource(
- urls.engineeringAnalyticsWorkflowRuns(
- group.repo.owner,
- group.repo.name,
- group.workflow_name
- ),
- sourceId
- )}
- >
- {group.workflow_name}
- </Link>
- </span>
- ),
- },
- {
- title: 'What failed',
- key: 'failedJob',
- render: (_, group) =>
- group.failed_job ? (
- <span className="font-mono text-[11px] text-secondary">{group.failed_job}</span>
- ) : (
- <span className="text-xs text-tertiary">workflow-level (jobs not synced)</span>
- ),
- },
- {
- title: 'Runs',
- key: 'runs',
- align: 'right',
- render: (_, group) =>
- group.run_count > 1 ? (
- <LemonTag type="danger">×{group.run_count}</LemonTag>
- ) : (
- <span className="tabular-nums text-tertiary">1</span>
- ),
- },
- {
- title: 'First seen',
- key: 'firstSeen',
- align: 'right',
- render: (_, group) => (
- <span className="text-xs text-tertiary whitespace-nowrap">
- <TZLabel time={group.first_seen} />
- </span>
- ),
- },
- {
- title: 'Last seen',
- key: 'lastSeen',
- align: 'right',
- render: (_, group) => (
- <span className="text-xs text-tertiary whitespace-nowrap">
- <TZLabel time={group.last_seen} />
- </span>
- ),
- },
- ]}
- pagination={{ pageSize: 10 }}
- emptyState={`Nothing failing on ${currentDefaultBranch} in the last 24 hours.`}
- nouns={['failure group', 'failure groups']}
- />
- <div className="border-t border-primary px-4 py-2 text-[11px] text-tertiary">
- PR-branch failures appear on each pull request's page.
- </div>
- </LemonCard>
- </Section>
- )
-}
-
export function RepoOverviewScene(): JSX.Element {
const {
overview,
@@ -246,33 +42,22 @@ export function RepoOverviewScene(): JSX.Element {
openToMergeSeries,
jobsAvailable,
overviewDefaultBranch,
- currentDefaultBranch,
notConnected,
overviewFailed,
overviewLoading,
- currentHealthSummary,
- currentBranchHealthFailed,
- currentBranchHealthLoading,
prPreviewCount,
workflowPreviewCount,
} = useValues(repoOverviewLogic)
- const { cards, pullRequestsLoading, workflowHealth, workflowHealthLoading, sourceId, activeSource } =
+ const { pullRequestsLoading, workflowHealth, workflowHealthLoading, sourceId, activeSource } =
useValues(engineeringAnalyticsLogic)
- const {
- loadOverview,
- loadCurrentBranchHealth,
- loadMasterFailures,
- loadRepoActivity,
- showMorePrs,
- showMoreWorkflows,
- } = useActions(repoOverviewLogic)
+ const { loadOverview, loadRepoActivity, showMorePrs, showMoreWorkflows } = useActions(repoOverviewLogic)
const { searchParams } = useValues(router)
const { timezone } = useValues(teamLogic)
const chartTheme = useChartTheme()
- // Window/source changes reload the overview, activity, and workflow health (the date-scoped surfaces);
- // the PR backlog is current-state, not windowed, so it stays put. Surface the reload so a window change
- // doesn't silently swap stale numbers.
+ // Window/source changes reload the overview, activity, and workflow health (the date-scoped
+ // surfaces); the PR backlog is current-state, not windowed, so it stays put. Surface the reload
+ // so a window change doesn't silently swap stale numbers.
const hubReloading = overviewLoading || repoActivityLoading || workflowHealthLoading
// The hub previews each table: a short, sorted slice with "Show more" to grow in place, and "View all"
@@ -299,8 +84,6 @@ export function RepoOverviewScene(): JSX.Element {
<CIAnalyticsLoadError
onRetry={() => {
loadOverview()
- loadCurrentBranchHealth()
- loadMasterFailures()
loadRepoActivity()
}}
/>
@@ -309,27 +92,10 @@ export function RepoOverviewScene(): JSX.Element {
return (
<div className="flex flex-col gap-4">
- {/* Repo identity. The scope controls used to dock here; they now sit below the verdict hero, so
- the date filter visibly governs only the windowed surfaces beneath it. */}
+ {/* Repo identity. The scope controls dock below the PR table, so the date filter visibly
+ governs only the windowed surfaces beneath it. */}
<RepoEntityHeader repoFullName={activeSource?.repo || ''} />
- {/* The thesis: is the pipeline healthy right now? Current-state, above the date filter. */}
- <PipelineVerdictHero
- summary={currentHealthSummary}
- loading={currentBranchHealthLoading}
- failed={currentBranchHealthFailed}
- defaultBranch={currentDefaultBranch}
- backlog={{
- open: cards?.openPrs ?? null,
- failingCi: cards?.failingCi ?? null,
- stuck: cards?.stuck ?? null,
- }}
- />
-
- {/* Now zone: current-state surfaces above the filter. The hero owns the backlog summary, so this
- section is just the triage table. */}
- <MasterFailuresSection />
-
<Section id="prs" title="Pull requests needing attention">
<LemonCard hoverEffect={false} className="overflow-hidden p-0">
<PullRequestTable
@@ -351,7 +117,7 @@ export function RepoOverviewScene(): JSX.Element {
Show more
</LemonButton>
)}
- <Link to={withSource(urls.engineeringAnalyticsPullRequestList(), sourceId)}>
+ <Link to={withCurrentScope(urls.engineeringAnalyticsPullRequestList(), sourceId)}>
View all →
</Link>
</div>
diff --git a/products/engineering_analytics/frontend/scenes/WorkflowRunDetailScene.tsx b/products/engineering_analytics/frontend/scenes/WorkflowRunDetailScene.tsx
index 3d2f33ebf1be..4738f383064e 100644
--- a/products/engineering_analytics/frontend/scenes/WorkflowRunDetailScene.tsx
+++ b/products/engineering_analytics/frontend/scenes/WorkflowRunDetailScene.tsx
@@ -55,7 +55,7 @@ export function WorkflowRunDetailScene(): JSX.Element {
if (!isValidRunId) {
return (
- <SceneContent>
+ <SceneContent className="pb-16">
<SceneTitleSection name="Workflow run" resourceType={{ type: 'health' }} />
<span className="text-secondary">That run id isn't valid.</span>
</SceneContent>
@@ -98,7 +98,7 @@ export function WorkflowRunDetailScene(): JSX.Element {
if (loadFailed) {
return (
- <SceneContent>
+ <SceneContent className="pb-16">
<SceneTitleSection name="Workflow run" resourceType={{ type: 'health' }} />
<div className="flex items-center gap-3">
<span className="text-secondary">
@@ -113,7 +113,7 @@ export function WorkflowRunDetailScene(): JSX.Element {
}
return (
- <SceneContent>
+ <SceneContent className="pb-16">
{/* Scene chrome keeps the generic label; the EntityHeader below owns the title. */}
<SceneTitleSection
name="Workflow run"
diff --git a/products/engineering_analytics/frontend/scenes/WorkflowRunsScene.tsx b/products/engineering_analytics/frontend/scenes/WorkflowRunsScene.tsx
index 3bd55cd6d022..f37782e70874 100644
--- a/products/engineering_analytics/frontend/scenes/WorkflowRunsScene.tsx
+++ b/products/engineering_analytics/frontend/scenes/WorkflowRunsScene.tsx
@@ -256,7 +256,7 @@ export function WorkflowRunsScene(): JSX.Element {
if (loadFailed) {
return (
- <SceneContent>
+ <SceneContent className="pb-16">
<SceneTitleSection name="Workflow" resourceType={{ type: 'health' }} />
<div className="flex items-center gap-3">
<span className="text-secondary">
@@ -271,7 +271,7 @@ export function WorkflowRunsScene(): JSX.Element {
}
return (
- <SceneContent>
+ <SceneContent className="pb-16">
{/* Scene chrome keeps the generic label; the EntityHeader below owns the title. */}
<SceneTitleSection
name="Workflow"
diff --git a/products/engineering_analytics/frontend/scenes/engineeringAnalyticsLogic.ts b/products/engineering_analytics/frontend/scenes/engineeringAnalyticsLogic.ts
index 05987b92d627..19787bfe52b0 100644
--- a/products/engineering_analytics/frontend/scenes/engineeringAnalyticsLogic.ts
+++ b/products/engineering_analytics/frontend/scenes/engineeringAnalyticsLogic.ts
@@ -22,25 +22,21 @@ import { pluralize } from 'lib/utils/strings'
import { urls } from 'scenes/urls'
import {
- engineeringAnalyticsBrokenTests,
engineeringAnalyticsCiCards,
engineeringAnalyticsFlakyTests,
engineeringAnalyticsPullRequests,
engineeringAnalyticsQuarantine,
engineeringAnalyticsQuarantineRequest,
- engineeringAnalyticsRunFailureLogs,
engineeringAnalyticsSources,
engineeringAnalyticsWorkflowHealth,
} from '../generated/api'
import type {
- BrokenTestRowApi,
FlakyTestItemClassificationEnumApi,
GitHubSourceApi,
PullRequestListItemApi,
PushCISampleApi,
QuarantineRequestApi,
QuarantineRequestResultApi,
- RunFailureLogsApi,
} from '../generated/api.schemas'
import { CIStatus, ciStatusOf } from '../lib/ci'
import { type FleetSummary, computeFleetSummary } from '../lib/runHealth'
@@ -478,62 +474,6 @@ export interface FlakyTestsData {
limit: number
}
-// ── Broken-tests panel ─────────────────────────────────────────────────────────────
-// Live CI failures classified by how each is behaving right now — breaking trunk, novel, resolving,
-// flaky, or one PR's problem — ranked most-urgent first. The classifier and the two cluster reads it
-// merges run server-side in the `broken_tests` product endpoint (logic/queries/broken_tests.py); the
-// UI just renders the typed rows, so there is no client-side HogQL or classifier here any more.
-
-export type BrokenTestState = BrokenTestRowApi['state']
-
-/** A classified CI-failure fingerprint, camelCased from the endpoint row. `trend` is the fixed
- * 24-slot hourly failure count (oldest first) the row sparkline renders. */
-export interface BrokenTestRow {
- fingerprint: string
- testId: string
- errorSignature: string
- jobName: string
- repo: string
- state: BrokenTestState
- firstSeen: string
- lastSeen: string
- occurrences: number
- branches: number
- masterHits: number
- // Most recent failing run for this fingerprint — the anchor the row expansion fetches logs for.
- latestRunId: number
- latestBranch: string
- trend: number[]
-}
-
-export interface BrokenTestsData {
- rows: BrokenTestRow[]
- // Default-branch jobs whose latest run is red — drives the panel's summary banner.
- breakingMasterJobs: string[]
- windowDays: number
- truncated: boolean
- limit: number
-}
-
-function toBrokenTestRow(it: BrokenTestRowApi): BrokenTestRow {
- return {
- fingerprint: it.fingerprint,
- testId: it.test_id,
- errorSignature: it.error_signature,
- jobName: it.job_name,
- repo: it.repo,
- state: it.state,
- firstSeen: it.first_seen,
- lastSeen: it.last_seen,
- occurrences: it.occurrences,
- branches: it.branches,
- masterHits: it.master_hits,
- latestRunId: it.latest_run_id,
- latestBranch: it.latest_branch,
- trend: it.trend_24h ?? [],
- }
-}
-
export type QuarantineRequestAction = 'quarantine' | 'extend' | 'remove'
/** What the tab submits to the write endpoint; the backend opens the issue + PR. */
@@ -633,12 +573,6 @@ export interface engineeringAnalyticsLogicValues {
activeSource: GitHubSourceApi | null
anyLoading: boolean
author: string | null
- breakingMasterJobs: string[]
- brokenTests: BrokenTestRow[]
- brokenTestsData: BrokenTestsData | null
- brokenTestsDataLoading: boolean
- brokenTestsError: string | null
- brokenTestsWindowDays: number
cards: CardsData | null
cardsLoading: boolean
cardsStatus: LoaderStatus
@@ -659,7 +593,6 @@ export interface engineeringAnalyticsLogicValues {
hasActiveQuarantineFilters: boolean
hasActiveWorkflowFilters: boolean
hasMultipleSources: boolean
- hiddenBrokenTestCount: number
notConnected: boolean
pullRequests: PullRequestRow[]
pullRequestsLoadError: boolean
@@ -681,12 +614,9 @@ export interface engineeringAnalyticsLogicValues {
readyCount: number
readyOnly: boolean
repo: string | null
- runFailureLogsByRun: Record<number, RunFailureLogsApi>
- runFailureLogsByRunLoading: boolean
scopeRepo: string | null
search: string
selectedScope: string | null
- showPrOnlyBrokenTests: boolean
sourceId: string | null
sourceOptions: {
label: string
@@ -697,7 +627,6 @@ export interface engineeringAnalyticsLogicValues {
tableTruncated: boolean
thrashCount: number
thrashOnly: boolean
- visibleBrokenTests: BrokenTestRow[]
workflowCostAvailable: boolean
workflowFilters: WorkflowFilters
workflowHealth: WorkflowHealthRow[]
@@ -719,21 +648,6 @@ export interface engineeringAnalyticsLogicActions {
closeQuarantineModal: () => {
value: true
}
- loadBrokenTests: () => any
- loadBrokenTestsFailure: (
- error: string,
- errorObject?: any
- ) => {
- error: string
- errorObject?: any
- }
- loadBrokenTestsSuccess: (
- brokenTestsData: BrokenTestsData,
- payload?: any
- ) => {
- brokenTestsData: BrokenTestsData
- payload?: any
- }
loadCards: () => any
loadCardsFailure: (
error: string,
@@ -809,27 +723,6 @@ export interface engineeringAnalyticsLogicActions {
quarantine: QuarantineData
payload?: any
}
- loadRunFailureLogs: ({ runId }: { runId: number }) => {
- runId: number
- }
- loadRunFailureLogsFailure: (
- error: string,
- errorObject?: any
- ) => {
- error: string
- errorObject?: any
- }
- loadRunFailureLogsSuccess: (
- runFailureLogsByRun: Record<number, RunFailureLogsApi>,
- payload?: {
- runId: number
- }
- ) => {
- runFailureLogsByRun: Record<number, RunFailureLogsApi>
- payload?: {
- runId: number
- }
- }
loadWorkflowHealth: () => any
loadWorkflowHealthFailure: (
error: string,
@@ -897,9 +790,6 @@ export interface engineeringAnalyticsLogicActions {
setSearch: (search: string) => {
search: string
}
- setShowPrOnlyBrokenTests: (show: boolean) => {
- show: boolean
- }
setSourceId: (sourceId: string | null) => {
sourceId: string | null
}
@@ -1005,11 +895,6 @@ export interface engineeringAnalyticsLogicMeta {
quarantineModeFilter: QuarantineModeFilter
) => QuarantineCard | null
hasActiveQuarantineFilters: (quarantineFilters: QuarantineFilters) => boolean
- brokenTests: (brokenTestsData: BrokenTestsData | null) => BrokenTestRow[]
- breakingMasterJobs: (brokenTestsData: BrokenTestsData | null) => string[]
- brokenTestsWindowDays: (brokenTestsData: BrokenTestsData | null) => number
- hiddenBrokenTestCount: (brokenTests: BrokenTestRow[]) => number
- visibleBrokenTests: (brokenTests: BrokenTestRow[], showPrOnlyBrokenTests: boolean) => BrokenTestRow[]
hasMultipleSources: (githubSources: GitHubSourceApi[]) => boolean
activeSource: (
githubSources: GitHubSourceApi[],
@@ -1069,7 +954,6 @@ export const engineeringAnalyticsLogic: LogicWrapper<engineeringAnalyticsLogicTy
openQuarantineModal: (state: QuarantineModalState) => ({ state }),
closeQuarantineModal: true,
setFlakyTestWindow: (window: FlakyTestWindow) => ({ window }),
- setShowPrOnlyBrokenTests: (show: boolean) => ({ show }),
refresh: true,
}),
@@ -1208,47 +1092,6 @@ export const engineeringAnalyticsLogic: LogicWrapper<engineeringAnalyticsLogicTy
},
},
],
- brokenTestsData: [
- null as BrokenTestsData | null,
- {
- loadBrokenTests: async (): Promise<BrokenTestsData> => {
- const data = await engineeringAnalyticsBrokenTests(projectId(), {
- source_id: values.sourceId ?? undefined,
- repo: values.scopeRepo ?? undefined,
- })
- return {
- rows: data.rows.map(toBrokenTestRow),
- breakingMasterJobs: data.breaking_master_jobs,
- windowDays: data.window_days,
- truncated: data.truncated,
- limit: data.limit,
- }
- },
- },
- ],
- runFailureLogsByRun: [
- {} as Record<number, RunFailureLogsApi>,
- {
- loadRunFailureLogs: async ({
- runId,
- }: {
- runId: number
- }): Promise<Record<number, RunFailureLogsApi>> => {
- // Lazy: fetched when a broken-test row is expanded, cached per run so re-expanding
- // is free. Rides the product's own engineering_analytics endpoint (not raw /query/),
- // so it authorizes under the same scope the rest of the panel uses.
- if (!runId || values.runFailureLogsByRun[runId]) {
- return values.runFailureLogsByRun
- }
- const result = await engineeringAnalyticsRunFailureLogs(projectId(), {
- run_id: runId,
- source_id: values.sourceId ?? undefined,
- repo: values.scopeRepo ?? undefined,
- })
- return { ...values.runFailureLogsByRun, [runId]: result }
- },
- },
- ],
quarantineSubmit: [
null as QuarantineRequestResultApi | null,
{
@@ -1388,8 +1231,6 @@ export const engineeringAnalyticsLogic: LogicWrapper<engineeringAnalyticsLogicTy
DEFAULT_FLAKY_TEST_WINDOW as FlakyTestWindow,
{ setFlakyTestWindow: (_, { window }) => window },
],
- // Prototype panel hides the low-signal PR-only failures by default.
- showPrOnlyBrokenTests: [false, { setShowPrOnlyBrokenTests: (_, { show }) => show }],
// Same tri-state as the other loaders: 'notConnected' (no source) defers to the tab-level
// "connect a source" gate; only a real 'error' surfaces the queue's own banner.
flakyTestsStatus: [
@@ -1400,16 +1241,6 @@ export const engineeringAnalyticsLogic: LogicWrapper<engineeringAnalyticsLogicTy
loadFlakyTestsFailure: (_, { errorObject }) => loaderStatusFromError(errorObject),
},
],
- // Prototype panel reads two views directly; if either isn't provisioned the query errors,
- // which the panel surfaces in-place instead of crashing the tab.
- brokenTestsError: [
- null as string | null,
- {
- loadBrokenTests: () => null,
- loadBrokenTestsSuccess: () => null,
- loadBrokenTestsFailure: (_, { error }) => error ?? 'Could not load broken tests.',
- },
- ],
quarantineModal: [
null as QuarantineModalState | null,
{
@@ -1620,28 +1451,6 @@ export const engineeringAnalyticsLogic: LogicWrapper<engineeringAnalyticsLogicTy
(filters: QuarantineFilters): boolean =>
!objectsEqual({ ...filters, search: filters.search.trim() }, DEFAULT_QUARANTINE_FILTERS),
],
- // Classified rows come pre-ranked from the endpoint (severity, then last_seen desc).
- brokenTests: [
- (s) => [s.brokenTestsData],
- (brokenTestsData: BrokenTestsData | null): BrokenTestRow[] => brokenTestsData?.rows ?? [],
- ],
- breakingMasterJobs: [
- (s) => [s.brokenTestsData],
- (brokenTestsData: BrokenTestsData | null): string[] => brokenTestsData?.breakingMasterJobs ?? [],
- ],
- brokenTestsWindowDays: [
- (s) => [s.brokenTestsData],
- (brokenTestsData: BrokenTestsData | null): number => brokenTestsData?.windowDays ?? 2,
- ],
- hiddenBrokenTestCount: [
- (s) => [s.brokenTests],
- (brokenTests: BrokenTestRow[]): number => brokenTests.filter((row) => row.state === 'pr_only').length,
- ],
- visibleBrokenTests: [
- (s) => [s.brokenTests, s.showPrOnlyBrokenTests],
- (brokenTests: BrokenTestRow[], showPrOnly: boolean): BrokenTestRow[] =>
- showPrOnly ? brokenTests : brokenTests.filter((row) => row.state !== 'pr_only'),
- ],
hasMultipleSources: [
(s) => [s.githubSources],
(githubSources: GitHubSourceApi[]): boolean => githubSources.length > 1,
@@ -1725,7 +1534,6 @@ export const engineeringAnalyticsLogic: LogicWrapper<engineeringAnalyticsLogicTy
actions.loadWorkflowHealth()
actions.loadQuarantine()
actions.loadFlakyTests()
- actions.loadBrokenTests()
},
setFlakyTestWindow: () => actions.loadFlakyTests(),
setSourceId: () => actions.refresh(),
diff --git a/products/engineering_analytics/frontend/scenes/repoOverviewLogic.ts b/products/engineering_analytics/frontend/scenes/repoOverviewLogic.ts
index c6fa3e3d835d..627074a4b1fe 100644
--- a/products/engineering_analytics/frontend/scenes/repoOverviewLogic.ts
+++ b/products/engineering_analytics/frontend/scenes/repoOverviewLogic.ts
@@ -5,31 +5,16 @@ import { ApiConfig } from 'lib/api'
import { dayjs } from 'lib/dayjs'
import type { ActivityRun } from '../components/RunActivityChart'
-import {
- engineeringAnalyticsCurrentBranchHealth,
- engineeringAnalyticsMasterFailures,
- engineeringAnalyticsRepoOverview,
- engineeringAnalyticsRepoRunActivity,
- engineeringAnalyticsRunFailureLogs,
-} from '../generated/api'
-import type {
- CurrentBranchHealthApi,
- MasterFailureGroupApi,
- RepoOverviewApi,
- RunFailureLogsApi,
- WorkflowRunActivityApi,
-} from '../generated/api.schemas'
+import { engineeringAnalyticsRepoOverview, engineeringAnalyticsRepoRunActivity } from '../generated/api'
+import type { RepoOverviewApi, WorkflowRunActivityApi } from '../generated/api.schemas'
import { ciStatusOf } from '../lib/ci'
import { HUB_PREVIEW_MAX, HUB_PREVIEW_ROWS, HUB_PREVIEW_STEP } from '../lib/preview'
import { engineeringAnalyticsFiltersLogic } from './engineeringAnalyticsFiltersLogic'
import { PullRequestRow, STUCK_AFTER_DAYS, engineeringAnalyticsLogic, isStuck } from './engineeringAnalyticsLogic'
-import type { CardsData, WorkflowHealthRow } from './engineeringAnalyticsLogic'
+import type { WorkflowHealthRow } from './engineeringAnalyticsLogic'
const projectId = (): string => String(ApiConfig.getCurrentProjectId())
-// Pinned to 24h regardless of the shared window — a week of failures is a firehose at monorepo volume.
-const MASTER_FAILURES_WINDOW = '-24h'
-
const TOP_COST_WORKFLOWS = 5
export interface CostShareRow {
@@ -38,17 +23,10 @@ export interface CostShareRow {
share: number
}
-export interface CurrentHealthSummary {
- settledWorkflows: number
- failingNow: number
- failingWorkflowNames: string[]
-}
-
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface repoOverviewLogicValues {
dateFrom: string | null // engineeringAnalyticsFiltersLogic
dateTo: string | null // engineeringAnalyticsFiltersLogic
- cards: CardsData | null // engineeringAnalyticsLogic
notConnected: boolean // engineeringAnalyticsLogic
pullRequests: PullRequestRow[] // engineeringAnalyticsLogic
pullRequestsLoading: boolean // engineeringAnalyticsLogic
@@ -65,17 +43,8 @@ export interface repoOverviewLogicValues {
labels: string[]
values: number[]
} | null
- currentBranchHealth: CurrentBranchHealthApi | null
- currentBranchHealthFailed: boolean
- currentBranchHealthLoading: boolean
- currentDefaultBranch: string
- currentHealthSummary: CurrentHealthSummary
draftCount: number
- failureLogs: Record<number, RunFailureLogsApi | 'unavailable'>
- failureLogsLoading: boolean
jobsAvailable: boolean
- masterFailures: MasterFailureGroupApi[]
- masterFailuresLoading: boolean
openToMergeSeries: {
labels: string[]
values: number[]
@@ -102,60 +71,6 @@ export interface repoOverviewLogicValues {
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface repoOverviewLogicActions {
- loadCurrentBranchHealth: (_: void) => void
- loadCurrentBranchHealthFailure: (
- error: string,
- errorObject?: any
- ) => {
- error: string
- errorObject?: any
- }
- loadCurrentBranchHealthSuccess: (
- currentBranchHealth: CurrentBranchHealthApi,
- payload?: void
- ) => {
- currentBranchHealth: CurrentBranchHealthApi
- payload?: void
- }
- loadFailureLogs: ({ runId }: { runId: number }) => {
- runId: number
- }
- loadFailureLogsFailure: (
- error: string,
- errorObject?: any
- ) => {
- error: string
- errorObject?: any
- }
- loadFailureLogsSuccess: (
- failureLogs: Record<number, RunFailureLogsApi | 'unavailable'>,
- payload?: {
- runId: number
- }
- ) => {
- failureLogs: Record<number, RunFailureLogsApi | 'unavailable'>
- payload?: {
- runId: number
- }
- }
- loadLogsForRun: (runId: number) => {
- runId: number
- }
- loadMasterFailures: () => any
- loadMasterFailuresFailure: (
- error: string,
- errorObject?: any
- ) => {
- error: string
- errorObject?: any
- }
- loadMasterFailuresSuccess: (
- masterFailures: MasterFailureGroupApi[],
- payload?: any
- ) => {
- masterFailures: MasterFailureGroupApi[]
- payload?: any
- }
loadOverview: () => any
loadOverviewFailure: (
error: string,
@@ -199,11 +114,6 @@ export interface repoOverviewLogicMeta {
__keaTypeGenInternalSelectorTypes: {
jobsAvailable: (overview: RepoOverviewApi | null) => boolean
overviewDefaultBranch: (overview: RepoOverviewApi | null) => string
- currentDefaultBranch: (
- currentBranchHealth: CurrentBranchHealthApi | null,
- overviewDefaultBranch: string
- ) => string
- currentHealthSummary: (currentBranchHealth: CurrentBranchHealthApi | null) => CurrentHealthSummary
activityRuns: (repoActivity: WorkflowRunActivityApi) => ActivityRun[]
activityTruncated: (repoActivity: WorkflowRunActivityApi) => boolean
attentionPrs: (pullRequests: PullRequestRow[]) => PullRequestRow[]
@@ -250,7 +160,6 @@ export const repoOverviewLogic = kea<repoOverviewLogicType>([
'scopeRepo',
'pullRequests',
'pullRequestsLoading',
- 'cards',
'workflowHealth',
'workflowHealthLoading',
'notConnected',
@@ -259,7 +168,6 @@ export const repoOverviewLogic = kea<repoOverviewLogicType>([
})),
actions({
- loadLogsForRun: (runId: number) => ({ runId }),
showMorePrs: true,
showMoreWorkflows: true,
}),
@@ -277,32 +185,8 @@ export const repoOverviewLogic = kea<repoOverviewLogicType>([
}),
},
],
- masterFailures: [
- [] as MasterFailureGroupApi[],
- {
- loadMasterFailures: async (): Promise<MasterFailureGroupApi[]> =>
- await engineeringAnalyticsMasterFailures(projectId(), {
- date_from: MASTER_FAILURES_WINDOW,
- source_id: values.sourceId ?? undefined,
- repo: values.scopeRepo ?? undefined,
- }),
- },
- ],
- currentBranchHealth: [
- null as CurrentBranchHealthApi | null,
- {
- loadCurrentBranchHealth: async (_: void, breakpoint): Promise<CurrentBranchHealthApi> => {
- const health = await engineeringAnalyticsCurrentBranchHealth(projectId(), {
- source_id: values.sourceId ?? undefined,
- repo: values.scopeRepo ?? undefined,
- })
- breakpoint()
- return health
- },
- },
- ],
// One collapsed point per default-branch commit (all its workflows folded together) for the
- // master-health scatter — the backend owns the collapse, so the UI just plots the points.
+ // master-health strip — the backend owns the collapse, so the UI just plots the points.
repoActivity: [
{ points: [], truncated: false, limit: 0 } as WorkflowRunActivityApi,
{
@@ -315,28 +199,6 @@ export const repoOverviewLogic = kea<repoOverviewLogicType>([
}),
},
],
- // 'unavailable' marks a failed fetch so we don't retry on every expand.
- failureLogs: [
- {} as Record<number, RunFailureLogsApi | 'unavailable'>,
- {
- loadFailureLogs: async ({
- runId,
- }: {
- runId: number
- }): Promise<Record<number, RunFailureLogsApi | 'unavailable'>> => {
- try {
- const logs = await engineeringAnalyticsRunFailureLogs(projectId(), {
- run_id: runId,
- source_id: values.sourceId ?? undefined,
- repo: values.scopeRepo ?? undefined,
- })
- return { ...values.failureLogs, [runId]: logs }
- } catch {
- return { ...values.failureLogs, [runId]: 'unavailable' }
- }
- },
- },
- ],
})),
reducers({
@@ -359,14 +221,6 @@ export const repoOverviewLogic = kea<repoOverviewLogicType>([
loadRepoActivityFailure: () => true,
},
],
- currentBranchHealthFailed: [
- false,
- {
- loadCurrentBranchHealth: () => false,
- loadCurrentBranchHealthSuccess: () => false,
- loadCurrentBranchHealthFailure: () => true,
- },
- ],
// How many rows the hub's preview tables show. Start short (HUB_PREVIEW_ROWS), grow by a fixed
// step on "Show more", capped so the hub stays a preview — the full tables live on the dedicated
// pages. No reset on reload: slicing tolerates any list length, and keeping the user's expansion
@@ -390,20 +244,7 @@ export const repoOverviewLogic = kea<repoOverviewLogicType>([
(s) => [s.overview],
(overview: RepoOverviewApi | null): string => overview?.default_branch ?? 'master',
],
- currentDefaultBranch: [
- (s) => [s.currentBranchHealth, s.overviewDefaultBranch],
- (currentBranchHealth: CurrentBranchHealthApi | null, overviewDefaultBranch: string): string =>
- currentBranchHealth?.default_branch ?? overviewDefaultBranch,
- ],
- currentHealthSummary: [
- (s) => [s.currentBranchHealth],
- (currentBranchHealth: CurrentBranchHealthApi | null): CurrentHealthSummary => ({
- settledWorkflows: currentBranchHealth?.settled_workflows ?? 0,
- failingNow: currentBranchHealth?.failing_workflows ?? 0,
- failingWorkflowNames: currentBranchHealth?.failing_workflow_names ?? [],
- }),
- ],
- // Backend-collapsed commit points, mapped to the shared chart shape (one dot per default-branch
+ // Backend-collapsed commit points, mapped to the shared chart shape (one bar per default-branch
// commit: start time, wall-clock CI duration, overall verdict).
activityRuns: [
(s) => [s.repoActivity],
@@ -565,36 +406,23 @@ export const repoOverviewLogic = kea<repoOverviewLogicType>([
],
}),
- listeners(({ actions, values }) => ({
- loadLogsForRun: ({ runId }) => {
- if (!(runId in values.failureLogs)) {
- actions.loadFailureLogs({ runId })
- }
- },
- // The failures feed is pinned to -24h, so it only re-reads on source change / refresh; the
- // activity scatter follows the shared window like the overview tiles.
+ listeners(({ actions }) => ({
[engineeringAnalyticsFiltersLogic.actionTypes.setDateRange]: () => {
actions.loadOverview()
actions.loadRepoActivity()
},
[engineeringAnalyticsLogic.actionTypes.setSourceId]: () => {
actions.loadOverview()
- actions.loadCurrentBranchHealth()
- actions.loadMasterFailures()
actions.loadRepoActivity()
},
[engineeringAnalyticsLogic.actionTypes.refresh]: () => {
actions.loadOverview()
- actions.loadCurrentBranchHealth()
- actions.loadMasterFailures()
actions.loadRepoActivity()
},
})),
afterMount(({ actions }) => {
actions.loadOverview()
- actions.loadCurrentBranchHealth()
- actions.loadMasterFailures()
actions.loadRepoActivity()
}),
])