From 99dcbfe3dc6c067ab8f8606170d063f3cc779579 Mon Sep 17 00:00:00 2001 From: Jordi Enric <37541088+jordienr@users.noreply.github.com> Date: Fri, 15 Aug 2025 13:22:40 +0200 Subject: [PATCH 1/4] add etl logs (#37930) * add etl logs * fix missing desc * rename to etl-replication-logs * rename sidebar * Add links to ETL logs * Fix * Smol --------- Co-authored-by: Joshen Lim --- .../Database/Replication/Pipeline.utils.ts | 22 +++++++-------- .../Database/Replication/PipelineStatus.tsx | 16 ++++++++++- .../Replication/ReplicationPipelineStatus.tsx | 3 +++ .../Settings/Logs/Logs.constants.ts | 3 +++ .../interfaces/Settings/Logs/Logs.types.ts | 1 + .../layouts/LogsLayout/LogsSidebarMenuV2.tsx | 22 +++++++++++++++ .../[ref]/logs/etl-replication-logs.tsx | 27 +++++++++++++++++++ 7 files changed, 82 insertions(+), 12 deletions(-) create mode 100644 apps/studio/pages/project/[ref]/logs/etl-replication-logs.tsx diff --git a/apps/studio/components/interfaces/Database/Replication/Pipeline.utils.ts b/apps/studio/components/interfaces/Database/Replication/Pipeline.utils.ts index d15fe8040cc2a..2d3efaf233770 100644 --- a/apps/studio/components/interfaces/Database/Replication/Pipeline.utils.ts +++ b/apps/studio/components/interfaces/Database/Replication/Pipeline.utils.ts @@ -22,44 +22,44 @@ export const getStatusName = ( return undefined } -export const PIPELINE_STATE_MESSAGES = { +const PIPELINE_STATE_MESSAGES = { enabling: { - title: 'Pipeline Enabling', + title: 'Pipeline enabling', message: 'Starting the pipeline. Table replication will resume once enabled.', badge: 'Enabling', }, disabling: { - title: 'Pipeline Disabling', + title: 'Pipeline disabling', message: 'Stopping the pipeline. Table replication will be paused once disabled.', badge: 'Disabling', }, failed: { - title: 'Pipeline Failed', - message: 'Replication has encountered an error. Check the logs for details.', + title: 'Pipeline failed', + message: 'Replication has encountered an error.', badge: 'Failed', }, stopped: { - title: 'Pipeline Stopped', + title: 'Pipeline stopped', message: 'Replication is paused. Enable the pipeline to resume data synchronization.', badge: 'Stopped', }, starting: { - title: 'Pipeline Starting', + title: 'Pipeline starting', message: 'Initializing replication. Table status will be available once running.', badge: 'Starting', }, running: { - title: 'Pipeline Running', + title: 'Pipeline running', message: 'Replication is active and processing data', badge: 'Running', }, unknown: { - title: 'Pipeline Status Unknown', - message: 'Unable to determine replication status. Check the logs for more information.', + title: 'Pipeline status unknown', + message: 'Unable to determine replication status.', badge: 'Unknown', }, notRunning: { - title: 'Pipeline Not Running', + title: 'Pipeline not running', message: 'Replication is not active. Enable the pipeline to start data synchronization.', badge: 'Disabled', }, diff --git a/apps/studio/components/interfaces/Database/Replication/PipelineStatus.tsx b/apps/studio/components/interfaces/Database/Replication/PipelineStatus.tsx index c33087468ad2a..69a988996d7d9 100644 --- a/apps/studio/components/interfaces/Database/Replication/PipelineStatus.tsx +++ b/apps/studio/components/interfaces/Database/Replication/PipelineStatus.tsx @@ -1,3 +1,5 @@ +import { useParams } from 'common' +import { InlineLink } from 'components/ui/InlineLink' import { ReplicationPipelineStatusData } from 'data/replication/pipeline-status-query' import { AlertTriangle, Loader2 } from 'lucide-react' import { PipelineStatusRequestStatus } from 'state/replication-pipeline-request-status' @@ -31,6 +33,8 @@ export const PipelineStatus = ({ isSuccess, requestStatus, }: PipelineStatusProps) => { + const { ref } = useParams() + // Map backend statuses to UX-friendly display const getStatusConfig = () => { const statusName = @@ -138,7 +142,17 @@ export const PipelineStatus = ({ {statusConfig.label} - {statusConfig.tooltip} + + {statusConfig.tooltip} + {['unknown', 'failed'].includes(pipelineStatus?.name ?? '') && ( + <> + {' '} + Check the{' '} + logs for + more information. + + )} + )} diff --git a/apps/studio/components/interfaces/Database/Replication/ReplicationPipelineStatus.tsx b/apps/studio/components/interfaces/Database/Replication/ReplicationPipelineStatus.tsx index 6205fdfb4b90b..dd098652c769a 100644 --- a/apps/studio/components/interfaces/Database/Replication/ReplicationPipelineStatus.tsx +++ b/apps/studio/components/interfaces/Database/Replication/ReplicationPipelineStatus.tsx @@ -174,6 +174,9 @@ export const ReplicationPipelineStatus = () => { } /> +