Objective
Split pkg/workflow/checkout_manager.go (1,005 lines) by moving all step generation functions to a new file, separating state management from YAML step generation.
Context
From discussion #23903 (Repository Quality: File Size Discipline). This file conflates CheckoutManager state management with GitHub Actions YAML step generation. The step generation functions are independently testable and have a natural seam for extraction.
Approach
- Create
pkg/workflow/checkout_step_generator.go in the same package (package workflow)
- Move these functions to the new file:
GenerateCheckoutAppTokenSteps
GenerateCheckoutAppTokenInvalidationSteps
GenerateAdditionalCheckoutSteps
GenerateGitHubFolderCheckoutStep
GenerateDefaultCheckoutStep
generateCheckoutStepLines
- Keep
CheckoutManager type definition, NewCheckoutManager, all getters/setters, and resolver logic in checkout_manager.go
Rules
- Same package (
package workflow)
- Do NOT change any function signatures
- Run
make fmt after changes
- Run
go test ./pkg/workflow/ -run ".*[Cc]heckout.*" to validate
- Run
make agent-finish before committing
Acceptance Criteria
Generated by Plan Command for issue #discussion #23903 · ◷
Objective
Split
pkg/workflow/checkout_manager.go(1,005 lines) by moving all step generation functions to a new file, separating state management from YAML step generation.Context
From discussion #23903 (Repository Quality: File Size Discipline). This file conflates
CheckoutManagerstate management with GitHub Actions YAML step generation. The step generation functions are independently testable and have a natural seam for extraction.Approach
pkg/workflow/checkout_step_generator.goin the same package (package workflow)GenerateCheckoutAppTokenStepsGenerateCheckoutAppTokenInvalidationStepsGenerateAdditionalCheckoutStepsGenerateGitHubFolderCheckoutStepGenerateDefaultCheckoutStepgenerateCheckoutStepLinesCheckoutManagertype definition,NewCheckoutManager, all getters/setters, and resolver logic incheckout_manager.goRules
package workflow)make fmtafter changesgo test ./pkg/workflow/ -run ".*[Cc]heckout.*"to validatemake agent-finishbefore committingAcceptance Criteria
pkg/workflow/checkout_step_generator.gocontains allGenerate*/generate*step functionspkg/workflow/checkout_manager.goreduced to type definition + state management — under 400 lines