Skip to content

refactor(cli): hoist sso pflag/profile reconciliation into shared layer (CLI-1982) - #6040

Merged
Coly010 merged 4 commits into
developfrom
columferry/cli-1982-hoist-pflag-reconcile-shared
Aug 3, 2026
Merged

refactor(cli): hoist sso pflag/profile reconciliation into shared layer (CLI-1982)#6040
Coly010 merged 4 commits into
developfrom
columferry/cli-1982-hoist-pflag-reconcile-shared

Conversation

@Coly010

@Coly010 Coly010 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Refactor — pure move + rename, zero behavior change.

What is the current behavior?

sso.pflag-reconcile.ts and sso.load-profile.ts (added in #5974 to reconcile pflag/viper-vs-Effect-parser divergence for --profile/--workdir/bool/enum flags, and to emulate Go's LoadProfile) 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?

  • Moved sso.pflag-reconcile.tsapps/cli/src/legacy/shared/legacy-pflag-reconcile.ts, and sso.load-profile.tsapps/cli/src/legacy/shared/legacy-profile-load.ts (plus their unit tests).
  • Renamed every export to drop the Sso infix (e.g. legacySsoResolvePflagProfilelegacyResolvePflagProfile).
  • Replaced LegacySsoWorkdirError/LegacySsoProfileError with new generic LegacyPflagWorkdirError/LegacyProfileLoadError, deleting the two sso-specific classes from sso.errors.ts with no compatibility shims.
  • Updated sso add/sso update handlers 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.

…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.
@Coly010
Coly010 requested a review from a team as a code owner August 3, 2026 10:31

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread apps/cli/src/legacy/shared/legacy-pflag-reconcile.ts
Comment thread apps/cli/src/legacy/shared/legacy-pflag-reconcile.ts
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Supabase CLI preview

npx --yes https://pkg.pr.new/supabase/cli/supabase@d0fde74e7b07160bc4d616f4e01bbe7d892c8cb1

Preview package for commit d0fde74.

Coly010 added 3 commits August 3, 2026 13:58
…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.
@Coly010 Coly010 self-assigned this Aug 3, 2026
@Coly010
Coly010 added this pull request to the merge queue Aug 3, 2026
Merged via the queue into develop with commit 97d6a66 Aug 3, 2026
35 checks passed
@Coly010
Coly010 deleted the columferry/cli-1982-hoist-pflag-reconcile-shared branch August 3, 2026 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants