fix(cli): CSV-split sso and postgres-config StringSlice flags#5764
Merged
Coly010 merged 1 commit intoJul 2, 2026
Conversation
Go registers `sso add/update --domains/--add-domains/--remove-domains` and `postgres-config update/delete --config` as pflag StringSliceVar, which CSV-splits each occurrence via encoding/csv and accumulates across repeats. The legacy TS port only supported repetition, so `--domains a.com,b.com` produced a single malformed value instead of two domains. Adds a shared `legacyParseStringSliceFlag` helper (extracted from the existing --schema CSV parser, which now delegates to it) and wires it into the four affected flag definitions via Flag.mapTryCatch, matching the pattern already used for --schema flags.
Contributor
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Contributor
Supabase CLI previewnpx --yes https://pkg.pr.new/supabase/cli/supabase@101d51fe8e0c5fb69256a5156cc0132ab2a9d775Preview package for commit |
avallete
approved these changes
Jul 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Current Behavior
Go registers
sso add/update --domains/--add-domains/--remove-domainsandpostgres-config update/delete --configas pflagStringSliceVar, which CSV-splits each occurrence (viaencoding/csv) and accumulates across repeats. The legacy TS port only supported flag repetition (Flag.atLeast(0)), so a single comma-separated value like--domains a.com,b.comproduced one malformed string ("a.com,b.com") instead of two domains — sent to the API as-is, or (forpostgres-config) failing thekey=valuesplit validation.Fixes #CLI-1853
Expected Behavior
--domains a.com,b.com(and--config foo=bar,baz=qux) now CSV-split per-occurrence and accumulate across repeats, matching Go'spflag.StringSliceVar/encoding/csvsemantics exactly — including quoted-comma handling ('"a,b",c'→["a,b", "c"]) and Go'scsv.Readermalformed-input error messages.The CSV-parsing algorithm already existed for
--schemaflags (gen types,db lint,db dump,db pull,db diff,db schema {generate,sync}) inlegacy-schema-flags.ts. This extracts the generic algorithm into a new sharedlegacy-string-slice-flag.tsmodule (legacyParseStringSliceFlag) so the four newly-fixed flags reuse it instead of duplicating it;legacy-schema-flags.tsnow delegates to the shared module while keeping its schema-specific CSV re-encoder (legacySchemaToCsvField) untouched.Out of scope: the ticket's "bonus" item (aligning
sso update's domains mutex error message with cobra's group-error template) is deferred — it depends on the separate functions-mutex-template fix (CLI-1860), which hasn't landed yet.CLOSES CLI-1853