Repository navigation
fix(stack): pass [edge_runtime.secrets] to functions like legacy (CLI-2577) - #7481
Conversation
CLI benchmark (Lightweight Commands): no changes foundCommit
API calls: unchanged for all 7 commands. Binary size: 134.1 MB, down 4.0 KB from 134.1 MB. Details: timing ranges, API calls per command, slowest phasesTiming ranges
API calls per command
Slowest phasesNo command moved beyond noise, so there are no phase deltas. Comment |
There was a problem hiding this comment.
🤖 AI Review
Both independent reviews reported no findings. Reading the changed code and surrounding resolution, decryption, and service configuration paths revealed no additional actionable issues. The shared helper preserves legacy serve behavior and applies it to stack secrets. Tests were not run because dependencies are not installed.
Findings
No issues found.
Stats
Claude findings: 0 · Codex findings: 0 · Confirmed: 0 · Refuted: 0 · Uncertain: 0
Models: claude-opus-5-5 + gpt-6.1-sol · Trigger: auto · Workflow run
This review runs once per PR. A maintainer can request another with a /ai-review comment.
[edge_runtime.secrets] env on the stack (CLI-2577)[edge_runtime.secrets] to functions like legacy (CLI-2577)
…s-environment-for-start-and
…77) (supabase#7499) ## TL;DR fixes the stack's Functions env so `supabase start` and `supabase functions serve` give functions the same env as the legacy backend ## whats missing? stack `functions serve` ignored each function's own `supabase/functions/<slug>/.env` the stack let `[edge_runtime.secrets]` win over `supabase/functions/.env`, while legacy lets the file win on a running stack `--env-file` kept the `functions/.env` values, and `.env` edits only applied after a restart multiline values like PEM keys were rejected `--debug` printed less than legacy and the serve banner showed the internal port a stack where only Realtime serves the API failed with `Shared API port differs from existing claim` ## fixed now by: legacy and the stack now share one env resolver, and legacy `start` and `functions serve` output stays exactly the same stack `functions serve` reads each function's `.env`, re-reads env files on every run and restores the saved config on exit multiline values travel in the Functions config on native and docker Realtime counts as an API source, and the runtime now gets the API port and debug mode ## ref: - missed in: supabase#6684 - extends: supabase#7481
TL;DR
fixes functions on the stack getting
[edge_runtime.secrets]exactly as written inconfig.toml, so they now see the same secrets as on the legacy backendwhats missing?
on the stack,
supabase startandsupabase functions servepassed[edge_runtime.secrets]to functions untoucheda secret written as
my_keystayed lowercase, soDeno.env.get("MY_KEY")came back emptyan
env(NAME)pointing at an unset variable arrived as the textenv(NAME), and empty secrets arrived as empty stringsfixed now by:
the stack now runs secrets through the same step the legacy backend uses, so names are uppercased and empty or unset values are skipped
secrets starting with
SUPABASE_are skipped too, same as on the legacy backendref: