fix(cli): distinguish local vs. remote connection-refused hints (CLI-1995) - #5979
Conversation
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
kanadgupta
left a comment
There was a problem hiding this comment.
Small nit below otherwise looks good to me! Will defer to @Coly010 for final merge
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9039d2e099
ℹ️ 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".
Supabase CLI previewnpx --yes https://pkg.pr.new/supabase/cli/supabase@60aab2359a94206c1c5d1c2b90b7a45c0a388cf1Preview package for commit |
| // Known parity divergence: Go never emits the Docker-start hint for --local (CLI-1995). | ||
| testParity(["db", "push", "--local"], { | ||
| normalize: { | ||
| stderr: { | ||
| stripPatterns: [ | ||
| /\nMake sure your local IP is allowed in Network Restrictions and Network Bans\.\n[^\n]*/g, // Expected from Go | ||
| /\nMake sure Docker is running, then run: supabase start/g, // Expected from TS | ||
| ], | ||
| }, | ||
| }, | ||
| }); |
Summary
The Go implementation's
SetConnectSuggestionhas no local vs. remote distinction, so a refused--localconnection (Postgres/Docker not running) inherited the same hint as an actual network-restricted remote connection, directing the user to their project's settings dashboard.This is a dead end for a local user, since there's nothing to fix on the dashboard.
Changes
LEGACY_SUGGEST_LOCAL_STACKmessage and thread anisLocalflag throughlegacyConnectSuggestionso a refused local connection now suggests starting Docker (supabase start) instead."connection refused"branch:ECONNREFUSED/"connection refused"now branches onctx.isLocal"Address not in tenant allow_list"is only ever from the remote pooler so the previous message stays unconditionally.Before (running with --local)
After (running with --local)
Linked issue
Closes CLI-1995
Checklist
fix(cli): …).pnpm check:allandpnpm testpass for the workspace(s) I touched.I also ran the compiled
legacybinary and validated the--linkedand--localpaths.