: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(eng-analytics): devex fixes from blind usability testing (#115495)
Julian Bezeba9156b5e8c
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex ce2e91e20927..94fe91ff7acb 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -10171,25 +10171,25 @@ snapshots:scenes-app-engineering-analytics-lead-time-box-plot--horizontal-log-scale--light:hash: v1.k794b7964.bc3a9455717626ef2f9541e03740bd0027c89139cd54ba4eb57a883d0e222667.OlAdmRvrHHSpGH8a2jHqV60Z957X8hIrNlcY9Duvv9Ascenes-app-engineering-analytics-pull-request--merged--dark:- hash: v1.k794b7964.47a2880202b02bb43d0ad1f19ba771d5a54d92ba1ae001bbf72b35371e19cc3c.k1yihnihPaTG_Uq01fK4XRb9Yl8npdf7eCww6SWlaSA+ hash: v1.k794b7964.cfa95ee3ba1f33eb810abdfab9dcd5a9310eebfa6980f0c25c3b5bef018df6c3.kRQLDy_o49HMTWk59KNhBRgruGdLwXTWtJKID35xbtkscenes-app-engineering-analytics-pull-request--merged--light:- hash: v1.k794b7964.3a01727ae63ec133f77361655eb8250e5ce24140289f455c3031aea2e4dbd014.8Zi95ISEKV_XYezI20q8cXuzgR88jg_NzbgBrLkquQ8+ hash: v1.k794b7964.9d7169ecf7fcde9ae1db3ab295ef573b326ade9e845b39d2ecb015cf36d37a16.ebUmViA0mm2a-ejX8gGTDWKz-KXuKjZ4s6-dfPi7290scenes-app-engineering-analytics-pull-request--out-of-the-merge-queue--dark:- hash: v1.k794b7964.35ee45735fdf0dcb12e2d67cb5b9b9cd1aaba455ce97738daf2dd916466c9e0b.uv8aAw7tKaVObN2jrVxLo2UK30qPTiqoRFVJ4P6pm24+ hash: v1.k794b7964.2df5b530fac3f1f3382e303a58ef6676857eb1cae6374009b1e50068cfca47ef.9trVDkB8z3JHxUTAvQ_POCWnGsU8YlpdI-iUyZ4l-UAscenes-app-engineering-analytics-pull-request--out-of-the-merge-queue--light:- hash: v1.k794b7964.07c8c7ca126fa2f0440103062315898d3bf6e34025e2f70ca6c912f9ceb0f4ad.6OoSv6aB1RglnwxoetlMdIC7cUkatAQB1qLExL5aK0A+ hash: v1.k794b7964.88a465845cea19b9c2a2978d5ebd32f7b2e0855ad4c811381fc709e5a3c86776.D1RYpIxamLomvbpClGc_24NAbokt_xGdmN7nqHFeWA0scenes-app-engineering-analytics-pull-request--section-load-errors--dark:hash: v1.k794b7964.0afaedfa37c206f596d077bf9c3bf1c2e4796ae2766ac8bf3f731c1a9f8cd7d8.QTSqaIlk5JU2ILV3SdefnQb7uc3mXYy13jpItpyGg6Mscenes-app-engineering-analytics-pull-request--section-load-errors--light:hash: v1.k794b7964.b9e2a9e84eb666481eb303f5f97dbe8284b89e9316e4c793bb1a189edbf3a98d.jlYwHaG_fAyElPt4Easkh-s3dEuLiYqW4HFCa2GNRGMscenes-app-engineering-analytics-repo-overview--repo-overview--dark:- hash: v1.k794b7964.854c67f402bf95534da02c340ae86a35d920abfaaee1a02a767d0bf78e5b0b96.zdnyT0ByGO8xNmGe772cUqEy1Bqkkiwb7z6ktyB7Y_k+ hash: v1.k794b7964.077cfb3dcac2efee05dc6a05d8f1d9cc2e9c16ef5b3bc051483e4028ec183946.deNllNcvsAVJ8en4lFZMNs_PLIDnPylJAWoL4NbICgwscenes-app-engineering-analytics-repo-overview--repo-overview--light:- hash: v1.k794b7964.6a312af19dd20a14cdd8737d1d401c78a62f9e7bc432336e96f1a06a42b85cd3.ccnjRlUTAC8KfwCvuMy3-US5GTW4dY-C7JhMSaE02b4+ hash: v1.k794b7964.42c8dd908c805d1407de2b7b89cb18b03a0e1bb36a1bbe658e5d290a15703af2.8_CCzIg7IRKZwTlD4YfR0aqDWAfxWhBeuugC6bnEpO0scenes-app-engineering-analytics-repo-overview--repo-overview-with-trunk-queue-data--dark:- hash: v1.k794b7964.e41516eb5d7528bb6cdafcfed7b945bdfff57705006e5b1501fe1df83801bcb0.8wlIRFK9SKD4l-ylc5-bSGqoR3zc6Vl7tJ0YuTX8jBI+ hash: v1.k794b7964.077cfb3dcac2efee05dc6a05d8f1d9cc2e9c16ef5b3bc051483e4028ec183946.ui64LHDiZfvlBAFwcmPG0dnXOSdTw9vT_V4vgac24_Mscenes-app-engineering-analytics-repo-overview--repo-overview-with-trunk-queue-data--light:- hash: v1.k794b7964.35cebfe769e744738260c1b98c6cbf3223bb0413a8e32bef243d07af3299163e.HB5Ni0JKUikZ2M5KucMLI89Kj3TkxPurMONhWDoQz_w+ hash: v1.k794b7964.42c8dd908c805d1407de2b7b89cb18b03a0e1bb36a1bbe658e5d290a15703af2.ItEacHg6ph-2ceZCSKBA8TNsBGIi32Zc85R1t9Z6RwMscenes-app-engineering-analytics-run-activity-chart--default--dark:hash: v1.k794b7964.7f17c5ac7c6862493f7c4d59e6e3c3146c42e3d7b08908ee1716d387c129ba64.lPsE9KrOSZee9wJq8zjqYnvk09numvEFWOn4mdCOgJEscenes-app-engineering-analytics-run-activity-chart--default--light:@@ -10231,17 +10231,17 @@ snapshots:scenes-app-engineering-analytics-tests--trunk-quarantine-debt-owners-unavailable--light:hash: v1.k794b7964.7b7f303bf22453a8d6eb96843474d0a59a32380952dffc7664d54813929b4fbd.gi92G3lpZOydZUdHvBu8AhXUgFoxHrTb3vpO1WHLreEscenes-app-engineering-analytics-workflow--workflow-detail--dark:- hash: v1.k794b7964.8076b6df9380cff51ae9dcabd18b56ecf33fd0c79d5c737ad0a923d8f46927a8.--p9iekv7i9kfLDbeo-Q2x5QyLEVGmHy3ycGGw6Zeqk+ hash: v1.k794b7964.1132baa645ded0d70abc360942d20068924331001a3a99046c3e746dfbbf1e35.dLHGZ-aDc-qgyY7CTPv2vSRMWGJep13Gw5CxFdXXkEcscenes-app-engineering-analytics-workflow--workflow-detail--light:- hash: v1.k794b7964.7d4f81636b0bafd3b7ccbf295ec9b49f24cb43b48472a59d82836dc272dc77d7.aG-GxW4n0g2sdnA_ixeR1EEgVUBJFc4nmdnh2eR8Aes+ hash: v1.k794b7964.b2a14120c4df9a52509de5392723bfcb14cb81128fba8f3ba4b499a0f134c6cf.qAxBUafAs5RsmXJx-49jIxS03fzjtji4i9K7HGZ0oqIscenes-app-engineering-analytics-workflow--workflow-detail-scoped-to-pull-requests--dark:- hash: v1.k794b7964.e810f8df37894094a14dffc9bffddb5fe7e285010f0905b6e2939f6e44b6ed9b.5f7tkQpkUdlrV6EG3dVmzWJspzZ-WuINVYpPMTHyWR0+ hash: v1.k794b7964.889b5ab67fa7293dd20beaebeb6e3ea532aeca6344117d07050ad8142e88326d.hek4_r2-WlU60IFgM7viY_W63krkieL82GVmeT0Xhi0scenes-app-engineering-analytics-workflow--workflow-detail-scoped-to-pull-requests--light:- hash: v1.k794b7964.766c2f13d85693a00089417345ed61b339aea96d1106af206cee96fb37d65671.tYzxZL78bKqvUm1gA65olN1upDKjYvf4UlaayqNhlGY+ hash: v1.k794b7964.b9a798d0633f8970ccbc1895d1e47377916613be6d8104b881fd10eb05ba5e9f.TgqGfPMycY2VS7EKGgfdBoh5hlokFh4_25NbhBYSmjYscenes-app-engineering-analytics-workflow--workflow-detail-section-load-errors--dark:- hash: v1.k794b7964.1138e5d885f169ffa0619c3084ed98c52d0e0d9c50495114716a6c51876df00e.WtOFtpae27Ff_bRa4lJQc7WjeR4k90SEi3jx2GRAoXc+ hash: v1.k794b7964.5697e0d891db7e06b7e8e16b5e3abd8e5302cf6aa680d0b1336b23b9e87a524a.Jj7T7C_NtnkG38Bcd2cIow_jqN1TR5LYEkz7W8m23a0scenes-app-engineering-analytics-workflow--workflow-detail-section-load-errors--light:- hash: v1.k794b7964.84f8223fcaa0e115cd1f9ee5f5198a9af1a51270c7bc10fdc9ebd1b5616708eb.23dbZo3jWrrPpnetF_gpnOvNz3FsB8Z80ovfVXiFsmE+ hash: v1.k794b7964.195e5a4f86daf73d83fda292f45b2c2d146e4f04f9587a20336b0430ecc53925.qvN29ywYqV9EWLwwfwoIGczIX_5--0uSrVZEwM6Cobcscenes-app-engineering-analytics-workflow-run--depot-run--dark:hash: v1.k794b7964.700c8e576002a8ee86244357b292b70ce82ff204414e001f67ac70908178f246.fCt9_ACi4OPiDvNY1z_1iu04-E4zW42XoVXunMJoDa0scenes-app-engineering-analytics-workflow-run--depot-run--light:diff --git a/frontend/src/products.tsx b/frontend/src/products.tsxindex a81bfb781982..c59e8b45b0c9 100644--- a/frontend/src/products.tsx+++ b/frontend/src/products.tsx@@ -2599,7 +2599,7 @@ export const getTreeItemsProducts = (): FileSystemImport[] => ['var(--color-product-engineering-analytics-dark)',],href: urls.engineeringAnalytics(),- searchKeywords: ['dora', 'ci health', 'cycle time'],+ searchKeywords: ['ci', 'ci health', 'ci cost', 'github actions', 'build minutes', 'dora', 'cycle time'],searchTabs: [{ name: 'Pull requests', href: urls.engineeringAnalyticsPullRequestList() },{ name: 'CI workflows', href: urls.engineeringAnalyticsWorkflows() },diff --git a/products/engineering_analytics/backend/logic/queries/ci_failure_logs.py b/products/engineering_analytics/backend/logic/queries/ci_failure_logs.pyindex 417a92f3b4fd..a9c4fcab502d 100644--- a/products/engineering_analytics/backend/logic/queries/ci_failure_logs.py+++ b/products/engineering_analytics/backend/logic/queries/ci_failure_logs.py@@ -55,7 +55,8 @@ _SELECT = """WHERE service_name = {service_name} AND lower(attributes['repo']) = lower({repository})AND ((attributes['ci_engine'], attributes['run_id']) IN {run_keys}- OR (attributes['ci_engine'] = '' AND attributes['run_id'] IN {legacy_run_ids})+ -- HogQL reads a missing map key as NULL, and legacy lines carry no ci_engine key at all.+ OR (coalesce(attributes['ci_engine'], '') = '' AND attributes['run_id'] IN {legacy_run_ids}))ORDER BY toInt(attributes['run_id']) DESC, attributes['ci_engine'], toInt(attributes['job_id']), toInt(attributes['seq'])LIMIT {line_cap}diff --git a/products/engineering_analytics/backend/tests/test_ci_failure_logs.py b/products/engineering_analytics/backend/tests/test_ci_failure_logs.pyindex bf554906c8a0..576371334822 100644--- a/products/engineering_analytics/backend/tests/test_ci_failure_logs.py+++ b/products/engineering_analytics/backend/tests/test_ci_failure_logs.py@@ -1,9 +1,19 @@+import jsonfrom types import SimpleNamespace+from typing import Any+from posthog.test.base import BaseTest, ClickhouseTestMixinfrom unittest import mock+from parameterized import parameterized++from posthog.clickhouse.client import sync_execute+from products.engineering_analytics.backend.facade.contracts import CIEngine, RepoRef, WorkflowRunDetail+from products.engineering_analytics.backend.logic.job_logs.constants import CI_LOGS_SERVICE_NAMEfrom products.engineering_analytics.backend.logic.queries import ci_failure_logs as module+from products.engineering_analytics.backend.logic.queries._curated import CuratedGitHubSource+from products.engineering_analytics.backend.logic.sources import GitHubTablesdef _run(run_id: int) -> WorkflowRunDetail:@@ -109,3 +119,42 @@ def test_overall_cap_flags_the_clipped_tail_job(monkeypatch):assert [job.job_id for job in result.jobs] == [9, 8]assert result.jobs[0].truncated is False # job 9 is whole, within the capassert result.jobs[-1].truncated is True # job 8 was clipped by the overall cap+++class TestRunFailureLogsOverClickHouse(ClickhouseTestMixin, BaseTest):+ def _failure_log(self, *, body: str, seq: int, ci_engine: str | None) -> dict[str, Any]:+ # attributes_map_str keys carry the "__str" suffix the logs table strips for the queryable map.+ attributes = {+ "repo__str": "o/r",+ "run_id__str": "100",+ "job_id__str": "9",+ "conclusion__str": "failure",+ "seq__str": str(seq),+ }+ if ci_engine is not None:+ attributes["ci_engine__str"] = ci_engine+ return {+ "team_id": self.team.id,+ "timestamp": "2026-07-10 12:00:00.000000",+ "body": body,+ "service_name": CI_LOGS_SERVICE_NAME,+ "attributes_map_str": attributes,+ }++ @parameterized.expand([("legacy_line_without_engine", None), ("stamped_line", "github_actions")])+ def test_returns_lines_for_a_github_actions_run(self, _name: str, ci_engine: str | None) -> None:+ row = self._failure_log(body="FAILED test_x", seq=0, ci_engine=ci_engine)+ sync_execute(f"INSERT INTO logs FORMAT JSONEachRow\n{json.dumps(row)}\n")+ curated = CuratedGitHubSource(+ team=self.team,+ tables=GitHubTables(pull_requests="unused", workflow_runs="unused", workflow_jobs=None, repository="o/r"),+ )+ # The run lookups read the warehouse; this test covers only the logs read.+ with (+ mock.patch.object(module, "query_workflow_run", return_value=_run(100)),+ mock.patch.object(module, "_legacy_run_ids", return_value=["100"]),+ ):+ result = module.query_run_failure_logs(curated=curated, run_id=100, ci_engine=CIEngine.GITHUB_ACTIONS)++ assert result.logs_available is True+ assert [[line.text for line in job.lines] for job in result.jobs] == [["FAILED test_x"]]diff --git a/products/engineering_analytics/frontend/components/FailureLogs.tsx b/products/engineering_analytics/frontend/components/FailureLogs.tsxindex 9834e2782ea4..7863f19350c4 100644--- a/products/engineering_analytics/frontend/components/FailureLogs.tsx+++ b/products/engineering_analytics/frontend/components/FailureLogs.tsx@@ -47,20 +47,28 @@ function JobFailureLog({ job, jobName }: { job: CIJobFailureLogApi; jobName?: st/*** A set of failed jobs with their log excerpts, straight from the loader's union: ``null`` is the- * not-loaded state, ``'unavailable'`` a failed fetch, and ``logs_available === false`` means the run- * didn't fail or its logs aged out of retention.+ * not-loaded state, ``'unavailable'`` a failed fetch, and ``logs_available === false`` means no log lines+ * were collected or they aged out of retention. Callers render this only for a run known to have failed,+ * so the empty text must not suggest that nothing failed.*/export function FailureLogGroups({logs,loading,onRetry,jobNames,- errorDescription = 'Retry, or open the run on GitHub to read its logs.',- emptyText = 'No failure logs. Nothing failed, or the logs have aged out of retention.',+ logsOnGitHub,+ errorDescription = logsOnGitHub+ ? 'Retry, or open the run on GitHub to read its logs.'+ : 'Retry, or read the run logs in your CI provider.',+ emptyText = `Failure logs aren't available for this run. They weren't collected, or they've aged out of retention. ${+ logsOnGitHub ? 'Open the run on GitHub to read its logs.' : 'Read the run logs in your CI provider.'+ }`,}: {logs: { jobs: CIJobFailureLogApi[]; logs_available: boolean } | 'unavailable' | null | undefinedloading: booleanonRetry: () => void+ /** Only GitHub Actions runs have a GitHub page to send the reader to. */+ logsOnGitHub: boolean/** job_id → display name, when the caller has the run's jobs loaded, because logs only carry ids. */jobNames?: Record<number, string>errorDescription?: stringdiff --git a/products/engineering_analytics/frontend/components/JobAggregatesTable.tsx b/products/engineering_analytics/frontend/components/JobAggregatesTable.tsxindex bb998907a228..1a5655c9cf3d 100644--- a/products/engineering_analytics/frontend/components/JobAggregatesTable.tsx+++ b/products/engineering_analytics/frontend/components/JobAggregatesTable.tsx@@ -28,7 +28,7 @@ function DurationSpread({ p50, p95, max }: { p50: number | null; p95: number | nreturn (<Tooltip title={`median ${formatSeconds(p50)} · p95 ${formatSeconds(p95)}`}><div className="flex items-center gap-2">- <div className="relative h-1.5 w-24 shrink-0 overflow-hidden rounded-full bg-fill-tertiary">+ <div className="relative h-1.5 w-12 shrink-0 overflow-hidden rounded-full bg-fill-tertiary @min-[56rem]/jobs:w-24"><spanclassName="absolute inset-y-0 left-0 rounded-full opacity-30"// eslint-disable-next-line react/forbid-dom-props@@ -58,124 +58,137 @@ export function JobAggregatesTable({}): JSX.Element {// Scale every duration bar to the slowest job's p95, so bar lengths compare directly across rows.const maxP95 = Math.max(1, ...aggregates.map((a) => a.p95_seconds ?? a.p50_seconds ?? 0))+ // The container queries follow the space the table gets, not the window. A narrow scene (for example+ // with the side panel open) drops the low-priority columns instead of pushing Cost out of view.return (- <LemonTable<WorkflowJobAggregateApi>- dataSource={aggregates}- loading={loading}- size="small"- rowKey={(row) => row.job_name}- useURLForSorting={false}- columns={[- {- title: 'Job',- key: 'job',- sorter: (a, b) => a.job_name.localeCompare(b.job_name),- render: (_, row) => (- <span className="flex items-center gap-2">- <span className="font-mono text-xs">{row.job_name}</span>- {row.shard_count > 1 && <LemonTag type="muted">×{row.shard_count} matrix</LemonTag>}- </span>- ),- },- {- title: 'Runs in',- key: 'runShare',- align: 'right',- tooltip: 'Share of workflow runs this job ran in. Below 100% means the job is conditional.',- sorter: (a, b) => (a.run_share ?? -1) - (b.run_share ?? -1),- render: (_, row) => (- <span- className={- row.run_share != null && row.run_share < 0.995- ? 'text-xs tabular-nums text-secondary'- : 'text-xs tabular-nums'- }- >- {row.run_share != null ? `${percent(Math.min(1, row.run_share))} of runs` : '—'}- </span>- ),- },- {- title: 'Queue p50',- key: 'queue',- align: 'right',- tooltip: 'Median wait from job created to started. Long waits point to runner capacity problems.',- sorter: (a, b) => (a.queue_p50_seconds ?? -1) - (b.queue_p50_seconds ?? -1),- render: (_, row) => (- <span className="text-xs tabular-nums text-tertiary">- {formatSeconds(row.queue_p50_seconds)}- </span>- ),- },- {- title: 'Duration',- key: 'duration',- tooltip:- 'Median (p50) out to 95th-percentile duration over successful instances, as a bar scaled to the slowest job. The solid part reaches the median; the light tail runs out to p95.',- sorter: (a, b) => (a.p50_seconds ?? -1) - (b.p50_seconds ?? -1),- render: (_, row) => <DurationSpread p50={row.p50_seconds} p95={row.p95_seconds} max={maxP95} />,- },- {- title: 'Failure rate',- key: 'failureRate',- align: 'right',- tooltip:- 'Job instances that failed, timed out, failed to start, or went stale, out of instances that passed or failed. Skipped and canceled instances are left out.',- sorter: (a, b) => (a.failure_rate ?? -1) - (b.failure_rate ?? -1),- render: (_, row) => (- <span- className={- (row.failure_rate ?? 0) > 0.05- ? 'text-xs font-semibold tabular-nums text-danger'- : 'text-xs tabular-nums'- }- >- {row.failure_rate != null ? percent(row.failure_rate) : '—'}- </span>- ),- },- {- title: 'Retries',- key: 'retries',- align: 'right',- tooltip:- 'Job instances that ran on a second or later attempt. Frequent re-runs usually point to flaky checks.',- sorter: (a, b) => a.retry_job_count - b.retry_job_count,- render: (_, row) => (- <span className="text-xs tabular-nums">{humanFriendlyNumber(row.retry_job_count)}</span>- ),- },- {- title: 'Cost',- key: 'cost',- align: 'right',- tooltip:- 'Estimated cost over billable (self-hosted) runners. "—" when there is no billable figure: GitHub-hosted, an unrecognized runner, or no finished instance yet.',- sorter: (a, b) => (a.estimated_cost_usd ?? -1) - (b.estimated_cost_usd ?? -1),- render: (_, row) => {- if (row.estimated_cost_usd == null) {- return <span className="text-xs text-tertiary">—</span>- }- const share = totalCostUsd && totalCostUsd > 0 ? row.estimated_cost_usd / totalCostUsd : null- return (- <Tooltip- title={- <BillableBadge minutes={row.billable_minutes} costUsd={row.estimated_cost_usd} />+ <div className="@container/jobs">+ <LemonTable<WorkflowJobAggregateApi>+ dataSource={aggregates}+ loading={loading}+ size="small"+ rowKey={(row) => row.job_name}+ useURLForSorting={false}+ columns={[+ {+ title: 'Job',+ key: 'job',+ className: 'w-full',+ sorter: (a, b) => a.job_name.localeCompare(b.job_name),+ render: (_, row) => (+ <span className="flex flex-wrap items-center gap-x-2 gap-y-1">+ <span className="font-mono text-xs break-words">{row.job_name}</span>+ {row.shard_count > 1 && <LemonTag type="muted">×{row.shard_count} matrix</LemonTag>}+ </span>+ ),+ },+ {+ title: 'Runs in',+ key: 'runShare',+ align: 'right',+ className: 'hidden @min-[48rem]/jobs:table-cell',+ tooltip: 'Share of workflow runs this job ran in. Below 100% means the job is conditional.',+ sorter: (a, b) => (a.run_share ?? -1) - (b.run_share ?? -1),+ render: (_, row) => (+ <span+ className={+ row.run_share != null && row.run_share < 0.995+ ? 'text-xs tabular-nums text-secondary'+ : 'text-xs tabular-nums'}>- <span className="text-xs tabular-nums whitespace-nowrap">- {compactUsd(row.estimated_cost_usd)}- {share != null && <span className="ml-1 text-tertiary">{percent(share)}</span>}- </span>- </Tooltip>- )+ {row.run_share != null ? percent(Math.min(1, row.run_share)) : '—'}+ </span>+ ),+ },+ {+ title: 'Queue p50',+ key: 'queue',+ align: 'right',+ className: 'hidden @min-[48rem]/jobs:table-cell',+ tooltip:+ 'Median wait from job created to started. Long waits point to runner capacity problems.',+ sorter: (a, b) => (a.queue_p50_seconds ?? -1) - (b.queue_p50_seconds ?? -1),+ render: (_, row) => (+ <span className="text-xs tabular-nums text-tertiary">+ {formatSeconds(row.queue_p50_seconds)}+ </span>+ ),+ },+ {+ title: 'Duration',+ key: 'duration',+ tooltip:+ 'Median (p50) out to 95th-percentile duration over successful instances, as a bar scaled to the slowest job. The solid part reaches the median; the light tail runs out to p95.',+ sorter: (a, b) => (a.p50_seconds ?? -1) - (b.p50_seconds ?? -1),+ render: (_, row) => <DurationSpread p50={row.p50_seconds} p95={row.p95_seconds} max={maxP95} />,+ },+ {+ title: 'Failure rate',+ key: 'failureRate',+ align: 'right',+ tooltip:+ 'Job instances that failed, timed out, failed to start, or went stale, out of instances that passed or failed. Skipped and canceled instances are left out.',+ sorter: (a, b) => (a.failure_rate ?? -1) - (b.failure_rate ?? -1),+ render: (_, row) => (+ <span+ className={+ (row.failure_rate ?? 0) > 0.05+ ? 'text-xs font-semibold tabular-nums text-danger'+ : 'text-xs tabular-nums'+ }+ >+ {row.failure_rate != null ? percent(row.failure_rate) : '—'}+ </span>+ ),+ },+ {+ title: 'Retries',+ key: 'retries',+ align: 'right',+ className: 'hidden @min-[48rem]/jobs:table-cell',+ tooltip:+ 'Job instances that ran on a second or later attempt. Frequent re-runs usually point to flaky checks.',+ sorter: (a, b) => a.retry_job_count - b.retry_job_count,+ render: (_, row) => (+ <span className="text-xs tabular-nums">{humanFriendlyNumber(row.retry_job_count)}</span>+ ),+ },+ {+ title: 'Cost',+ key: 'cost',+ align: 'right',+ tooltip:+ 'Estimated cost over billable (self-hosted) runners. "—" when there is no billable figure: GitHub-hosted, an unrecognized runner, or no finished instance yet.',+ sorter: (a, b) => (a.estimated_cost_usd ?? -1) - (b.estimated_cost_usd ?? -1),+ render: (_, row) => {+ if (row.estimated_cost_usd == null) {+ return <span className="text-xs text-tertiary">—</span>+ }+ const share =+ totalCostUsd && totalCostUsd > 0 ? row.estimated_cost_usd / totalCostUsd : null+ return (+ <Tooltip+ title={+ <BillableBadge+ minutes={row.billable_minutes}+ costUsd={row.estimated_cost_usd}+ />+ }+ >+ <span className="text-xs tabular-nums whitespace-nowrap">+ {compactUsd(row.estimated_cost_usd)}+ {share != null && <span className="ml-1 text-tertiary">{percent(share)}</span>}+ </span>+ </Tooltip>+ )+ },},- },- ]}- defaultSorting={{ columnKey: 'cost', order: -1 }}- pagination={{ pageSize: 25 }}- emptyState="No jobs in the window. The job-level source may not be synced."- nouns={['job', 'jobs']}- />+ ]}+ defaultSorting={{ columnKey: 'cost', order: -1 }}+ pagination={{ pageSize: 25 }}+ emptyState="No jobs in the window. The job-level source may not be synced."+ nouns={['job', 'jobs']}+ />+ </div>)}diff --git a/products/engineering_analytics/frontend/components/RunActivityChart.tsx b/products/engineering_analytics/frontend/components/RunActivityChart.tsxindex 6c175d9f2f08..592ba02c348e 100644--- a/products/engineering_analytics/frontend/components/RunActivityChart.tsx+++ b/products/engineering_analytics/frontend/components/RunActivityChart.tsx@@ -40,13 +40,13 @@ interface RunActivityChartProps {// Dot/series color per verdict — the shared map so scatter, mini bars, and the run tables' StatusDot agree.const DOT_COLOR = VERDICT_COLOR-const LEGEND_LABEL: Record<string, string> = {+export const LEGEND_LABEL: Record<string, string> = {success: 'Passed',danger: 'Failed',muted: 'Cancelled / skipped',warning: 'Other',}-const LEGEND_ORDER = ['success', 'danger', 'muted', 'warning']+export const LEGEND_ORDER = ['success', 'danger', 'muted', 'warning']const SCATTER_HEIGHT = 156const BAND_HEIGHT = 56diff --git a/products/engineering_analytics/frontend/components/RunActivityMiniBars.tsx b/products/engineering_analytics/frontend/components/RunActivityMiniBars.tsxindex 39ca7b9635c7..942e9777be46 100644--- a/products/engineering_analytics/frontend/components/RunActivityMiniBars.tsx+++ b/products/engineering_analytics/frontend/components/RunActivityMiniBars.tsx@@ -9,7 +9,7 @@ import { humanFriendlyDuration } from 'lib/utils/durations'import { percentileSorted } from '../lib/runHealth'import { VERDICT_COLOR, verdictTag } from '../lib/runStatus'-import { type ActivityRun, formatAxisMinutes, isPlottable } from './RunActivityChart'+import { type ActivityRun, LEGEND_LABEL, LEGEND_ORDER, formatAxisMinutes, isPlottable } from './RunActivityChart'interface RunActivityMiniBarsProps {runs: ActivityRun[]@@ -60,6 +60,8 @@ export function RunActivityMiniBars({const barHeight = (seconds: number): number =>maxSeconds > 0 ? Math.max(MIN_BAR_PX, Math.round((seconds / maxSeconds) * CHART_HEIGHT)) : MIN_BAR_PXconst medianTopPx = maxSeconds > 0 ? CHART_HEIGHT * (1 - Math.min((medianMin * 60) / maxSeconds, 1)) : CHART_HEIGHT+ const presentTypeSet = new Set<string>(shown.map((run) => verdictTag(run.conclusion).type))+ const presentTypes = LEGEND_ORDER.filter((type) => presentTypeSet.has(type))return (<div className={cn('flex flex-col gap-2', className)}>@@ -130,6 +132,17 @@ export function RunActivityMiniBars({)})}</div>+ <div className="mt-3 flex flex-wrap items-center gap-x-4 gap-y-1">+ {presentTypes.map((type) => (+ <span key={type} className="flex items-center gap-1.5 text-xs text-secondary">+ <span+ className="h-1.5 w-1.5 shrink-0 rounded-full"+ style={{ background: VERDICT_COLOR[type] }}+ />+ {LEGEND_LABEL[type]}+ </span>+ ))}+ </div></LemonCard></div>)diff --git a/products/engineering_analytics/frontend/components/WindowComparisonCard.tsx b/products/engineering_analytics/frontend/components/WindowComparisonCard.tsxindex 095ccf3e5c46..f965fefafe45 100644--- a/products/engineering_analytics/frontend/components/WindowComparisonCard.tsx+++ b/products/engineering_analytics/frontend/components/WindowComparisonCard.tsx@@ -59,6 +59,32 @@ function ComparisonRow({return <ComparisonBarRow label={label} value={value} max={max} formatValue={formatValue} muted={!current} />}+function PreviousWindowNote({ text }: { text: string }): JSX.Element {+ return (+ <div className="flex items-center gap-2">+ <span className="w-24 shrink-0 truncate text-[11px] text-tertiary">Previous window</span>+ <span className="text-[11px] text-tertiary">{text}</span>+ </div>+ )+}++/** Why the previous window can't be compared with this one, or null when it can. */+function previousWindowGap(+ previousValue: number | null | undefined,+ formatValue: (value: number) => string,+ relative: boolean+): string | null {+ if (previousValue == null) {+ return 'No data'+ }+ // A relative change against a value that displays as zero (a 9s median shown as "0m") reads as a+ // huge swing that the shown numbers can't explain.+ if (relative && previousValue > 0 && formatValue(previousValue) === formatValue(0)) {+ return 'Too close to zero to compare'+ }+ return null+}+export function WindowComparisonCard({title,value,@@ -76,7 +102,7 @@ export function WindowComparisonCard({title: string/** This window's value. */value: number | null | undefined- /** The previous window's value; without one the card shows this window's bar alone. */+ /** The previous window's value; without one the card says the previous window has no data. */previousValue: number | null | undefinedformatValue: (value: number) => stringgoodWhenDown?: boolean@@ -93,8 +119,10 @@ export function WindowComparisonCard({loading?: booleanemptyText: string}): JSX.Element {- const max = Math.max(value ?? 0, previousValue ?? 0)- const delta = deltaUnit === 'pt' ? pointChange(value, previousValue) : percentChange(value, previousValue)+ const previousGap = previousWindowGap(previousValue, formatValue, deltaUnit !== 'pt')+ const comparablePrevious = previousGap == null ? previousValue : null+ const max = Math.max(value ?? 0, comparablePrevious ?? 0)+ const delta = deltaUnit === 'pt' ? pointChange(value, comparablePrevious) : percentChange(value, comparablePrevious)const tooltipContent = benchmark ? (<div className="flex flex-col gap-1">{tooltip}@@ -142,15 +170,17 @@ export function WindowComparisonCard({share={share}current/>- {previousValue != null && (+ {comparablePrevious != null ? (<ComparisonRowlabel="Previous window"- value={previousValue}+ value={comparablePrevious}max={max}formatValue={formatValue}share={share}current={false}/>+ ) : (+ <PreviousWindowNote text={previousGap ?? 'No data'} />)}</div></>diff --git a/products/engineering_analytics/frontend/scenes/PullRequestDetailScene.tsx b/products/engineering_analytics/frontend/scenes/PullRequestDetailScene.tsxindex a57c7af3e6b7..fc2314137e4a 100644--- a/products/engineering_analytics/frontend/scenes/PullRequestDetailScene.tsx+++ b/products/engineering_analytics/frontend/scenes/PullRequestDetailScene.tsx@@ -459,7 +459,9 @@ export function PullRequestDetailScene(): JSX.Element {: nullconst passed = runs.filter((run) => run.conclusion !== null && isPassingConclusion(run.conclusion)).length- const failed = runs.filter((run) => run.conclusion !== null && !isPassingConclusion(run.conclusion)).length+ const failedRuns = runs.filter((run) => run.conclusion !== null && !isPassingConclusion(run.conclusion))+ const failed = failedRuns.length+ const failedRunsOnGitHub = failedRuns.every((run) => run.ciEngine === 'github_actions')const running = runs.filter((run) => run.conclusion === null).lengthconst visiblePrCost = prCostFailed || prCostLoading ? null : prCostconst latestRound = commitGroups[0] ? pushRoundOf(commitGroups[0].headSha, commitGroups[0].runs) : null@@ -752,8 +754,17 @@ export function PullRequestDetailScene(): JSX.Element {logs={failureLogs}loading={failureLogsLoading}onRetry={loadFailureLogs}- errorDescription="Retry, or open one of the failed runs on GitHub to read its logs."- emptyText="No failure logs. Fork runs may not be linked to this pull request, nothing failed, or the logs have aged out of retention."+ logsOnGitHub={failedRunsOnGitHub}+ errorDescription={+ failedRunsOnGitHub+ ? 'Retry, or open one of the failed runs on GitHub to read its logs.'+ : 'Retry, or read the failed run logs in your CI provider.'+ }+ emptyText={`Failure logs aren't available for these runs. They weren't collected, fork runs may not be linked to this pull request, or the logs have aged out of retention. ${+ failedRunsOnGitHub+ ? 'Open a failed run on GitHub to read its logs.'+ : 'Read the failed run logs in your CI provider.'+ }`}/></Section>)}diff --git a/products/engineering_analytics/frontend/scenes/RepoOverviewScene.tsx b/products/engineering_analytics/frontend/scenes/RepoOverviewScene.tsxindex f0b7045cfc62..102ebc015705 100644--- a/products/engineering_analytics/frontend/scenes/RepoOverviewScene.tsx+++ b/products/engineering_analytics/frontend/scenes/RepoOverviewScene.tsx@@ -102,7 +102,7 @@ export function RepoOverviewScene(): JSX.Element {<div className="@container"><div className="grid grid-cols-1 gap-2 @min-[36rem]:grid-cols-2"><WindowComparisonCard- title="CI pass rate"+ title="CI pass rate, all branches"value={overview?.success_rate}previousValue={overview?.success_rate_prev}formatValue={(value) => percent(value, 1)}@@ -110,7 +110,7 @@ export function RepoOverviewScene(): JSX.Element {deltaUnit="pt"deltaPrecision={1}loading={overviewPending}- tooltip="Share of successful runs among runs that succeeded, failed, timed out, failed to start, or became stale. Skipped, canceled, neutral, and action-required runs are excluded."+ tooltip={`Runs on every branch, including pull requests, not only ${overviewDefaultBranch}. Share of successful runs among runs that succeeded, failed, timed out, failed to start, or became stale. Skipped, canceled, neutral, and action-required runs are excluded.`}emptyText="No CI runs reached a pass-or-fail result in the window."/>diff --git a/products/engineering_analytics/frontend/scenes/WorkflowRunDetailScene.tsx b/products/engineering_analytics/frontend/scenes/WorkflowRunDetailScene.tsxindex ec9f1f08cb09..8ce3e37e1a73 100644--- a/products/engineering_analytics/frontend/scenes/WorkflowRunDetailScene.tsx+++ b/products/engineering_analytics/frontend/scenes/WorkflowRunDetailScene.tsx@@ -279,6 +279,7 @@ export function WorkflowRunDetailScene(): JSX.Element {loading={failureLogsLoading}onRetry={loadFailureLogs}jobNames={jobNamesById}+ logsOnGitHub={githubUrl !== null}/></Section>)}diff --git a/products/engineering_analytics/frontend/scenes/WorkflowRunsScene.tsx b/products/engineering_analytics/frontend/scenes/WorkflowRunsScene.tsxindex b61e7d72e803..cf50223486c6 100644--- a/products/engineering_analytics/frontend/scenes/WorkflowRunsScene.tsx+++ b/products/engineering_analytics/frontend/scenes/WorkflowRunsScene.tsx@@ -184,9 +184,10 @@ export function WorkflowRunsScene(): JSX.Element {{title: 'Branch',key: 'branch',+ className: 'w-full max-w-0',render: (_, run) =>run.headBranch ? (- <span className="flex items-center gap-1.5 font-mono text-xs">+ <span className="flex min-w-0 items-center gap-1.5 font-mono text-xs">{(run.headBranch === 'master' || run.headBranch === 'main') && (<spanclassName={cn(@@ -195,7 +196,9 @@ export function WorkflowRunsScene(): JSX.Element {)}/>)}- {run.headBranch}+ <Tooltip title={run.headBranch}>+ <span className="truncate">{run.headBranch}</span>+ </Tooltip></span>) : (<span className="text-xs text-secondary">—</span>@@ -205,12 +208,13 @@ export function WorkflowRunsScene(): JSX.Element {title: 'Commit',key: 'commit',width: 90,+ className: 'hidden @min-[48rem]/runs:table-cell',render: (_, run) =>run.headSha ? (<Linkto={githubCommitUrl(run.repoOwner, run.repoName, run.headSha)}target="_blank"- className="font-mono text-xs text-tertiary"+ className="font-mono text-xs whitespace-nowrap text-tertiary"onClick={(e) => e.stopPropagation()}>{run.headSha.slice(0, 7)}@@ -223,6 +227,7 @@ export function WorkflowRunsScene(): JSX.Element {title: 'PR',key: 'pr',width: 80,+ className: 'hidden @min-[40rem]/runs:table-cell',render: (_, run) =>run.prNumber != null ? (<Link@@ -244,6 +249,7 @@ export function WorkflowRunsScene(): JSX.Element {key: 'attempt',width: 80,align: 'right',+ className: 'hidden @min-[48rem]/runs:table-cell',render: (_, run) =>(run.runAttempt ?? 1) > 1 ? (<LemonTag type="warning">{run.runAttempt}</LemonTag>@@ -458,7 +464,9 @@ export function WorkflowRunsScene(): JSX.Element {)}</Section><Section id="runs" title="Runs">- <LemonCard hoverEffect={false} className="overflow-hidden p-0">+ {/* Container queries drop the secondary columns when the scene is narrow, so Duration and+ Started stay in view. */}+ <LemonCard hoverEffect={false} className="overflow-hidden p-0 @container/runs"><LemonTable<WorkflowRunRow>dataSource={runRows}columns={runColumns}diff --git a/products/engineering_analytics/manifest.tsx b/products/engineering_analytics/manifest.tsxindex 89b80a621187..b069fef5e63e 100644--- a/products/engineering_analytics/manifest.tsx+++ b/products/engineering_analytics/manifest.tsx@@ -148,7 +148,7 @@ export const manifest: ProductManifest = {'var(--color-product-engineering-analytics-dark)',],href: urls.engineeringAnalytics(),- searchKeywords: ['dora', 'ci health', 'cycle time'],+ searchKeywords: ['ci', 'ci health', 'ci cost', 'github actions', 'build minutes', 'dora', 'cycle time'],searchTabs: [{ name: 'Pull requests', href: urls.engineeringAnalyticsPullRequestList() },{ name: 'CI workflows', href: urls.engineeringAnalyticsWorkflows() },