: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): show load errors on list pages (#103945)
Raúl Negrón-Otero79901b0dc978
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex beb3e84e8a9e..54b702c6f315 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -7976,18 +7976,26 @@ snapshots:hash: v1.k794b7964.3c3142b9a3a6bb141701854805597465f6f823106746e7b20c381f3d610eaddb.E0-u2Sj4HAj2xqSq6Z4Jh3fQz9gagK4K0Z-3hegKbkEscenes-app-engineering-analytics-team--team-without-membership--light:hash: v1.k794b7964.22b8a8a0e228d1af6ef2ee6ccd6790bdd39da67113cf04c9c4dccf349c280fa0.5ydsnSNLbc1Kym8S7J7u-e8YQS8iFYBHS-0g-1Q0VkU+ scenes-app-engineering-analytics-teams--team-ci-health-load-error--dark:+ hash: v1.k794b7964.3a839a620f73e3dc44cff35a662c6a52dadf86547a223a7dc6148737fe79f0c6.FYDXKQfHQWLVNj17PoARgYeeWCcbB2lgbT79SHWlXO0+ scenes-app-engineering-analytics-teams--team-ci-health-load-error--light:+ hash: v1.k794b7964.2ae8567ecba1e0f18aa602f50a3507186282b70117bab2b9918c5094f5080e3b.df6SnP3ZVrpGmauzKMEMqeCvC0IOei-i69N5_qhRPtYscenes-app-engineering-analytics-teams--team-ci-health-roster--dark:- hash: v1.k794b7964.d2d7578360ba54b7fc61f23ee770a6874cf52b5a5cabd288bc1a28431e964263.YrKgeAKxWLMc3r7KjVvcYQ7QF9liZE7jBm9y_Z94k0A+ hash: v1.k794b7964.28329d99bc651f0715101462c03d6d705fb3e4d37499266a23feb1ef6e0f81c6.yxbLfZo_pTh5AL4-eVbNT0hWVBqCPy7yVuFu5SeAuBQscenes-app-engineering-analytics-teams--team-ci-health-roster--light:- hash: v1.k794b7964.43abadb51ad09d1188cc15a614ef2182f8678d11e9874ccb1e42879135fb0683.k0QpKiVLrIBNL7JL530nbIOnzlDa_fqrtLA6_9AZIIY+ hash: v1.k794b7964.f0520354e7a177f917bede0c0a1007bd04a893ff8f494808e749e8e2c5aaac0f.R6pPRzdhxtoOqML9GGetDsHuke5tN4EOdi3-gTSy6tA+ scenes-app-engineering-analytics-test-health--quarantine-load-error--dark:+ hash: v1.k794b7964.d7e3fc4de2855869b44d9eecb6cec959bf6c3d35cb322e017b5348b0c2d5c83a.yjDuCrUz1yJCnvsHkaUIjRuB7HT8u9J24BJGFTmwFAo+ scenes-app-engineering-analytics-test-health--quarantine-load-error--light:+ hash: v1.k794b7964.59db58c1d5bf745a62da1194e3e8738af3552e6c6ea75df562b57c5e95c569de.jbfSXTkHP95POg5za-XcH5BLg1WTEJKg_D-nKq4WZyIscenes-app-engineering-analytics-test-health--trunk-quarantine-debt--dark:- hash: v1.k794b7964.1bf2a96d4a8f8875fc554a67e7e7b28adc98b144607babe0ae8342de5a0f3edc.JM5CCK4syW_o4_XReB3Nn6NUpB0I643u2a05XZmoeck+ hash: v1.k794b7964.82e019d6b450b049daf8c4fe0b4b9f43be6a650144f40f09ea761863bf96c970.6dhWrSB7uTAMHVSNquK_uLMHLUuPm795mP3W9DeCxRQscenes-app-engineering-analytics-test-health--trunk-quarantine-debt--light:- hash: v1.k794b7964.1f330c8921d0151e1a846cf3cdccd6cd8196fd012630780b3a20491cc5ff293f.oEUS4LgdANupAGuZ7t8vmArgxuzi4IBEIJIlWHFXOAw+ hash: v1.k794b7964.0a7754a264ff83aca3b7eab3d907538cb304f62d236059b2ceef6cbbea494e28.ps2-hjw0YXwzgaz5iHZ43ZJSnkufbn290A6omxfgK5sscenes-app-engineering-analytics-test-health--trunk-quarantine-debt-owners-unavailable--dark:- hash: v1.k794b7964.322bfce5ccced64987eb75406fa77e8a2ad80575597378810b984986f9fede0f.EwXIJ9x_Rc-dgkCVJJZBQM1W3voRSFtgHX95x8GbYIE+ hash: v1.k794b7964.a3e541251aa1f57db9e9d47ba4f7c70da1dcd7e947ca0e77867c8dc9cf079a8f.ng17zeQ5cixYBFBfQ7gxq4xlkPebUMr0-jbDE1IjYfwscenes-app-engineering-analytics-test-health--trunk-quarantine-debt-owners-unavailable--light:- hash: v1.k794b7964.8916de545edf558f799cc98ee4a901c19ba00fe7d0bb4f5312266705755e3e70.EO6V5mC_JCbSh5ZRrmyU09RT-hFV9f4Mtu_JkZ9m5Ng+ hash: v1.k794b7964.dbe38d8cfb84a27dd37f90b28c7b23d6172aa038f799c56ba506e6cfa5713d73.fjLhZkUmm8oWHQUPls1VsxQmOrCeQYPrxJ9Qavt1vuEscenes-app-engineering-analytics-workflow--workflow-detail--dark:hash: v1.k794b7964.22bf886859816ee11d232317ca59554e06fd9708011d78d00ea8f071dd3d7c9a.UyFkQYvasBL9ER7I1qlztCTuqpP7FZ6FtlaauK-77Ucscenes-app-engineering-analytics-workflow--workflow-detail--light:diff --git a/products/engineering_analytics/frontend/components/DeliveryPipeline.test.tsx b/products/engineering_analytics/frontend/components/DeliveryPipeline.test.tsxnew file mode 100644index 000000000000..793b3d903758--- /dev/null+++ b/products/engineering_analytics/frontend/components/DeliveryPipeline.test.tsx@@ -0,0 +1,8 @@+import { DeliveryPipeline } from './DeliveryPipeline'++describe('DeliveryPipeline', () => {+ it('removes placeholders when loading settles without any usable timing data', () => {+ expect(DeliveryPipeline({ pipeline: null, mergeToDeploy: null, loading: true })).not.toBeNull()+ expect(DeliveryPipeline({ pipeline: null, mergeToDeploy: null, loading: false })).toBeNull()+ })+})diff --git a/products/engineering_analytics/frontend/components/DeliveryPipeline.tsx b/products/engineering_analytics/frontend/components/DeliveryPipeline.tsxindex c34b146c7dd2..4d4983026cf1 100644--- a/products/engineering_analytics/frontend/components/DeliveryPipeline.tsx+++ b/products/engineering_analytics/frontend/components/DeliveryPipeline.tsx@@ -59,8 +59,11 @@ export function DeliveryPipeline({/** The post-merge leg, read from the DORA endpoint. Null while loading or when deploy data is not synced. */mergeToDeploy: MergeToDeployLeg | nullloading?: boolean-}): JSX.Element {- if (!pipeline) {+}): JSX.Element | null {+ if (!pipeline && mergeToDeploy?.medianSeconds == null) {+ if (!loading) {+ return null+ }return (<LemonCard hoverEffect={false} className="flex h-full flex-col gap-3 p-3">{[0, 1, 2].map((row) => (@@ -69,7 +72,7 @@ export function DeliveryPipeline({</LemonCard>)}- const legs: RenderedLeg[] = pipeline.stages+ const legs: RenderedLeg[] = (pipeline?.stages ?? []).filter((leg) => leg.median_seconds != null).map((leg) => ({key: leg.stage,@@ -91,7 +94,7 @@ export function DeliveryPipeline({if (legs.length === 0) {return (<LemonCard hoverEffect={false} className="flex h-full items-center p-4 text-xs text-secondary">- {pipeline.merged_pr_count === 0+ {pipeline?.merged_pr_count === 0? 'Nothing merged in the window.': 'No merged PR in the window has a measurable step yet.'}</LemonCard>diff --git a/products/engineering_analytics/frontend/components/TeamQuarantinedTestsTable.tsx b/products/engineering_analytics/frontend/components/TeamQuarantinedTestsTable.tsxindex 4ed490be82e5..a49e326c361a 100644--- a/products/engineering_analytics/frontend/components/TeamQuarantinedTestsTable.tsx+++ b/products/engineering_analytics/frontend/components/TeamQuarantinedTestsTable.tsx@@ -45,6 +45,8 @@ export function TeamQuarantinedTestsTable({title: 'Quarantined',key: 'quarantinedAt',width: 130,+ align: 'right',+ sorter: (a, b) => a.quarantinedAt.localeCompare(b.quarantinedAt),render: (_, row) => <TZLabel time={row.quarantinedAt} />,},{@@ -52,6 +54,7 @@ export function TeamQuarantinedTestsTable({key: 'ageDays',width: 140,align: 'right',+ sorter: (a, b) => a.ageDays - b.ageDays,render: (_, row) => (<div className="flex items-center justify-end gap-2"><span>{pluralize(row.ageDays, 'day')}</span>diff --git a/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsPullRequests.tsx b/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsPullRequests.tsxindex 78beb45ad91c..e05635ea4394 100644--- a/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsPullRequests.tsx+++ b/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsPullRequests.tsx@@ -37,8 +37,10 @@ export function EngineeringAnalyticsPullRequests(): JSX.Element {} = useValues(engineeringAnalyticsLogic)const { setStateFilter, setCiStatusFilter, setSearch, resetFilters, applyCardFilter, refresh } =useActions(engineeringAnalyticsLogic)- const { timing, timingLoading } = useValues(timeToProductionLogic)- const { dora, doraLoading, environmentScopeLabel, githubTeam } = useValues(doraLogic)+ const { timing, timingFailed, timingLoading } = useValues(timeToProductionLogic)+ const { loadTiming } = useActions(timeToProductionLogic)+ const { dora, doraFailed, doraLoading, environmentScopeLabel, githubTeam } = useValues(doraLogic)+ const { loadDora } = useActions(doraLogic)const pipeline = timing?.delivery_pipelineconst deploysSynced = !!dora?.deploy_data_available@@ -53,9 +55,6 @@ export function EngineeringAnalyticsPullRequests(): JSX.Element {scopeLabel: deployScopeLabel,}: null- // timingLoading with nothing on screen is the first fetch; the cards show a skeleton rather than- // an empty state, which would read as "nothing merged".- const timingPending = timingLoading && !timing// Cycle time is ready->merge when the backend observed the draft/ready transitions; otherwise// it falls back to the coarse created->merged span, labeled as such.const cycleTime =@@ -89,83 +88,105 @@ export function EngineeringAnalyticsPullRequests(): JSX.Element {<RepoEntityHeader repoFullName={activeSource?.repo || ''} />{/* The panel is the scope. Everything below it is the current open backlog, not windowed. */}- <ScopePanel busy={timingLoading && !!timing}>- <Section id="delivery" title="Time to production" busy={timingLoading}>- <div className="grid grid-cols-1 gap-2 md:grid-cols-2">- <WindowComparisonCard- title={cycleTime.title}- value={cycleTime.value}- previousValue={cycleTime.previousValue}- formatValue={compactHoursLabel}- goodWhenDown- loading={timingPending}- tooltip={cycleTime.tooltip}- emptyText="No PRs merged in the window yet."- />- <WindowComparisonCard- title={`Median time from merge to production (${deployScopeLabel})`}- value={dora?.median_merge_to_deploy_seconds}- previousValue={dora?.median_merge_to_deploy_seconds_prev}- formatValue={compactAgeLabel}- goodWhenDown- loading={doraLoading && !dora}- tooltip="Median wait from a PR's merge to the first successful deploy containing it, resolved through the deploy head commit. The same measure as the Health tab, in the environment and team scope selected there."- emptyText={- dora && !dora.deploy_data_available- ? 'Production timing appears once the deployments source is synced.'- : 'No PR merged in the window has reached production yet.'- }- />- </div>- <DeliveryPipeline pipeline={pipeline} mergeToDeploy={mergeToDeploy} loading={timingPending} />- </Section>-- <Section id="merge-queue" title="Merge queue" busy={timingLoading}>- {timing &&- timing.merge_queue_merged_pr_count === 0 &&- timing.merge_queue_failed_or_cancelled_share == null ? (- <LemonCard hoverEffect={false} className="p-4 text-xs text-secondary">- No merge queue activity in the window.- </LemonCard>- ) : (- <div className="grid grid-cols-1 gap-2 md:grid-cols-2">- <WindowComparisonCard- title="Merges retried in the queue"- tooltip="Share of queue-landed merges that needed more than one gate attempt. Bisection branches count toward the attempt they investigate."- value={timing?.merge_queue_multi_attempt_merge_share}- previousValue={timing?.merge_queue_multi_attempt_merge_share_prev}- formatValue={percent}- deltaUnit="pt"- goodWhenDown- loading={timingPending}- emptyText="No queue-landed merges in the window."- />- {timing?.merge_queue_trunk_available ? (+ <ScopePanel busy={timingLoading || doraLoading}>+ <Section id="delivery" title="Time to production" busy={timingLoading || doraLoading}>+ <div className="@container">+ <div className="grid grid-cols-1 gap-2 @min-[36rem]:grid-cols-2">+ {timingFailed ? (+ <CIAnalyticsLoadError onRetry={loadTiming} loading={timingLoading} />+ ) : (<WindowComparisonCard- title="Left the queue unmerged"- tooltip="Share of concluded merge queue entries that ended failed or cancelled, from the queue's own records."- value={timing?.merge_queue_failed_or_cancelled_share}- previousValue={timing?.merge_queue_failed_or_cancelled_share_prev}- formatValue={(v) => percent(v, 1)}- deltaUnit="pt"+ title={cycleTime.title}+ value={cycleTime.value}+ previousValue={cycleTime.previousValue}+ formatValue={compactHoursLabel}goodWhenDown- loading={timingPending}- emptyText="No concluded queue entries in the window."+ loading={timingLoading}+ tooltip={cycleTime.tooltip}+ emptyText="No PRs merged in the window yet."/>+ )}+ {doraFailed ? (+ <CIAnalyticsLoadError onRetry={loadDora} loading={doraLoading} />) : (<WindowComparisonCard- title="Merges with a failed queue run"- tooltip="Share of queue-landed merges where at least one gate run failed before the merge. Derived from CI run conclusions, not the queue's own eviction records."- value={timing?.merge_queue_failed_gate_merge_share}- previousValue={timing?.merge_queue_failed_gate_merge_share_prev}- formatValue={percent}- deltaUnit="pt"+ title={`Median time from merge to production (${deployScopeLabel})`}+ value={dora?.median_merge_to_deploy_seconds}+ previousValue={dora?.median_merge_to_deploy_seconds_prev}+ formatValue={compactAgeLabel}goodWhenDown- loading={timingPending}- emptyText="No queue-landed merges in the window."+ loading={doraLoading}+ tooltip="Median wait from a PR's merge to the first successful deploy containing it, resolved through the deploy head commit. The same measure as the Health tab, in the environment and team scope selected there."+ emptyText={+ dora && !dora.deploy_data_available+ ? 'Production timing appears once the deployments source is synced.'+ : 'No PR merged in the window has reached production yet.'+ }/>)}</div>+ {(!timingFailed || !doraFailed) && (+ <DeliveryPipeline+ pipeline={timingLoading || timingFailed ? null : pipeline}+ mergeToDeploy={doraLoading || doraFailed ? null : mergeToDeploy}+ loading={timingLoading || doraLoading}+ />+ )}+ </div>+ </Section>++ <Section id="merge-queue" title="Merge queue" busy={timingLoading}>+ {timingFailed ? (+ <CIAnalyticsLoadError onRetry={loadTiming} loading={timingLoading} />+ ) : (+ <div className="@container">+ {timing &&+ timing.merge_queue_merged_pr_count === 0 &&+ timing.merge_queue_failed_or_cancelled_share == null ? (+ <LemonCard hoverEffect={false} className="p-4 text-xs text-secondary">+ No merge queue activity in the window.+ </LemonCard>+ ) : (+ <div className="grid grid-cols-1 gap-2 @min-[36rem]:grid-cols-2">+ <WindowComparisonCard+ title="Merges retried in the queue"+ tooltip="Share of queue-landed merges that needed more than one gate attempt. Bisection branches count toward the attempt they investigate."+ value={timing?.merge_queue_multi_attempt_merge_share}+ previousValue={timing?.merge_queue_multi_attempt_merge_share_prev}+ formatValue={percent}+ deltaUnit="pt"+ goodWhenDown+ loading={timingLoading}+ emptyText="No queue-landed merges in the window."+ />+ {timing?.merge_queue_trunk_available ? (+ <WindowComparisonCard+ title="Left the queue unmerged"+ tooltip="Share of concluded merge queue entries that ended failed or cancelled, from the queue's own records."+ value={timing?.merge_queue_failed_or_cancelled_share}+ previousValue={timing?.merge_queue_failed_or_cancelled_share_prev}+ formatValue={(v) => percent(v, 1)}+ deltaUnit="pt"+ goodWhenDown+ loading={timingLoading}+ emptyText="No concluded queue entries in the window."+ />+ ) : (+ <WindowComparisonCard+ title="Merges with a failed queue run"+ tooltip="Share of queue-landed merges where at least one gate run failed before the merge. Derived from CI run conclusions, not the queue's own eviction records."+ value={timing?.merge_queue_failed_gate_merge_share}+ previousValue={timing?.merge_queue_failed_gate_merge_share_prev}+ formatValue={percent}+ deltaUnit="pt"+ goodWhenDown+ loading={timingLoading}+ emptyText="No queue-landed merges in the window."+ />+ )}+ </div>+ )}+ </div>)}</Section></ScopePanel>diff --git a/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsTeams.stories.tsx b/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsTeams.stories.tsxindex 2b338d6e43d0..ac0873f42ac3 100644--- a/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsTeams.stories.tsx+++ b/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsTeams.stories.tsx@@ -125,3 +125,16 @@ export const TeamCIHealthRoster: Story = {render: () => <App />,parameters: { pageUrl: urls.engineeringAnalyticsTeams() },}++export const TeamCIHealthLoadError: Story = {+ render: () => <App />,+ parameters: {+ pageUrl: urls.engineeringAnalyticsTeams(),+ testOptions: { waitForSelector: '.text-danger' },+ },+ decorators: [+ mswDecorator({+ get: { 'api/projects/:team_id/engineering_analytics/team_ci_health/': () => [500, null] },+ }),+ ],+}diff --git a/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsTeams.tsx b/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsTeams.tsxindex acb9492e520d..816d0076e397 100644--- a/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsTeams.tsx+++ b/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsTeams.tsx@@ -1,13 +1,15 @@-import { useValues } from 'kea'+import { useActions, useValues } from 'kea'import { combineUrl } from 'kea-router'-import { IconPeople } from '@posthog/icons'import { LemonTable, LemonTableColumns, LemonTag, Link, Tooltip } from '@posthog/lemon-ui'import { urls } from 'scenes/urls'+import { CIAnalyticsLoadError } from '../components/CIAnalyticsLoadError'+import { ConnectGitHubSource } from '../components/ConnectGitHubSource'import { CountCell } from '../components/CountCell'import { ScopeBar, SourceScopeChip } from '../components/ScopeBar'+import { Section } from '../components/Section'import { rowNavigationProps } from '../lib/rowNavigation'import { DEFAULT_TEAMS_WINDOW, TEAMS_WINDOW_LABELS, TeamCIHealthRow, UNOWNED_TEAM, teamsLogic } from './teamsLogic'@@ -19,7 +21,8 @@ function detailUrlOf(ownerTeam: string, sourceId: string | null): string {}export function EngineeringAnalyticsTeams(): JSX.Element {- const { teams, teamsLoading, sourceId } = useValues(teamsLogic)+ const { teams, teamsFailed, teamsLoading, teamsNotConnected, sourceId } = useValues(teamsLogic)+ const { loadTeams } = useActions(teamsLogic)const columns: LemonTableColumns<TeamCIHealthRow> = [{@@ -81,32 +84,40 @@ export function EngineeringAnalyticsTeams(): JSX.Element {},]+ if (teamsNotConnected) {+ return <ConnectGitHubSource />+ }+return (<div className="flex flex-col gap-4"><ScopeBar repoSlot={<SourceScopeChip />} showDate={false} />- <h3 className="m-0 flex items-center gap-1.5 text-base font-semibold">- <IconPeople className="text-lg" />- Team CI health- </h3>- <LemonTable- data-attr="engineering-analytics-teams-table"- size="small"- columns={columns}- dataSource={teams?.rows ?? []}- rowKey={(row) => row.ownerTeam}- rowClassName="cursor-pointer"- onRow={(row) => rowNavigationProps(detailUrlOf(row.ownerTeam, sourceId))}- loading={teamsLoading}- pagination={{ pageSize: 20 }}- useURLForSorting={false}- emptyState="No team-attributed CI signal yet. Signal appears once CI emits test spans with ownership stamps."- nouns={['team', 'teams']}- />- {teams?.truncated && (- <div className="text-xs text-tertiary">- Showing the {teams.limit} teams with the most signal. More teams qualified.- </div>- )}+ <Section id="team-ci-health" title="Team CI health">+ {teamsFailed ? (+ <CIAnalyticsLoadError onRetry={loadTeams} loading={teamsLoading} />+ ) : (+ <div className="flex flex-col gap-2">+ <LemonTable+ data-attr="engineering-analytics-teams-table"+ size="small"+ columns={columns}+ dataSource={teams?.rows ?? []}+ rowKey={(row) => row.ownerTeam}+ rowClassName="cursor-pointer"+ onRow={(row) => rowNavigationProps(detailUrlOf(row.ownerTeam, sourceId))}+ loading={teamsLoading}+ pagination={{ pageSize: 20 }}+ useURLForSorting={false}+ emptyState="No team-attributed CI signal yet. Signal appears once CI emits test spans with ownership stamps."+ nouns={['team', 'teams']}+ />+ {teams?.truncated && (+ <div className="text-xs text-tertiary">+ Showing the {teams.limit} teams with the most signal. More teams qualified.+ </div>+ )}+ </div>+ )}+ </Section></div>)}diff --git a/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsTestHealth.stories.tsx b/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsTestHealth.stories.tsxindex c4909ab81927..df726a489530 100644--- a/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsTestHealth.stories.tsx+++ b/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsTestHealth.stories.tsx@@ -133,3 +133,16 @@ export const TrunkQuarantineDebtOwnersUnavailable: Story = {}),],}++export const QuarantineLoadError: Story = {+ render: () => <App />,+ parameters: {+ pageUrl: urls.engineeringAnalyticsTestHealth(),+ testOptions: { waitForSelector: '.text-danger' },+ },+ decorators: [+ mswDecorator({+ get: { 'api/projects/:team_id/engineering_analytics/trunk_quarantine/': () => [500, null] },+ }),+ ],+}diff --git a/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsTestHealth.tsx b/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsTestHealth.tsxindex 52da2cb68d11..66d7c5471ee9 100644--- a/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsTestHealth.tsx+++ b/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsTestHealth.tsx@@ -6,14 +6,15 @@ import { LemonBanner, LemonButton, LemonTable, LemonTableColumns } from '@posthoimport { humanFriendlyNumber } from 'lib/utils/numbers'import { pluralize } from 'lib/utils/strings'-import { ConnectGitHubSource } from '../components/ConnectGitHubSource'+import { CIAnalyticsLoadError } from '../components/CIAnalyticsLoadError'import { ScopeBar, SourceScopeChip } from '../components/ScopeBar'+import { Section } from '../components/Section'import { StatCard } from '../components/StatCard'import { TeamQuarantinedTestsTable } from '../components/TeamQuarantinedTestsTable'import { TrunkQuarantineTeamRow, engineeringAnalyticsLogic } from './engineeringAnalyticsLogic'function teamLabel(ownerTeam: string): string {- return ownerTeam.replace(/^team-/, '')+ return ownerTeam === 'unowned' ? 'Unowned' : ownerTeam}function TrunkQuarantineDebtBoard(): JSX.Element {@@ -24,7 +25,7 @@ function TrunkQuarantineDebtBoard(): JSX.Element {trunkQuarantineTestsByTeam,expandedTrunkQuarantineTeams,} = useValues(engineeringAnalyticsLogic)- const { toggleTrunkQuarantineTeam } = useActions(engineeringAnalyticsLogic)+ const { loadTrunkQuarantine, toggleTrunkQuarantineTeam } = useActions(engineeringAnalyticsLogic)const ttlDays = trunkQuarantine?.ttlDays ?? 15const overdueCount = trunkQuarantine ? trunkQuarantine.teams.reduce((n, t) => n + t.overdueCount, 0) : null@@ -68,7 +69,14 @@ function TrunkQuarantineDebtBoard(): JSX.Element {]if (trunkQuarantineStatus === 'error') {- return <LemonBanner type="warning">Couldn't load Trunk quarantine data. Try refreshing.</LemonBanner>+ return (+ <CIAnalyticsLoadError+ onRetry={loadTrunkQuarantine}+ loading={trunkQuarantineLoading}+ title="Couldn't load Trunk quarantine data"+ description="Loading quarantined tests from Trunk failed. Retry, or check the Trunk source's sync status."+ />+ )}if (trunkQuarantineStatus === 'notConnected' || (trunkQuarantine && !trunkQuarantine.available)) {return (@@ -80,10 +88,11 @@ function TrunkQuarantineDebtBoard(): JSX.Element {}return (- <div className="flex flex-col gap-4">- <div className="flex items-center justify-between gap-2">- <h3 className="m-0 text-base font-semibold">Quarantine debt by team</h3>- {trunkQuarantine?.trunkUrl && (+ <Section+ id="quarantine-debt"+ title="Quarantine debt by team"+ right={+ trunkQuarantine?.trunkUrl ? (<LemonButtonsize="small"type="secondary"@@ -94,84 +103,80 @@ function TrunkQuarantineDebtBoard(): JSX.Element {>Open in Trunk</LemonButton>+ ) : undefined+ }+ >+ <div className="flex flex-col gap-4">+ <div className="grid grid-cols-1 gap-3 @2xl/main-content:grid-cols-2 @5xl/main-content:grid-cols-4">+ <StatCard+ label="Quarantined tests"+ value={trunkQuarantine ? formatCappedCount(trunkQuarantine.tests.length) : '—'}+ caption="currently masked in CI"+ loading={trunkQuarantineLoading}+ />+ <StatCard+ label="Overdue"+ value={overdueCount !== null ? formatCappedCount(overdueCount) : '—'}+ caption={`quarantined over ${ttlDays} days`}+ loading={trunkQuarantineLoading}+ />+ <StatCard+ label="Teams affected"+ value={trunkQuarantine ? formatCappedCount(trunkQuarantine.teams.length) : '—'}+ caption="own at least one quarantined test"+ loading={trunkQuarantineLoading}+ />+ <StatCard+ label="Oldest quarantine"+ value={oldestAgeDays !== null ? `${oldestAgeDays}d` : '—'}+ caption="longest-standing masked test"+ loading={trunkQuarantineLoading}+ />+ </div>+ {trunkQuarantine?.truncated && (+ <div className="text-xs text-tertiary">+ Showing the oldest {humanFriendlyNumber(trunkQuarantine.limit)} quarantined tests. The counts+ above are lower bounds.+ </div>)}- </div>- <div className="grid grid-cols-1 gap-3 @2xl/main-content:grid-cols-2 @5xl/main-content:grid-cols-4">- <StatCard- label="Quarantined tests"- value={trunkQuarantine ? formatCappedCount(trunkQuarantine.tests.length) : '—'}- caption="currently masked in CI"- loading={trunkQuarantineLoading}- />- <StatCard- label="Overdue"- value={overdueCount !== null ? formatCappedCount(overdueCount) : '—'}- caption={`quarantined over ${ttlDays} days`}- loading={trunkQuarantineLoading}- />- <StatCard- label="Teams affected"- value={trunkQuarantine ? formatCappedCount(trunkQuarantine.teams.length) : '—'}- caption="own at least one quarantined test"- loading={trunkQuarantineLoading}- />- <StatCard- label="Oldest quarantine"- value={oldestAgeDays !== null ? `${oldestAgeDays}d` : '—'}- caption="longest-standing masked test"+ {trunkQuarantine && !trunkQuarantine.ownersResolved && (+ <LemonBanner type="warning">+ We could not read {trunkQuarantine.repository}'s ownership files, so every test below is listed+ as unowned. Try again in a few minutes.+ </LemonBanner>+ )}+ <LemonTable+ data-attr="engineering-analytics-trunk-debt-teams-table"+ size="small"+ columns={teamColumns}+ dataSource={trunkQuarantine?.teams ?? []}+ rowKey={(row) => row.ownerTeam}loading={trunkQuarantineLoading}+ useURLForSorting={false}+ emptyState="No tests are quarantined right now."+ nouns={['team', 'teams']}+ onRow={(row) => ({+ className: 'cursor-pointer',+ onClick: () => toggleTrunkQuarantineTeam(row.ownerTeam),+ })}+ expandable={{+ noIndent: true,+ isRowExpanded: (row) => expandedTrunkQuarantineTeams.includes(row.ownerTeam),+ expandedRowRender: (row) => (+ <TeamQuarantinedTestsTable+ tests={trunkQuarantineTestsByTeam[row.ownerTeam] ?? []}+ ttlDays={ttlDays}+ repository={trunkQuarantine?.repository ?? ''}+ />+ ),+ }}/></div>- {trunkQuarantine?.truncated && (- <div className="text-xs text-tertiary">- Showing the oldest {humanFriendlyNumber(trunkQuarantine.limit)} quarantined tests. The counts above- are lower bounds.- </div>- )}- {trunkQuarantine && !trunkQuarantine.ownersResolved && (- <LemonBanner type="warning">- We could not read {trunkQuarantine.repository}'s ownership files, so every test below is listed as- unowned. Try again in a few minutes.- </LemonBanner>- )}- <LemonTable- data-attr="engineering-analytics-trunk-debt-teams-table"- size="small"- columns={teamColumns}- dataSource={trunkQuarantine?.teams ?? []}- rowKey={(row) => row.ownerTeam}- loading={trunkQuarantineLoading}- useURLForSorting={false}- emptyState="No tests are quarantined right now."- nouns={['team', 'teams']}- onRow={(row) => ({- className: 'cursor-pointer',- onClick: () => toggleTrunkQuarantineTeam(row.ownerTeam),- })}- expandable={{- noIndent: true,- isRowExpanded: (row) => expandedTrunkQuarantineTeams.includes(row.ownerTeam),- expandedRowRender: (row) => (- <TeamQuarantinedTestsTable- tests={trunkQuarantineTestsByTeam[row.ownerTeam] ?? []}- ttlDays={ttlDays}- repository={trunkQuarantine?.repository ?? ''}- />- ),- }}- />- </div>+ </Section>)}export function EngineeringAnalyticsTestHealth(): JSX.Element {- const { quarantineLoadFailed } = useValues(engineeringAnalyticsLogic)-- // Production with no GitHub source and no local checkout: the endpoint 400s, same as the other tabs.- if (quarantineLoadFailed) {- return <ConnectGitHubSource />- }-return (<div className="flex flex-col gap-8"><ScopeBar repoSlot={<SourceScopeChip />} showDate={false} />diff --git a/products/engineering_analytics/frontend/scenes/RepoOverviewScene.tsx b/products/engineering_analytics/frontend/scenes/RepoOverviewScene.tsxindex 647a34a1152a..3ba046b6754b 100644--- a/products/engineering_analytics/frontend/scenes/RepoOverviewScene.tsx+++ b/products/engineering_analytics/frontend/scenes/RepoOverviewScene.tsx@@ -5,7 +5,7 @@import { useActions, useValues } from 'kea'import { router } from 'kea-router'-import { LemonButton, LemonCard, Link, Tooltip } from '@posthog/lemon-ui'+import { LemonButton, LemonCard, LemonSkeleton, Link, Tooltip } from '@posthog/lemon-ui'import { humanFriendlyNumber } from 'lib/utils/numbers'import { urls } from 'scenes/urls'@@ -43,8 +43,16 @@ export function RepoOverviewScene(): JSX.Element {prPreviewCount,workflowPreviewCount,} = useValues(repoOverviewLogic)- const { pullRequestsLoading, workflowHealth, workflowHealthLoading, sourceId, activeSource } =- useValues(engineeringAnalyticsLogic)+ const {+ pullRequestsLoading,+ pullRequestsStatus,+ workflowHealth,+ workflowHealthLoadError,+ workflowHealthLoading,+ sourceId,+ activeSource,+ } = useValues(engineeringAnalyticsLogic)+ const { loadPullRequests, loadWorkflowHealth } = useActions(engineeringAnalyticsLogic)const { loadOverview, loadRepoActivity, showMorePrs, showMoreWorkflows } = useActions(repoOverviewLogic)const { searchParams } = useValues(router)@@ -95,47 +103,49 @@ export function RepoOverviewScene(): JSX.Element {one directly (two values), not as a time series. CI cost is a window total, not arate, so its number lives on the Workflows section below. */}<Section id="ci-health" title="CI health" busy={overviewLoading}>- <div className="grid grid-cols-1 gap-2 md:grid-cols-2">- <WindowComparisonCard- title="CI pass rate"- value={overview?.success_rate}- previousValue={overview?.success_rate_prev}- formatValue={(value) => percent(value, 1)}- share- 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."- emptyText="No CI runs reached a pass-or-fail result in the window."- />+ <div className="@container">+ <div className="grid grid-cols-1 gap-2 @min-[36rem]:grid-cols-2">+ <WindowComparisonCard+ title="CI pass rate"+ value={overview?.success_rate}+ previousValue={overview?.success_rate_prev}+ formatValue={(value) => percent(value, 1)}+ share+ 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."+ emptyText="No CI runs reached a pass-or-fail result in the window."+ />- <WindowComparisonCard- title="Median time from push to all checks green"- value={asMinutes(overview?.median_time_to_green_seconds)}- previousValue={asMinutes(overview?.median_time_to_green_seconds_prev)}- formatValue={formatAxisMinutes}- goodWhenDown- loading={overviewPending}- tooltip="Median time from a push to a pull request until every workflow on it is green. Only pushes that went fully green count."- emptyText="No fully green PR pushes in the window yet."- />+ <WindowComparisonCard+ title="Median time from push to all checks green"+ value={asMinutes(overview?.median_time_to_green_seconds)}+ previousValue={asMinutes(overview?.median_time_to_green_seconds_prev)}+ formatValue={formatAxisMinutes}+ goodWhenDown+ loading={overviewPending}+ tooltip="Median time from a push to a pull request until every workflow on it is green. Only pushes that went fully green count."+ emptyText="No fully green PR pushes in the window yet."+ />- <WindowComparisonCard- title="CI spend per merged PR"- value={overview?.cost_per_merge_usd}- previousValue={overview?.cost_per_merge_usd_prev}- formatValue={compactUsd}- goodWhenDown- loading={overviewPending}- emptyText={- !jobsAvailable- ? 'Cost appears once the job-level source is synced.'- : overview?.merged_pr_count === 0- ? 'Nothing merged in the window.'- : 'No costable jobs in the window.'- }- tooltip="Estimated CI cost of every run in the window, divided by the pull requests merged in it. Includes runs on the default branch and on pull requests that never merged. Per-workflow spend is in Workflows below."- />+ <WindowComparisonCard+ title="CI spend per merged PR"+ value={overview?.cost_per_merge_usd}+ previousValue={overview?.cost_per_merge_usd_prev}+ formatValue={compactUsd}+ goodWhenDown+ loading={overviewPending}+ emptyText={+ !jobsAvailable+ ? 'Cost appears once the job-level source is synced.'+ : overview?.merged_pr_count === 0+ ? 'Nothing merged in the window.'+ : 'No costable jobs in the window.'+ }+ tooltip="Estimated CI cost of every run in the window, divided by the pull requests merged in it. Includes runs on the default branch and on pull requests that never merged. Per-workflow spend is in Workflows below."+ />+ </div></div></Section>@@ -147,7 +157,13 @@ export function RepoOverviewScene(): JSX.Element {{/* Hub preview: one bar per default-branch commit, height = CI duration, color = verdict, so"is master healthy and fast lately" reads at a glance without the full chart's weight. Thefull scatter (start-time axis, in-flight band, zoom) lives on the workflow page. */}- {hasEnoughRunActivity(activityRuns) ? (+ {repoActivityLoading ? (+ <LemonSkeleton className="h-40 w-full" />+ ) : repoActivityFailed ? (+ <LemonCard hoverEffect={false} className="p-4 text-xs text-secondary">+ Couldn't load {overviewDefaultBranch} activity. Refresh to retry.+ </LemonCard>+ ) : hasEnoughRunActivity(activityRuns) ? (<RunActivityMiniBarsruns={activityRuns}truncated={activityTruncated}@@ -169,11 +185,7 @@ export function RepoOverviewScene(): JSX.Element {/>) : (<LemonCard hoverEffect={false} className="p-4 text-xs text-secondary">- {repoActivityLoading- ? 'Loading…'- : repoActivityFailed- ? `Couldn't load ${overviewDefaultBranch} activity. Refresh to retry.`- : `Not enough completed runs on ${overviewDefaultBranch} in the window to chart yet.`}+ Not enough completed runs on {overviewDefaultBranch} in the window to chart yet.</LemonCard>)}</Section>@@ -193,73 +205,82 @@ export function RepoOverviewScene(): JSX.Element {) : undefined}>+ {workflowHealthLoadError ? (+ <CIAnalyticsLoadError onRetry={loadWorkflowHealth} loading={workflowHealthLoading} />+ ) : (+ <LemonCard hoverEffect={false} className="overflow-hidden p-0">+ <WorkflowHealthTable+ rows={shownWorkflows}+ loading={workflowHealthLoading}+ sourceId={sourceId}+ showCost={jobsAvailable}+ embedded+ compact+ pageSize={HUB_PREVIEW_MAX}+ emptyState="No workflow runs in the window."+ />+ <div className="flex flex-wrap items-center justify-between gap-2 border-t border-primary px-4 py-2 text-[11px] text-tertiary">+ <span>+ Showing top {shownWorkflows.length} of {workflowHealth.length} workflows+ </span>+ <div className="flex items-center gap-3">+ {canShowMoreWorkflows && (+ <LemonButton size="xsmall" onClick={showMoreWorkflows}>+ Show more+ </LemonButton>+ )}+ <Link+ to={+ // A bare link would reset the shared window / run scope / repo (the filters+ // logic re-hydrates from the URL on every route), so carry it, plus the source.+ withScope(urls.engineeringAnalyticsWorkflows(), searchParams, sourceId)+ }+ >+ View all →+ </Link>+ </div>+ </div>+ </LemonCard>+ )}+ </Section>+ </ScopePanel>++ <Section+ id="prs"+ title="Pull requests needing attention"+ note="Current open backlog. Not affected by the date range."+ >+ {pullRequestsStatus === 'error' ? (+ <CIAnalyticsLoadError onRetry={loadPullRequests} loading={pullRequestsLoading} />+ ) : (<LemonCard hoverEffect={false} className="overflow-hidden p-0">- <WorkflowHealthTable- rows={shownWorkflows}- loading={workflowHealthLoading}+ <PullRequestTable+ rows={shownPrs}+ loading={pullRequestsLoading}sourceId={sourceId}- showCost={jobsAvailable}embedded- compactpageSize={HUB_PREVIEW_MAX}- emptyState="No workflow runs in the window."+ emptyState="Nothing failing or stuck in the open backlog."+ dataAttr="engineering-analytics-attention-prs"/><div className="flex flex-wrap items-center justify-between gap-2 border-t border-primary px-4 py-2 text-[11px] text-tertiary"><span>- Showing top {shownWorkflows.length} of {workflowHealth.length} workflows+ Showing {shownPrs.length} of {humanFriendlyNumber(attentionPrs.length)} needing+ attention</span><div className="flex items-center gap-3">- {canShowMoreWorkflows && (- <LemonButton size="xsmall" onClick={showMoreWorkflows}>+ {canShowMorePrs && (+ <LemonButton size="xsmall" onClick={showMorePrs}>Show more</LemonButton>)}- <Link- to={- // A bare link would reset the shared window / run scope / repo (the filters- // logic re-hydrates from the URL on every route), so carry it, plus the source.- withScope(urls.engineeringAnalyticsWorkflows(), searchParams, sourceId)- }- >+ <Link to={withCurrentScope(urls.engineeringAnalyticsPullRequestList(), sourceId)}>View all →</Link></div></div></LemonCard>- </Section>- </ScopePanel>-- <Section- id="prs"- title="Pull requests needing attention"- note="Current open backlog. Not affected by the date range."- >- <LemonCard hoverEffect={false} className="overflow-hidden p-0">- <PullRequestTable- rows={shownPrs}- loading={pullRequestsLoading}- sourceId={sourceId}- embedded- pageSize={HUB_PREVIEW_MAX}- emptyState="Nothing failing or stuck in the open backlog."- dataAttr="engineering-analytics-attention-prs"- />- <div className="flex flex-wrap items-center justify-between gap-2 border-t border-primary px-4 py-2 text-[11px] text-tertiary">- <span>- Showing {shownPrs.length} of {humanFriendlyNumber(attentionPrs.length)} needing attention- </span>- <div className="flex items-center gap-3">- {canShowMorePrs && (- <LemonButton size="xsmall" onClick={showMorePrs}>- Show more- </LemonButton>- )}- <Link to={withCurrentScope(urls.engineeringAnalyticsPullRequestList(), sourceId)}>- View all →- </Link>- </div>- </div>- </LemonCard>+ )}</Section></div>)diff --git a/products/engineering_analytics/frontend/scenes/engineeringAnalyticsLogic.test.ts b/products/engineering_analytics/frontend/scenes/engineeringAnalyticsLogic.test.tsindex 86e7a62c5359..b85cf2393bc1 100644--- a/products/engineering_analytics/frontend/scenes/engineeringAnalyticsLogic.test.ts+++ b/products/engineering_analytics/frontend/scenes/engineeringAnalyticsLogic.test.ts@@ -719,16 +719,17 @@ describe('engineeringAnalyticsLogic', () => {])})- it('flags quarantineLoadFailed when the quarantine endpoint 400s', async () => {- silenceKeaLoadersErrors() // the loader failure is the scenario under test- mockQuarantine.mockRejectedValue(- new Error('Connect a GitHub data warehouse source to use engineering analytics.')- )+ it.each([+ [400, 'notConnected'],+ [500, 'error'],+ ])('maps a quarantine %i response to %s', async (statusCode, expectedStatus) => {+ silenceKeaLoadersErrors()+ mockTrunkQuarantine.mockRejectedValue(new ApiError('Quarantine request failed.', statusCode))logic = engineeringAnalyticsLogic()logic.mount()- await expectLogic(logic).toDispatchActions(['loadQuarantineFailure'])+ await expectLogic(logic).toDispatchActions(['loadTrunkQuarantineFailure'])- expect(logic.values.quarantineLoadFailed).toBe(true)+ expect(logic.values.trunkQuarantineStatus).toBe(expectedStatus)})})diff --git a/products/engineering_analytics/frontend/scenes/engineeringAnalyticsLogic.ts b/products/engineering_analytics/frontend/scenes/engineeringAnalyticsLogic.tsindex a0153f3ac2d9..e65700b93c63 100644--- a/products/engineering_analytics/frontend/scenes/engineeringAnalyticsLogic.ts+++ b/products/engineering_analytics/frontend/scenes/engineeringAnalyticsLogic.ts@@ -425,7 +425,6 @@ export interface engineeringAnalyticsLogicValues {pullRequestsLoading: booleanpullRequestsStatus: LoaderStatusquarantine: QuarantineData | null- quarantineLoadFailed: booleanquarantineLoading: booleanreadyCount: numberreadyOnly: boolean@@ -939,15 +938,6 @@ export const engineeringAnalyticsLogic: LogicWrapper<engineeringAnalyticsLogicTyloadCardsFailure: (_, { errorObject }) => loaderStatusFromError(errorObject),},],- // The quarantine endpoint only 400s when there's no GitHub source and no local checkout.- quarantineLoadFailed: [- false,- {- loadQuarantine: () => false,- loadQuarantineSuccess: () => false,- loadQuarantineFailure: () => true,- },- ],// Whole-row click toggles a team's slice open (controlled LemonTable expansion, like the// workflow runs table); a scope switch loads different teams, so open rows reset with it.expandedTrunkQuarantineTeams: [diff --git a/products/engineering_analytics/frontend/scenes/teamsLogic.ts b/products/engineering_analytics/frontend/scenes/teamsLogic.tsindex f3255fde581c..5c523ffec662 100644--- a/products/engineering_analytics/frontend/scenes/teamsLogic.ts+++ b/products/engineering_analytics/frontend/scenes/teamsLogic.ts@@ -1,4 +1,4 @@-import { MakeLogicType, afterMount, connect, kea, listeners, path } from 'kea'+import { MakeLogicType, afterMount, connect, kea, listeners, path, reducers, selectors } from 'kea'import { loaders } from 'kea-loaders'import { ApiConfig } from 'lib/api'@@ -6,7 +6,7 @@ import { dateMapping } from 'lib/utils/dateFilters'import { engineeringAnalyticsTeamCiHealth } from '../generated/api'import type { TeamCIHealthItemApi } from '../generated/api.schemas'-import { engineeringAnalyticsLogic } from './engineeringAnalyticsLogic'+import { LoaderStatus, engineeringAnalyticsLogic, loaderStatusFromError } from './engineeringAnalyticsLogic'const projectId = (): string => String(ApiConfig.getCurrentProjectId())@@ -72,7 +72,10 @@ export function toTeamCIHealthRow(it: TeamCIHealthItemApi): TeamCIHealthRow {export interface teamsLogicValues {sourceId: string | null // engineeringAnalyticsLogicteams: TeamsData | null+ teamsFailed: booleanteamsLoading: boolean+ teamsNotConnected: boolean+ teamsStatus: LoaderStatus}// Generated by kea-typegen. Update if you're an agent, ignore if you're human.@@ -97,7 +100,15 @@ export interface teamsLogicActions {}}-export type teamsLogicType = MakeLogicType<teamsLogicValues, teamsLogicActions>+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface teamsLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ teamsFailed: (teamsStatus: LoaderStatus) => boolean+ teamsNotConnected: (teamsStatus: LoaderStatus) => boolean+ }+}++export type teamsLogicType = MakeLogicType<teamsLogicValues, teamsLogicActions, Record<string, any>, teamsLogicMeta>export const teamsLogic = kea<teamsLogicType>([path(['products', 'engineering_analytics', 'frontend', 'scenes', 'teamsLogic']),@@ -123,6 +134,20 @@ export const teamsLogic = kea<teamsLogicType>([},],})),+ reducers({+ teamsStatus: [+ 'ok' as LoaderStatus,+ {+ loadTeams: () => 'ok',+ loadTeamsSuccess: () => 'ok',+ loadTeamsFailure: (_, { errorObject }) => loaderStatusFromError(errorObject),+ },+ ],+ }),+ selectors({+ teamsFailed: [(s) => [s.teamsStatus], (status: LoaderStatus): boolean => status === 'error'],+ teamsNotConnected: [(s) => [s.teamsStatus], (status: LoaderStatus): boolean => status === 'notConnected'],+ }),listeners(({ actions }) => ({setSourceId: () => actions.loadTeams(),})),diff --git a/products/engineering_analytics/frontend/scenes/timeToProductionLogic.ts b/products/engineering_analytics/frontend/scenes/timeToProductionLogic.tsindex 84de6a38aaeb..837d14fe5037 100644--- a/products/engineering_analytics/frontend/scenes/timeToProductionLogic.ts+++ b/products/engineering_analytics/frontend/scenes/timeToProductionLogic.ts@@ -1,4 +1,4 @@-import { MakeLogicType, afterMount, connect, kea, listeners, path } from 'kea'+import { MakeLogicType, afterMount, connect, kea, listeners, path, reducers } from 'kea'import { loaders } from 'kea-loaders'import { ApiConfig } from 'lib/api'@@ -17,6 +17,7 @@ export interface timeToProductionLogicValues {scopeRepo: string | null // engineeringAnalyticsLogicsourceId: string | null // engineeringAnalyticsLogictiming: RepoOverviewApi | null+ timingFailed: booleantimingLoading: boolean}@@ -73,6 +74,17 @@ export const timeToProductionLogic = kea<timeToProductionLogicType>([],})),+ reducers({+ timingFailed: [+ false,+ {+ loadTiming: () => false,+ loadTimingSuccess: () => false,+ loadTimingFailure: () => true,+ },+ ],+ }),+listeners(({ actions }) => ({[engineeringAnalyticsFiltersLogic.actionTypes.setDateRange]: () => actions.loadTiming(),[engineeringAnalyticsLogic.actionTypes.setSourceId]: () => actions.loadTiming(),