Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions apps/design-system/styles/globals.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

@import './../../../packages/ui/build/css/source/global.css';
@import './../../../packages/ui/build/css/themes/dark.css';
@import './../../../packages/ui/build/css/themes/classic-dark.css';
@import './../../../packages/ui/build/css/themes/light.css';

@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
:root {
--chart-1: 12 76% 61%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -31,6 +33,8 @@ export const PipelineStatus = ({
isSuccess,
requestStatus,
}: PipelineStatusProps) => {
const { ref } = useParams()

// Map backend statuses to UX-friendly display
const getStatusConfig = () => {
const statusName =
Expand Down Expand Up @@ -138,7 +142,17 @@ export const PipelineStatus = ({
<span>{statusConfig.label}</span>
</div>
</TooltipTrigger>
<TooltipContent side="bottom">{statusConfig.tooltip}</TooltipContent>
<TooltipContent side="bottom">
{statusConfig.tooltip}
{['unknown', 'failed'].includes(pipelineStatus?.name ?? '') && (
<>
{' '}
Check the{' '}
<InlineLink href={`/project/${ref}/logs/etl-replication-logs`}>logs</InlineLink> for
more information.
</>
)}
</TooltipContent>
</Tooltip>
)}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ export const ReplicationPipelineStatus = () => {
}
/>
</div>
<Button asChild type="default">
<Link href={`/project/${projectRef}/logs/etl-replication-logs`}>View logs</Link>
</Button>
<Button
type={statusName === 'stopped' ? 'primary' : 'default'}
onClick={() => onTogglePipeline()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ export enum LogsTableName {
PGBOUNCER = 'pgbouncer_logs',
PG_UPGRADE = 'pg_upgrade_logs',
PG_CRON = 'pg_cron_logs',
ETL = 'etl_replication_logs',
}

export const LOGS_TABLES = {
Expand All @@ -387,6 +388,7 @@ export const LOGS_TABLES = {
pg_upgrade: LogsTableName.PG_UPGRADE,
pg_cron: LogsTableName.POSTGRES,
pgbouncer: LogsTableName.PGBOUNCER,
etl: LogsTableName.ETL,
}

export const LOGS_SOURCE_DESCRIPTION = {
Expand All @@ -402,6 +404,7 @@ export const LOGS_SOURCE_DESCRIPTION = {
[LogsTableName.PGBOUNCER]: 'Dedicated connection pooler for PostgreSQL',
[LogsTableName.PG_UPGRADE]: 'Logs generated by the Postgres version upgrade process',
[LogsTableName.PG_CRON]: 'Postgres logs from pg_cron cron jobs',
[LogsTableName.ETL]: 'Logs from the ETL replication process',
}

export const FILTER_OPTIONS: FilterTableSet = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export type QueryType =
| 'pg_upgrade'
| 'pg_cron'
| 'pgbouncer'
| 'etl'

export type Mode = 'simple' | 'custom'

Expand Down
22 changes: 22 additions & 0 deletions apps/studio/components/layouts/LogsLayout/LogsSidebarMenuV2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
} from 'ui-patterns/InnerSideMenu'
import { GenericSkeletonLoader } from 'ui-patterns/ShimmeringLoader'
import { FeaturePreviewSidebarPanel } from '../../ui/FeaturePreviewSidebarPanel'
import { useReplicationSourcesQuery } from 'data/replication/sources-query'

const SupaIcon = ({ className }: { className?: string }) => {
return (
Expand Down Expand Up @@ -91,6 +92,19 @@ export function LogsSidebarMenuV2() {
realtimeAll: realtimeEnabled,
} = useIsFeatureEnabled(['project_storage:all', 'project_auth:all', 'realtime:all'])

const enablePgReplicate = useFlag('enablePgReplicate')
const { data: etlData, isLoading: isETLLoading } = useReplicationSourcesQuery(
{
projectRef: ref,
},
{
enabled: enablePgReplicate,
}
)

// [Jordi] We only want to show ETL logs if the user has the feature enabled AND they're using the feature aka they've created a source.
const showETLLogs = enablePgReplicate && (etlData?.sources?.length ?? 0) > 0 && !isETLLoading

const { plan: orgPlan, isLoading: isOrgPlanLoading } = useCurrentOrgPlan()
const isFreePlan = !isOrgPlanLoading && orgPlan?.id === 'free'

Expand Down Expand Up @@ -183,6 +197,14 @@ export function LogsSidebarMenuV2() {
url: `/project/${ref}/logs/pgcron-logs`,
items: [],
},
showETLLogs
? {
name: 'ETL Replication',
key: 'etl_replication_logs',
url: `/project/${ref}/logs/etl-replication-logs`,
items: [],
}
: null,
].filter((x) => x !== null)

const OPERATIONAL_COLLECTIONS = IS_PLATFORM
Expand Down
27 changes: 27 additions & 0 deletions apps/studio/pages/project/[ref]/logs/etl-replication-logs.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { LogsTableName } from 'components/interfaces/Settings/Logs/Logs.constants'
import LogsPreviewer from 'components/interfaces/Settings/Logs/LogsPreviewer'
import LogsLayout from 'components/layouts/LogsLayout/LogsLayout'
import DefaultLayout from 'components/layouts/DefaultLayout'
import type { NextPageWithLayout } from 'types'
import { useParams } from 'common'

export const LogPage: NextPageWithLayout = () => {
const { ref } = useParams()

return (
<LogsPreviewer
condensedLayout
queryType="etl"
projectRef={ref!}
tableName={LogsTableName.ETL}
/>
)
}

LogPage.getLayout = (page) => (
<DefaultLayout>
<LogsLayout title="ETL Replication Logs">{page}</LogsLayout>
</DefaultLayout>
)

export default LogPage
1 change: 1 addition & 0 deletions apps/www/pages/edge-functions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ function EdgeFunctions() {
<ProductHeader
{...pageData.heroSection}
footer={<HighlightColumns highlights={pageData.highlightsSection.highlights} />}
footerPosition="bottom"
/>
<SingleQuote
id="quote"
Expand Down
9 changes: 9 additions & 0 deletions packages/eslint-config-supabase/next.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,14 @@ module.exports = {
rules: {
'@next/next/no-html-link-for-pages': 'off',
'react/jsx-key': 'off',
'no-restricted-exports': ['warn', { restrictDefaultExports: { direct: true } }],
},
overrides: [
{
files: ['pages/**', 'app/**'],
rules: {
'no-restricted-exports': 'off',
},
},
],
}
Loading