Skip to content

Commit

Permalink
feat(syncs-status-reason): Latest error to syncs tab (PostHog#29034)
Browse files Browse the repository at this point in the history
  • Loading branch information
phixMe authored Feb 21, 2025
1 parent e349c1e commit b2cf093
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
13 changes: 10 additions & 3 deletions frontend/src/scenes/data-warehouse/settings/source/Syncs.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { LemonButton, LemonTable, LemonTag, LemonTagType } from '@posthog/lemon-ui'
import { LemonButton, LemonTable, LemonTag, LemonTagType, Tooltip } from '@posthog/lemon-ui'
import { useActions, useValues } from 'kea'
import { TZLabel } from 'lib/components/TZLabel'

import { ExternalDataJob } from '~/types'
import { ExternalDataJob, ExternalDataJobStatus } from '~/types'

import { dataWarehouseSourceSettingsLogic } from './dataWarehouseSourceSettingsLogic'
import { LogsView } from './Logs'
Expand Down Expand Up @@ -38,7 +38,14 @@ export const Syncs = ({ id }: SyncsProps): JSX.Element => {
{
title: 'Status',
render: (_, job) => {
return <LemonTag type={StatusTagSetting[job.status]}>{job.status}</LemonTag>
const tagContent = (
<LemonTag type={StatusTagSetting[job.status] || 'default'}>{job.status}</LemonTag>
)
return job.latest_error && job.status === ExternalDataJobStatus.Failed ? (
<Tooltip title={job.latest_error}>{tagContent}</Tooltip>
) : (
tagContent
)
},
},
{
Expand Down
9 changes: 8 additions & 1 deletion frontend/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4220,10 +4220,17 @@ export interface ExternalDataSourceSchema extends SimpleExternalDataSourceSchema
sync_frequency: DataWarehouseSyncInterval
}

export enum ExternalDataJobStatus {
Running = 'Running',
Completed = 'Completed',
Failed = 'Failed',
BillingLimits = 'Billing limits',
}

export interface ExternalDataJob {
id: string
created_at: string
status: 'Running' | 'Failed' | 'Completed' | 'Billing limits'
status: ExternalDataJobStatus
schema: SimpleExternalDataSourceSchema
rows_synced: number
latest_error: string
Expand Down

0 comments on commit b2cf093

Please sign in to comment.