cli icon indicating copy to clipboard operation
cli copied to clipboard

Inconsistent Typescript types in CI when using tpes generation

Open Panzki opened this issue 1 year ago • 3 comments

Describe the bug I want to verify my generated Typescript types in my CI as proposed here. However I'm facing the problem that the types generated in the CI environment differ from the ones generated locally.

To Reproduce Steps to reproduce the behavior:

  1. Run supabase gen types typescript --local > ./lib/database.types.ts locally and check in the result.
  2. Run supabase gen types typescript --local > ./lib/database.types.ts in CI.
  3. Use git to diff the file. This results in:
diff --git a/packages/supabase/src/database.types.ts b/packages/supabase/src/database.types.ts
index 8465ced..0de863f 100644
--- a/packages/supabase/src/database.types.ts
+++ b/packages/supabase/src/database.types.ts
@@ -791,6 +791,10 @@ export type Database = {
         }
         Returns: boolean
       }
+      install_extensions: {
+        Args: Record<PropertyKey, never>
+        Returns: undefined
+      }
       is_account_owner: {
         Args: {
           account_id: string

Expected behavior No diff.

System information Rerun the failing command with --create-ticket flag.

  • Version of CLI: v1.63.2 (same version locally and in CI)
  • Versions of services: (same locally and in CI)
       SERVICE IMAGE      │        LOCAL         │  LINKED
 ─────────────────────────┼──────────────────────┼────────────
   supabase/postgres      │ 15.1.1.41            │ 15.1.1.41
   supabase/gotrue        │ v2.148.0             │ v2.148.0
   postgrest/postgrest    │ v12.0.2              │ v12.0.2
   supabase/realtime      │ v2.28.23             │ -
   supabase/storage-api   │ v1.0.10              │ v1.0.10
   supabase/edge-runtime  │ v1.45.2              │ -
   supabase/studio        │ 20240422-5cf8f30     │ -
   supabase/postgres-meta │ v0.80.0              │ -
   supabase/logflare      │ 1.4.0                │ -
   bitnami/pgbouncer      │ 1.20.1-debian-11-r39 │ -
   darthsim/imgproxy      │ v3.8.0               │ -

Panzki avatar Apr 29 '24 08:04 Panzki

Hi @sweatybridge, is there any plan to try to fix this issue?

Panzki avatar Jun 07 '24 15:06 Panzki

Hi, I suspect the service version is different on CI. Could you try running supabase link on CI as well?

- run: supabase link --project-ref $SUPABASE_PROJECT_ID
- run: supabase gen types ...

sweatybridge avatar Jun 08 '24 03:06 sweatybridge

Hi @Panzki, were you able to figure it out?

abduraufsherkulov avatar Jul 29 '24 12:07 abduraufsherkulov