Skip to content

fix(cli): respect SUPABASE_HOME across fallback paths#5624

Open
ametel01 wants to merge 14 commits into
supabase:developfrom
ametel01:fix/5214-supabase-home-cache-dir
Open

fix(cli): respect SUPABASE_HOME across fallback paths#5624
ametel01 wants to merge 14 commits into
supabase:developfrom
ametel01:fix/5214-supabase-home-cache-dir

Conversation

@ametel01

@ametel01 ametel01 commented Jun 18, 2026

Copy link
Copy Markdown

What changed

  • Normalizes existing SUPABASE_HOME handling across Go fallback state, legacy TypeScript auth/profile/telemetry paths, next config state, the stack cache root, and shared binary paths.
  • Documents SUPABASE_HOME as the global CLI state root in canonical docs, including telemetry/traces and the Go Deno binary path.
  • Keeps function deploy path walking from resolving already-outside imports before skipping them, while preserving explicitly allowed external import-map targets.
  • Normalizes function deploy module paths with real paths so symlinked workspaces stay within the bind mount.

Why

Some CLI fallback and cache paths still hard-coded ~/.supabase, so SUPABASE_HOME did not fully isolate local state in custom home-directory workflows.

This intentionally fixes inconsistent behavior for the existing global CLI state root rather than adding a cache-only SUPABASE_CACHEDIR variable. Issue #5214 originally asks for a cache-directory override, so the variable choice is still reviewer/maintainer acceptance context for this PR.

Closes #5214.

@ametel01 ametel01 marked this pull request as ready for review June 18, 2026 20:01
@ametel01 ametel01 requested a review from a team as a code owner June 18, 2026 20:01

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 09f5cd36b5

ℹ️ 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".

Comment thread apps/cli/src/shared/functions/deploy.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f2936f1b2a

ℹ️ 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".

// Golden path: --token persists the access token and reports success. The e2e
// harness sets SUPABASE_NO_KEYRING=1, so the token lands in the isolated
// HOME's ~/.supabase/access-token rather than the OS keyring.
// The Supabase home access-token file rather than the OS keyring.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Update the expected legacy token path

In this e2e helper, runSupabase sets SUPABASE_HOME to home.dir, and the changed credentials layer now writes the no-keyring fallback token directly to <SUPABASE_HOME>/access-token; this test still checks home.dir/.supabase/access-token below, so login --token succeeds but the assertion fails whenever the legacy no-keyring e2e runs. Update the assertion to the Supabase home path.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a way to configure cache directory

1 participant