feat(cli): port functions deploy#5561
Conversation
There was a problem hiding this comment.
💡 Codex Review
cli/apps/cli/src/legacy/commands/functions/deploy/deploy.command.ts
Lines 35 to 38 in 6713273
When legacy users run supabase functions deploy without --use-api, this flag now parses as false, so deployFunctions takes the server-side API path instead of the local Docker bundler. The Go CLI that this legacy shell is porting sets --use-docker to default true in apps/cli-go/cmd/functions.go:155-157, and apps/cli-go/internal/functions/deploy/deploy.go:56-58 uses Docker whenever it is running; only an explicit --use-api opts out. This changes the default deployment artifact/path for existing stable CLI users and can break projects that rely on Docker/local bundling behavior.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 94aa2f0097
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 59977ff17d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| ); | ||
| } | ||
|
|
||
| const useLocalBundler = flags.useDocker || flags.legacyBundle; |
There was a problem hiding this comment.
Preserve Docker as the default deploy mode
When legacy users run supabase functions deploy without mode flags while Docker is running, the Go command takes the Docker path because useDocker is registered with a default of true in apps/cli-go/cmd/functions.go; here the deploy mode is selected only from explicit boolean flags, which both default to false, so the normal invocation now always uses the server-side API bundler. That changes the ported command's default behavior and can break deployments that rely on the local Docker bundling path unless users discover and pass the hidden --use-docker flag.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Intentional, the native port should default to api
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a14a8e908d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
713059d to
67a5fc2
Compare
67a5fc2 to
e456290
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e456290738
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 237af1e14d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ec9a343578
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b6bc946519
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1ce91eb76b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (entry.isDirectory()) { | ||
| files.push(...(await listFilesRecursive(pathname))); | ||
| continue; |
There was a problem hiding this comment.
Fail globbed static directories instead of dropping them
When static_files uses a glob that matches a directory, such as ./functions/foo/assets/* with assets/templates/ present, this recursion skips the directory and only considers files below it, so the later isDirectory() check never sees the matched directory; the deploy then warns/continues or uploads only sibling files while omitting a configured static path. Fresh evidence beyond the earlier literal-directory comment is that glob expansion now calls listFilesRecursive, whereas the Go path's fs.Glob returns matched directories and addFile fails on them.
Useful? React with 👍 / 👎.
| return Object.fromEntries( | ||
| Object.entries(value).filter(([key, field]) => key !== "import_map_path" || field !== null), | ||
| ); |
There was a problem hiding this comment.
Handle nullable function fields before decoding
When --use-docker lists a source-deployed function whose API row includes ezbr_sha256: null (or another optional function field returned as null), this normalizer only removes null import_map_path; the subsequent FunctionResponse schema still rejects null for fields such as ezbr_sha256, so deploy/prune can fail before hash comparison even though the Go client accepts those pointer fields as nil. Strip all known optional null fields, or decode this response leniently, before passing it to the strict schema.
Useful? React with 👍 / 👎.
| const loadedConfig = yield* loadProjectConfig(dependencies.projectRoot); | ||
| const configFunctions = yield* inferFunctionsManifest({ | ||
| cwd: dependencies.projectRoot, | ||
| config: loadedConfig?.config, |
There was a problem hiding this comment.
Honor remote function config before deploying
When supabase/config.toml has [remotes.<name>] overrides and the user deploys with --project-ref matching that remote, this loads the unmerged base config before resolving the target project ref and then infers functions from that base only. The Go deploy path sets Config.ProjectId from the resolved project ref before LoadConfig, which merges the matching remote block, so remote-specific functions settings such as verify_jwt, entrypoint, static_files, or even remote-only function slugs are ignored by this port.
Useful? React with 👍 / 👎.
| dashboardUrl: legacyDashboardUrl(cliConfig.profile), | ||
| yes, | ||
| rawArgs, | ||
| edgeRuntimeVersion: DEFAULT_VERSIONS["edge-runtime"], |
There was a problem hiding this comment.
Use configured edge-runtime image for legacy Docker deploys
When a legacy project has supabase/.temp/edge-runtime-version from an update/pin and runs functions deploy --use-docker, this always passes the package default edge-runtime version into the bundler. The Go config loader replaces Config.EdgeRuntime.Image from that file before Docker bundling, so the native legacy deploy can bundle with a different runtime image than the rest of the project and produce different eszip output.
Useful? React with 👍 / 👎.
## TL;DR fixes nullable function import map paths ## prob - While testing the ported `functions deploy` flow here: supabase#5561 I found that `functions list` could fall back to `request_failed` because the management api can return `import_map_path: null` Go already accepted that null shape, but the generated ts contract only accepted a string basically this updates the generated function response contracts to accept `null` for `import_map_path` and adds a integration coverage around it! ## ref - smol regression of: (supabase#5185)
TL;DR
ports
functions deployto native tsWhat’s introduced
adds the native ts implementation for
supabase functions deploy,keeping the existing command surface for default API deploys, docker fallback, import maps, static files, pruning,
disabled functions, and structured output.
also preserves the user facing behavior while making the default path api-based/dockerless (same as the other pr)
& includes coverage for both
ref: