diff --git a/.github/workflows/on_pull_request_supabase.yml b/.github/workflows/on_pull_request_supabase.yml index a7f5e9c744..b66e0ca7c3 100644 --- a/.github/workflows/on_pull_request_supabase.yml +++ b/.github/workflows/on_pull_request_supabase.yml @@ -5,7 +5,7 @@ on: types: [opened, synchronize, reopened, ready_for_review] jobs: - test: + on-pull-request-supabase: runs-on: ubuntu-latest env: diff --git a/apps/backend/supabase/schema.gen.ts b/apps/backend/supabase/schema.gen.ts index d9b31fc501..f5969a4398 100644 --- a/apps/backend/supabase/schema.gen.ts +++ b/apps/backend/supabase/schema.gen.ts @@ -34,340 +34,13 @@ export interface Database { } public: { Tables: { - assistant_threads: { - Row: { - created_at: string - id: number - openai_thread_id: string | null - slack_thread_ts: string | null - } - Insert: { - created_at?: string - id?: number - openai_thread_id?: string | null - slack_thread_ts?: string | null - } - Update: { - created_at?: string - id?: number - openai_thread_id?: string | null - slack_thread_ts?: string | null - } - Relationships: [] - } - page: { - Row: { - checksum: string | null - id: number - last_refresh: string | null - meta: Json | null - parent_page_id: number | null - path: string - source: string | null - type: string | null - version: string | null - } - Insert: { - checksum?: string | null - id?: number - last_refresh?: string | null - meta?: Json | null - parent_page_id?: number | null - path: string - source?: string | null - type?: string | null - version?: string | null - } - Update: { - checksum?: string | null - id?: number - last_refresh?: string | null - meta?: Json | null - parent_page_id?: number | null - path?: string - source?: string | null - type?: string | null - version?: string | null - } - Relationships: [ - { - foreignKeyName: "page_parent_page_id_fkey" - columns: ["parent_page_id"] - isOneToOne: false - referencedRelation: "page" - referencedColumns: ["id"] - } - ] - } - page_section: { - Row: { - content: string | null - embedding: string | null - heading: string | null - id: number - page_id: number - slug: string | null - token_count: number | null - } - Insert: { - content?: string | null - embedding?: string | null - heading?: string | null - id?: number - page_id: number - slug?: string | null - token_count?: number | null - } - Update: { - content?: string | null - embedding?: string | null - heading?: string | null - id?: number - page_id?: number - slug?: string | null - token_count?: number | null - } - Relationships: [ - { - foreignKeyName: "page_section_page_id_fkey" - columns: ["page_id"] - isOneToOne: false - referencedRelation: "page" - referencedColumns: ["id"] - } - ] - } - queries: { - Row: { - created_at: string - id: number - query_string: string | null - type: string | null - } - Insert: { - created_at?: string - id?: number - query_string?: string | null - type?: string | null - } - Update: { - created_at?: string - id?: number - query_string?: string | null - type?: string | null - } - Relationships: [] - } - story: { - Row: { - created_at: string - id: number - name: string | null - storybook_id: string | null - } - Insert: { - created_at?: string - id?: number - name?: string | null - storybook_id?: string | null - } - Update: { - created_at?: string - id?: number - name?: string | null - storybook_id?: string | null - } - Relationships: [] - } - story_render: { - Row: { - actual_duration: number | null - base_duration: number | null - commit_sha: string | null - core_version_number: string | null - id: number - phase: string | null - run_at: string - story_id: number | null - } - Insert: { - actual_duration?: number | null - base_duration?: number | null - commit_sha?: string | null - core_version_number?: string | null - id?: number - phase?: string | null - run_at?: string - story_id?: number | null - } - Update: { - actual_duration?: number | null - base_duration?: number | null - commit_sha?: string | null - core_version_number?: string | null - id?: number - phase?: string | null - run_at?: string - story_id?: number | null - } - Relationships: [ - { - foreignKeyName: "story_render_story_id_fkey" - columns: ["story_id"] - isOneToOne: false - referencedRelation: "story" - referencedColumns: ["id"] - } - ] - } + [_ in never]: never } Views: { [_ in never]: never } Functions: { - get_page_parents: { - Args: { - page_id: number - } - Returns: { - id: number - parent_page_id: number - path: string - meta: Json - }[] - } - hnswhandler: { - Args: { - "": unknown - } - Returns: unknown - } - ivfflathandler: { - Args: { - "": unknown - } - Returns: unknown - } - match_discussions: { - Args: { - embedding: string - match_threshold: number - match_count: number - min_content_length: number - } - Returns: { - path: string - content: string - similarity: number - source: string - type: string - meta: Json - heading: string - slug: string - }[] - } - match_page_sections: { - Args: { - embedding: string - match_threshold: number - match_count: number - min_content_length: number - } - Returns: { - id: number - page_id: number - slug: string - heading: string - content: string - similarity: number - }[] - } - match_page_sections_for_ai: { - Args: { - embedding: string - match_threshold: number - match_count: number - min_content_length: number - } - Returns: { - path: string - content: string - similarity: number - }[] - } - match_page_sections_v3: { - Args: { - embedding: string - match_threshold: number - match_count: number - min_content_length: number - } - Returns: { - path: string - content: string - similarity: number - source: string - type: string - meta: Json - heading: string - slug: string - }[] - } - match_weekly_search_usage: { - Args: Record - Returns: { - query_string: string - count: number - }[] - } - upsert_story_and_create_story_render: { - Args: { - _storybook_id: string - _story_name: string - _actual_duration: number - _base_duration: number - _commit_sha: string - _core_version: string - _phase: string - } - Returns: undefined - } - vector_avg: { - Args: { - "": number[] - } - Returns: string - } - vector_dims: { - Args: { - "": string - } - Returns: number - } - vector_norm: { - Args: { - "": string - } - Returns: number - } - vector_out: { - Args: { - "": string - } - Returns: unknown - } - vector_send: { - Args: { - "": string - } - Returns: string - } - vector_typmod_in: { - Args: { - "": unknown[] - } - Returns: number - } + [_ in never]: never } Enums: { [_ in never]: never diff --git a/packages/paste-website/src/pages/api/create-component-perf-metric.ts b/packages/paste-website/src/pages/api/create-component-perf-metric.ts index 841330713d..6d507e06f6 100644 --- a/packages/paste-website/src/pages/api/create-component-perf-metric.ts +++ b/packages/paste-website/src/pages/api/create-component-perf-metric.ts @@ -1,5 +1,5 @@ /* eslint-disable camelcase */ -import { createClient } from "@supabase/supabase-js"; +// import { createClient } from "@supabase/supabase-js"; import dogapi from "dogapi"; import type { NextApiRequest, NextApiResponse } from "next"; import Rollbar from "rollbar"; @@ -107,27 +107,31 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) logger.info(`${LOG_PREFIX} Valid request body: ${JSON.stringify(perfMetric.data)}`); - logger.info(`${LOG_PREFIX} Save metric to Supabase`); - - const supabaseClient = createClient(SUPABASE_URL, SUPABASE_KEY); - const { error } = await supabaseClient.rpc("upsert_story_and_create_story_render", { - _storybook_id: perfMetric.data.id, - _story_name: perfMetric.data.kind, - _actual_duration: perfMetric.data.actualDuration, - _base_duration: perfMetric.data.baseDuration, - _commit_sha: perfMetric.data.commitSha, - _core_version: perfMetric.data.coreVersionNumber, - _phase: perfMetric.data.phase, - }); - - if (error) { - logger.error(`${LOG_PREFIX} Error upserting story and creating story render`, { error }); - rollbar.error(`${LOG_PREFIX} Error upserting story and creating story render`, { error }); - res.status(500).json({ error: "Error upserting story and creating story render", details: error }); - return; - } - - logger.info(`${LOG_PREFIX} Saved metric to Supabase`); + /* + * logger.info(`${LOG_PREFIX} Save metric to Supabase`); + * + * const supabaseClient = createClient(SUPABASE_URL, SUPABASE_KEY); + * + * const { error } = await supabaseClient.rpc("upsert_story_and_create_story_render", { + * _storybook_id: perfMetric.data.id, + * _story_name: perfMetric.data.kind, + * _actual_duration: perfMetric.data.actualDuration, + * _base_duration: perfMetric.data.baseDuration, + * _commit_sha: perfMetric.data.commitSha, + * _core_version: perfMetric.data.coreVersionNumber, + * _phase: perfMetric.data.phase, + * }); + * + * + * if (error) { + * logger.error(`${LOG_PREFIX} Error upserting story and creating story render`, { error }); + * rollbar.error(`${LOG_PREFIX} Error upserting story and creating story render`, { error }); + * res.status(500).json({ error: "Error upserting story and creating story render", details: error }); + * return; + * } + * + * logger.info(`${LOG_PREFIX} Saved metric to Supabase`); + */ logger.info(`${LOG_PREFIX} Save metric to Datadog`);