Context
From discussion #26431 (Repository Quality Improvement Report — Validator Complexity Compliance).
pkg/workflow/dispatch_workflow_validation.go is 363 lines (21% over the 300-line hard limit in AGENTS.md). It mixes two clearly distinct concerns: (1) dispatch workflow validation logic and (2) workflow file-resolution utilities.
Objective
Extract file-resolution utilities into a dedicated file to separate concerns and bring both files under the hard limit.
Steps
- Create
pkg/workflow/dispatch_workflow_file_resolver.go (same workflow package) containing file-resolution utilities:
getCurrentWorkflowName
isPathWithinDir
findWorkflowFile (and any associated types like findWorkflowFileResult)
mdHasWorkflowDispatch
extractMDWorkflowDispatchInputs
- Keep in
dispatch_workflow_validation.go (target under 200 lines):
validateDispatchWorkflow
extractWorkflowDispatchInputs
containsWorkflowDispatch
- Run
make fmt && make lint && go test -run ".*[Dd]ispatch.*" ./pkg/workflow/
Acceptance Criteria
Generated by Plan Command for issue #discussion #26431 · ● 150.7K · ◷
Context
From discussion #26431 (Repository Quality Improvement Report — Validator Complexity Compliance).
pkg/workflow/dispatch_workflow_validation.gois 363 lines (21% over the 300-line hard limit in AGENTS.md). It mixes two clearly distinct concerns: (1) dispatch workflow validation logic and (2) workflow file-resolution utilities.Objective
Extract file-resolution utilities into a dedicated file to separate concerns and bring both files under the hard limit.
Steps
pkg/workflow/dispatch_workflow_file_resolver.go(sameworkflowpackage) containing file-resolution utilities:getCurrentWorkflowNameisPathWithinDirfindWorkflowFile(and any associated types likefindWorkflowFileResult)mdHasWorkflowDispatchextractMDWorkflowDispatchInputsdispatch_workflow_validation.go(target under 200 lines):validateDispatchWorkflowextractWorkflowDispatchInputscontainsWorkflowDispatchmake fmt && make lint && go test -run ".*[Dd]ispatch.*" ./pkg/workflow/Acceptance Criteria
pkg/workflow/dispatch_workflow_file_resolver.gocreated with the file-resolution utility functions listed abovepkg/workflow/dispatch_workflow_validation.goretains only validation-logic functions, under 200 linesworkflowpackagemake fmtandmake lintpassmake test-unit)