Skip to content

[plan] Extract file-resolution utilities from dispatch_workflow_validation.go #26435

@github-actions

Description

@github-actions

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

  1. 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
  2. Keep in dispatch_workflow_validation.go (target under 200 lines):
    • validateDispatchWorkflow
    • extractWorkflowDispatchInputs
    • containsWorkflowDispatch
  3. Run make fmt && make lint && go test -run ".*[Dd]ispatch.*" ./pkg/workflow/

Acceptance Criteria

  • New file pkg/workflow/dispatch_workflow_file_resolver.go created with the file-resolution utility functions listed above
  • pkg/workflow/dispatch_workflow_validation.go retains only validation-logic functions, under 200 lines
  • No behaviour changes — pure file reorganization within the workflow package
  • make fmt and make lint pass
  • All existing tests pass (make test-unit)

Generated by Plan Command for issue #discussion #26431 · ● 150.7K ·

  • expires on Apr 17, 2026, 1:25 PM UTC

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions