Skip to content

Decompose SetupRunner.cs (1,100 lines, multiple responsibilities) #5451

Description

@liliankasem

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)

  1. Feature resolution
  2. Profile/scope resolution
  3. Dependency plan building
  4. Setup orchestration
  5. Hardcoded stack package discovery (see TODO on line 933)
  6. 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

  • SetupRunner.cs is decomposed into ≤4 focused classes
  • Each component is independently unit-testable
  • Hardcoded stack package (line 933 TODO) is resolved via workload metadata
  • All existing tests continue to pass
  • No regression in func setup behaviour

Metadata

Metadata

Assignees

No one assigned

    Labels

    GARequired for v5 GA / stable releasev5

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions