Skip to content

[deep-report] Refactor validateWorkflowData (387 lines) into focused validators #28121

@github-actions

Description

@github-actions

The validateWorkflowData function in pkg/workflow/compiler.go is 387 lines and handles at least 10 distinct validation concerns: expression safety, runtime-import files, feature flags, action-mode, permissions, MCP tools, safe outputs, GitHub tools, expressions, and template validation. This is the primary reason compiler.go scores 75/100 in the Daily Compiler Quality Report (2026-04-22, #27906).

Description: Decompose validateWorkflowData into at least 4 focused validators:

  • validateExpressions() — expression safety checks
  • validateFeatures() — feature flags and action-mode validation
  • validatePermissions() — permissions and MCP tool constraints
  • validateToolConfiguration() — safe outputs, GitHub tools, template validation

Each sub-validator becomes independently testable. Also add fmt.Errorf wrapping to the 5 bare return err calls in compiler.go (lines 69, 150, 334, 769, 783).

Expected Impact: Improves compiler.go score from 75/100 toward 85/100. Each validator is testable in isolation, reducing regression risk when modifying validation logic. Aligns with compiler_jobs.go's pattern which scores 81/100 with well-decomposed functions.

Suggested Agent: Sergo (Serena Go Expert) or any agent with Serena LSP + test runner access. Already identified as a recommendation in #27906.

Estimated Effort: Medium (2–3 hours — refactor + test suite verification)

Data Source: DeepReport Intelligence Briefing 2026-04-23, Daily Compiler Quality Report #27906

Generated by DeepReport - Intelligence Gathering Agent · ● 494.2K ·

  • expires on Apr 25, 2026, 3:32 PM UTC

Metadata

Metadata

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