-
Notifications
You must be signed in to change notification settings - Fork 329
[plan] Refactor trial_command.go to separate business logic from command setup #23907
Copy link
Copy link
Closed
Closed
Copy link
Labels
Description
Objective
Refactor pkg/cli/trial_command.go (1,007 lines) to separate the Cobra command setup from the business logic, following the established NewXCommand() + RunX() pattern.
Context
From discussion #23903 (Repository Quality: File Size Discipline). Command files should be thin wrappers; business logic should live in separate helper files. The existing codebase pattern is NewXCommand() (thin) + RunX() (extracted, testable).
Approach
- Identify the
RunE/ run function logic and extract it topkg/cli/trial_runner.go - Keep
NewTrialCommand()intrial_command.goas a thin wrapper — target under 200 lines - Move any structs/types specific to trial logic to
pkg/cli/trial_types.goif needed to keep files within limits - Target:
trial_command.gounder 200 lines,trial_runner.gounder 400 lines
Rules
- Do NOT change function signatures or exported names
- Run
make fmtafter changes - Run
go test ./pkg/cli/ -run ".*[Tt]rial.*"to validate - Run
make agent-finishbefore committing
Acceptance Criteria
-
pkg/cli/trial_command.goreduced to Cobra command setup and flag definitions — under 200 lines - Business logic extracted to
pkg/cli/trial_runner.go(or appropriately named files) - All existing trial-related tests pass
- New files are each under 350 lines
Generated by Plan Command for issue #discussion #23903 · ◷
- expires on Apr 3, 2026, 2:40 PM UTC
Reactions are currently unavailable
Metadata
Metadata
Labels
Type
Fields
Give feedbackNo fields configured for issues without a type.