refactor(cli): hoist sso pflag/profile reconciliation into shared layer (CLI-1982) - #6040
Merged
Coly010 merged 4 commits intoAug 3, 2026
Merged
Conversation
…er (CLI-1982) sso.pflag-reconcile.ts and sso.load-profile.ts implement a CLI-wide concern (pflag/viper-vs-Effect-parser reconciliation) but were coupled to sso-specific error types. Move both into legacy/shared/ as legacy-pflag-reconcile.ts and legacy-profile-load.ts, decoupled via new LegacyPflagWorkdirError/ LegacyProfileLoadError, so future command families needing the same reconciliation don't have to duplicate it. Pure move+rename; add/update wired to the new location with zero behavior change.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3bcdf14ef5
ℹ️ 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".
Contributor
Supabase CLI previewnpx --yes https://pkg.pr.new/supabase/cli/supabase@d0fde74e7b07160bc4d616f4e01bbe7d892c8cb1Preview package for commit |
…2-hoist-pflag-reconcile-shared # Conflicts: # apps/cli/src/legacy/commands/sso/add/SIDE_EFFECTS.md # apps/cli/src/legacy/commands/sso/update/SIDE_EFFECTS.md
…onsumer (review: sso reconciliation ownership) Codex flagged that legacy-pflag-reconcile.ts/legacy-profile-load.ts have only two current consumers (sso add + update), which by AGENTS.md's hoist rule reads as "family root" tier, not shared/. The hoist is intentional: a human reviewer asked for exactly this in #5974's review, on the grounds that the pflag-vs-Effect-parser divergence is CLI-wide, not sso-specific. Recording that link in the source so future readers don't re-litigate it.
jgoux
approved these changes
Aug 3, 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.
What kind of change does this PR introduce?
Refactor — pure move + rename, zero behavior change.
What is the current behavior?
sso.pflag-reconcile.tsandsso.load-profile.ts(added in #5974 to reconcile pflag/viper-vs-Effect-parser divergence for--profile/--workdir/bool/enum flags, and to emulate Go'sLoadProfile) live under the sso-specific command directory and are coupled to two sso-specific error types (LegacySsoWorkdirError,LegacySsoProfileError), even though every function in them is already generic. This was flagged in #5974's review: the logic doesn't scale to future command families that need the same pflag-vs-Effect-parser reconciliation.What is the new behavior?
sso.pflag-reconcile.ts→apps/cli/src/legacy/shared/legacy-pflag-reconcile.ts, andsso.load-profile.ts→apps/cli/src/legacy/shared/legacy-profile-load.ts(plus their unit tests).Ssoinfix (e.g.legacySsoResolvePflagProfile→legacyResolvePflagProfile).LegacySsoWorkdirError/LegacySsoProfileErrorwith new genericLegacyPflagWorkdirError/LegacyProfileLoadError, deleting the two sso-specific classes fromsso.errors.tswith no compatibility shims.sso add/sso updatehandlers and their tests/SIDE_EFFECTS docs to the new location.All doc comments documenting binary-verified Go-parity behavior (across many #5974 review rounds) are preserved verbatim. This is a follow-through on a review suggestion that was originally deferred to a follow-up ticket — implementing it directly instead.