refactor: burn down wave 3 — CLI commands, deploy parser, and service helpers - #3438
Merged
Conversation
…dList and $includeFile $createSQLFieldList 52 to 30: per-item class mapping and duplicate-prefix resolution extracted (byte-identical statement moves; a doubled-backslash regex bug caught by associationsSpec was fixed before commit — model specs 979/0 confirm). $includeFile 31 to 10: grouped-query, plain-query, and objects render loops extracted; args structs mutate by reference. Controller and view suites stay green. Signed-off-by: Peter Amiri <peter@alurium.com>
… to 8/12/12/16) deploy 94 to 8: per-verb dispatcher ($deployMain, $deployApp, $deployProxy, $deployRegistry, $deployBuild, $deployAccessory, $deployPrune, $deployLock, $deployServerVerb, $deploySecretsVerb, ssh-pool verbs). runUpgradeCheck 71 to 12: version resolution, check definitions, scan-file collection, execution, and report helpers. browserTest 59 to 12 and displayTestResults 46 to 16: walk + summary helpers. Also generate 28 to 3, emitTapResults 28 to 13, $buildCiAnnotations 26 to 7, console 25 to 12, routes 23 to 8. 33 private $-prefixed helpers (CLI component — private keeps them off the MCP surface). DeployAliasSshPoolSpec's two source pins updated: the flat bootstrap/exec $deployBuildSshPool invariant moved into $deployServerVerb (now accessed as arguments.opts). CLI suite: 1189 pass / 0 fail (2 environmental docker-sshd errors); deploy verb smoke: all verbs pass. Signed-off-by: Peter Amiri <peter@alurium.com>
…57 to 2) parse is now a thin token loop dispatching to $matchFlag, which fans out to five contiguous private helpers ($parseDeployFlags, $parseConfigFlags, $parseBuildFlags, $parseRuntimeFlags, $parseAppFlags) — each a byte-identical slice of the original if/else chain with the same order and token-consumption semantics. DeployArgsParserSpec + deploy verb smoke cover the behavior. Signed-off-by: Peter Amiri <peter@alurium.com>
…lysis services processTemplate 32 to 1, $recordProvidersFromManifest 28 to 5, mapColumnToFormHelper 25 to 3, generateScaffold 22 to 17, mapToWheelsType 20 to 3, extractFunctionBody 19 to 1 — 20 private $-prefixed helpers across five service components. Placeholder ordering, manifest fallbacks, type mappings, and golden-file codegen output preserved verbatim. Signed-off-by: Peter Amiri <peter@alurium.com>
The 3.x -> 4.x check definitions moved out of runUpgradeCheck into the $upgradeBuildChecks helper (round-3 extraction), and the branch condition is now arguments-qualified. The coverage spec's source slice searched for the unqualified condition and the "// Run checks" marker, which no longer bound the block — update the slice to the helper's branch condition and return statement. All 13 breaker-coverage assertions re-targeted. Signed-off-by: Peter Amiri <peter@alurium.com>
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.
Summary
Third burn-down wave — the CLI (cli/lucli). Extract-method refactors only, no behavior change.
Before → after (cyclomatic complexity)
deployrunUpgradeCheckbrowserTestdisplayTestResultsgenerateemitTapResults$buildCiAnnotationsconsoleroutesparseprocessTemplate$recordProvidersFromManifestmapColumnToFormHelpergenerateScaffoldmapToWheelsTypeextractFunctionBody$createSQLFieldList$includeFileCLI-wide: functions over complexity 50 drop 4 → 0; functions at 10 or under rise 843 → 890.
Key design decisions
private$-prefixed — the CLI component's public functions auto-surface as subcommands + MCP tools, so nothing new is public. Deploy decomposes into a per-verb dispatcher ($deployMain,$deployApp,$deployProxy,$deployRegistry,$deployBuild,$deployAccessory,$deployPrune,$deployLock,$deployServerVerb,$deploySecretsVerb).DeployAliasSshPoolSpec— the bootstrap/exec$deployBuildSshPoolinvariant moved into$deployServerVerb(param accessed asarguments.opts). Same guarantee, new location.associationsSpec(aggregate calculated property with distinct) and fixed — byte-compared against the original before commit.Verification
No changelog fragment: internal refactor, no user-facing change.