Skip to content

[task] Split validation.go into focused domain-specific validation files #3742

Closed

Description

@github-actions

Objective

Refactor the overloaded pkg/workflow/validation.go file (450+ lines, 33+ functions with mixed concerns) into focused, domain-specific validation files.

Context

Currently validation.go is a catch-all file containing unrelated validation functions for expressions, containers, runtimes, schemas, secrets, repository features, and agent configurations. This violates single responsibility principle and makes the code harder to maintain and test.

Related to #3713 - Priority 1: High Impact refactoring recommendation.

Approach

  1. Create four new focused validation files following the existing specialized validator pattern:

    • repository_features_validation.go - Move 6 repository feature checking functions
    • schema_validation.go - Move GitHub Actions schema validation
    • runtime_validation.go - Move packages, containers, and expression validation
    • agent_validation.go - Move agent file and feature support validation
  2. Keep only high-level orchestration in validation.go

  3. Update imports across the codebase

  4. Verify all tests pass after refactoring

Files to Create

  • pkg/workflow/repository_features_validation.go
  • pkg/workflow/schema_validation.go
  • pkg/workflow/runtime_validation.go
  • pkg/workflow/agent_validation.go

Files to Modify

  • pkg/workflow/validation.go - Reduce to orchestration only
  • All files that import validation functions - Update imports

Acceptance Criteria

  • Four new validation files created with appropriate functions moved
  • validation.go contains only orchestration logic
  • All imports updated correctly
  • All existing tests pass without modification
  • Code follows existing validation file patterns (e.g., strict_mode_validation.go, mcp_config_validation.go)
  • Each new file is focused on a single validation domain
  • Functions maintain exact same signatures and behavior
    Related to [refactor] 🔧 Semantic Function Clustering Analysis: Refactoring Opportunities #3713

AI generated by Plan Command for #3713

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions