Repository navigation
refactor(config): consolidate command-family helpers (CLI-2292) - #6491
Merged
Coly010 merged 4 commits intoSep 7, 2026
Conversation
…lasses (CLI-2292) Follow-up debt from the CLI-2064 architecture review: `pull/`'s three pathKey/valueAtPath/isDeclaredAtPath/deepEqualValue/deepSetAtPath copies collapse into one config.paths.ts; config.target.ts's 5-generic LegacyConfigTargetErrors<A,B,C,D,E> becomes a per-family error-class factory now that diff/pull/push all share it, dropping the Predicate.hasProperty duck-typed 404 reclassification for a typed bound; and config-edit.ts's hardcoded "remotes"/"project_id" placement literals get named constants. The config-label unification this issue also asked for already landed in CLI-2313 (#6454). Fixes CLI-2292
Contributor
Supabase CLI previewnpx --yes https://pkg.pr.new/supabase/cli/supabase@f943cfdc9da96db98a110bd5411c6066f58a75b6Preview package for commit |
…config-command-family-cleanup-shared-pathvalue-helpers-error # Conflicts: # apps/cli/src/commands/config/diff/diff.handler.ts # apps/cli/src/commands/config/pull/pull.handler.ts
Contributor
There was a problem hiding this comment.
🤖 AI Review
Both independent reviews were available. Codex reported no findings; Claude reported five. Code inspection confirms all five: two minor consolidation/guard concerns and three nits involving comments, edge-case tests, and type ergonomics. No user-breaking behavioral regression was identified.
Findings
| Severity | Location | Category | Sources | Claim |
|---|---|---|---|---|
| 🟡 MINOR | apps/cli/src/commands/config/config.paths.ts:24 |
duplication |
claude | The new shared record predicate remains duplicated in two config-family modules, contrary to the repository's hoist-before-duplication convention, and the header's stated non-consolidations do not account for those copies. |
| 🟡 MINOR | apps/cli/src/commands/config/config.target.ts:70 |
test-coverage |
claude | Template-interpolating the 12 generated error tags removes them from the static actionability scan, while their runtime coverage now depends on each family errors module continuing to contain an unrelated literal-tagged error. |
| ⚪ NIT | apps/cli/src/commands/config/diff/diff.handler.ts:155 |
documentation |
claude | The diff and pull target-resolution comments still describe sharing only with each other, omitting config push. |
| ⚪ NIT | apps/cli/src/commands/config/config.paths.unit.test.ts:42 |
test-coverage |
claude | The new tests do not distinguish own-property lookup from inherited-property lookup and omit the empty-path and existing-scalar replacement semantics of legacyConfigDeepSetAtPath. |
| ⚪ NIT | apps/cli/src/commands/config/diff/diff.errors.ts:46 |
api-design |
claude | Changing the 12 exported error classes to const constructor aliases removes their direct type-position usability. |
Stats
Claude findings: 5 · Codex findings: 0 · Confirmed: 5 · Refuted: 0 · Uncertain: 0
Models: claude-opus-5 + gpt-5.6-sol · Trigger: auto · Workflow run
This review runs once per PR. A maintainer can request another with a /ai-review comment.
Hoists diff.handler.ts's and push.paths.ts's remaining isRecord copies onto config.paths.ts's legacyConfigIsRecord, restores type-position usability for the 12 minted target-error class names via companion InstanceType aliases, and calls out config push in the two target-resolution doc comments that still only named diff/pull. Adds a dedicated config.target.unit.test.ts covering legacyMintConfigTargetErrors' tags/actionability independent of any family's own errors file, plus inherited-key and deep-set edge cases to config.paths.unit.test.ts.
avallete
approved these changes
Sep 7, 2026
Coly010
deleted the
columferry/cli-2292-config-command-family-cleanup-shared-pathvalue-helpers-error
branch
September 7, 2026 11:54
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
Follow-up debt recorded by the CLI-2064 architecture review (explicitly ruled a follow-up, not a pre-merge fix):
pathKeyhas separate definitions across the config command family'spull/modules;deepEqualValue/valueAtPath/isDeclaredAtPathare each implemented twice (pull.plan.ts);deepSetAtPathis a third deep-set concept, only reachable through the planner.LegacyConfigTargetErrors<A,B,C,D,E>inconfig.target.tshand-injects five generic constructors per command, and reclassifies a 404 via aPredicate.hasProperty("status")duck-type check.config diffandconfig pullrender change classes through a shared label map inconfig.format.ts.config-edit.ts's[remotes.<label>]placement logic hardcodes the"remotes"/"project_id"literals inline at each use site.Expected Behavior
config.paths.tsat the command family root holds the shared path/value helpers; the threepull/modules that duplicated them now import from it.config-edit.ts(in@supabase/config, pinned tosmol-tomlas its only import per ADR 0023) keeps its own independent copies — deliberately out of scope.config.target.tsnow mints each family's four target-resolution error classes from a prefix (legacyMintConfigTargetErrors) and builds their shared message-template bundle in one place (legacyConfigTargetErrorsFor), collapsingLegacyConfigTargetErrors/legacyResolveConfigTargetfrom five generics to two and replacing the duck-typed 404 check with a typedLegacyConfigTargetResolveFailurebound.diff,pull, andpushnow all route through this factory —pushadopted the shared resolver since the CLI-2064 review, meeting the precondition this item was waiting on.diff.format.tsalready renders throughconfig.format.ts's shared label map. No changes needed; confirmed while implementing this issue.config-edit.tsnow names the two literals (REMOTES_TABLE_NAME,REMOTE_PROJECT_ID_KEY) and a sharedisRemotesLabelRootpredicate next to the doc comment that already describes the exception.No user-observable behavior changes — every renamed/relocated helper keeps its exact prior implementation, and the four minted error classes keep their original tags, actionability, and message text (verified against the existing
diff/pull/pushintegration test suites and theerror-actionability-coveragedrift guard).