Uh oh!
There was an error while loading. Please reload this page.
fix(cli): generate non-TypeScript types from project refs - #5622
Conversation
…with-project-id-fails-and-db-url
…with-project-id-fails-and-db-url
Supabase CLI previewnpx --yes https://pkg.pr.new/supabase/cli/supabase@534aa1650ea4b35964a2149b3687f52c82c345e2Preview package for commit |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:6314b35001
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:864fdd786b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…with-project-id-fails-and-db-url
Non-TypeScript project-ref typegen probed GET /v1/projects/{ref} and only
fell back to the branch config endpoint when the 404 body contained the
literal "Preview branch not found". The Management API's 404 wording is
not guaranteed, so a differently-worded body would fail instead of
falling back. Match the link handler, which treats any 404 from that
endpoint as the preview-branch case.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017iEY7hzWEw2bGaURyXJmAmNon-TypeScript `gen types --project-id <ref>` resolved the database connection through the linked DB resolver with the linked-workdir contract, which imported two assumptions that do not hold for an explicit, possibly-unrelated ref: - it read the ambient SUPABASE_DB_PASSWORD (shell / .env*) and, when the direct host was reachable, handed pg-meta that password instead of minting a temporary login role — sending an unrelated workdir password to a remote project; and - on an IPv4-only network it only consulted the saved .temp/pooler-url (which belongs to the linked workdir) and otherwise failed with the IPv6 "run supabase link" suggestion, even though the command already holds a Management API token. Add an `adHocProjectRef` resolver flag, set only for the explicit `--project-id` path (not `--linked`). In that mode the resolver ignores the ambient password (always minting a temp role) and, when the direct host is unreachable, fetches the primary pooler config for the ref from the Management API while ignoring the workdir's saved pooler URL. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017iEY7hzWEw2bGaURyXJmAm
…with-project-id-fails-and-db-url Resolve conflicts in functions/deploy realpath handling: adopt develop's `realpathIfExists` helper (deploy.ts) and `expectedDockerBind` test helper, which subsume this branch's equivalent `realpath`/`dockerBindSpec` changes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017iEY7hzWEw2bGaURyXJmAm
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:d23fac674e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Uh oh!
There was an error while loading. Please reload this page.
# Conflicts: # apps/cli/src/legacy/commands/gen/types/types.integration.test.ts # apps/cli/src/legacy/shared/legacy-db-config.layer.ts
…with-project-id-fails-and-db-url
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:56f9b60d56
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:43144279a2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:507ff5a94f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:8c39065f76
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:087931a4bb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:a8b60d4fa2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Uh oh!
There was an error while loading. Please reload this page.
…with-project-id-fails-and-db-url
…with-project-id-fails-and-db-url
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:00a8ad6435
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Uh oh!
There was an error while loading. Please reload this page.
## What kind of change does this PR introduce? Bug fix / follow-up to PR #5622. ## What is the current behavior? Non-TypeScript `gen types` project-ref generation has a few edge cases around IPv6 fallback handling: - TLS probe failures can miss the IPv6 pooler fallback path. - Fallback can run for already-pooler-shaped connections. - Retry classification can trigger more than once. - Preview branch pooler URLs are parsed without the same tenant/domain validation used elsewhere. - Some integration tests depend on fixed local probe ports. ## What is the new behavior? This hardens the shared IPv6 pooler fallback flow and applies it consistently across `gen types`, `db dump`, and `db pull`. Notable changes: - Adds cause-aware IPv6 error classification for Node/system errors. - Adds a shared pooler fallback helper with direct-host gating and single retry semantics. - Reuses the existing pg-delta SSL probe service for `gen types`. - Hoists validated pooler connection parsing and uses it for preview branch fallback. - Keeps strict Swift/query-timeout validation behavior, except bare implicit TypeScript generation now warns and continues when `--query-timeout` is ignored. - Updates docs for the intentional Go parity divergences. ## Additional context This addresses the review findings on PR #5622 while preserving the existing behavior where retry outcomes replace the original attempt and fallback resolution failures preserve the original error.
…with-project-id-fails-and-db-url
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:f2e2a775f5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…with-project-id-fails-and-db-url
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
What changed
supabase gen types --project-idgenerate Go, Swift, and Python types by resolving a temporary database connection and running pg-meta.Why
Python type generation with
--project-idfailed before it could reach pg-meta, and the first fix used the preview-branch config endpoint. Production project refs return404 Preview branch not foundfrom that endpoint because/v1/branches/{ref}is branch-only.Non-TypeScript type generation is still pg-meta-based, so project-ref flows need to construct a live database connection instead of calling the TypeScript-only typegen endpoint or asking the user to provide
--db-url.Reviewer context
Non-TypeScript project-ref generation still requires Docker because it continues to use pg-meta. The change is limited to how the CLI resolves the database connection for project refs: it fetches the project database host and creates a temporary login role rather than reading or storing the project's database password.
The live remote e2e matrix is skipped unless
SUPABASE_TYPEGEN_E2E_REMOTE=1,SUPABASE_TEST_PROJECT_REF, andSUPABASE_ACCESS_TOKENare set. The local e2e matrix runs without a token and points the API profile at an unreachable local URL to catch accidental Management API usage on the--localpath.Closes CLI-1812