Summary
src/Func/Commands/Setup/SetupRunner.cs is 1,100 lines and violates the Single Responsibility Principle by handling at least 6 distinct concerns in one class. This makes it difficult to test individual behaviours, understand control flow, and safely modify one concern without risking regressions in others.
Current Responsibilities (mixed in one class)
- Feature resolution
- Profile/scope resolution
- Dependency plan building
- Setup orchestration
- Hardcoded stack package discovery (see TODO on line 933)
- Interaction with the user for confirmations/progress
Proposed Fix
Split into focused, testable components:
FeatureResolver — determines which features to install/configure
ProfileScopeResolver — resolves profile and scope for the setup
DependencyPlanBuilder — builds the dependency installation plan
SetupOrchestrator — coordinates the above, drives the flow
- Move hardcoded stack package logic into workload metadata (addresses the TODO)
Each component should be independently testable with clear inputs/outputs.
Acceptance Criteria
Summary
src/Func/Commands/Setup/SetupRunner.csis 1,100 lines and violates the Single Responsibility Principle by handling at least 6 distinct concerns in one class. This makes it difficult to test individual behaviours, understand control flow, and safely modify one concern without risking regressions in others.Current Responsibilities (mixed in one class)
Proposed Fix
Split into focused, testable components:
FeatureResolver— determines which features to install/configureProfileScopeResolver— resolves profile and scope for the setupDependencyPlanBuilder— builds the dependency installation planSetupOrchestrator— coordinates the above, drives the flowEach component should be independently testable with clear inputs/outputs.
Acceptance Criteria
SetupRunner.csis decomposed into ≤4 focused classesfunc setupbehaviour