-
Notifications
You must be signed in to change notification settings - Fork 310
Description
Objective
Split pkg/workflow/expression_validation.go (715 lines — 2.4× the 300-line hard limit) into three focused files with clear responsibilities.
Context
From discussion #21398 (Repository Quality Improvement Report - Validator File Size Compliance). This file mixes expression safety orchestration, dangerous-property detection, runtime import path handling, and expression syntax/quote/brace validation.
Approach
Step 1: Create pkg/workflow/expression_syntax_validation.go containing only the syntax-level helper functions:
validateBalancedBracesvalidateExpressionSyntaxvalidateExpressionContentvalidateBalancedQuotes
Step 2: Create pkg/workflow/runtime_import_validation.go containing:
extractRuntimeImportPathsvalidateRuntimeImportFiles
Step 3: Rename/reduce expression_validation.go to expression_safety_validation.go (or keep the name) and remove functions moved to new files. Rename the remaining file to contain:
validateExpressionSafetyvalidateExpressionForDangerousPropsvalidateSingleExpressioncontainsExpressioncontainsLogicalOperators
Step 4: Fix all imports in each new file (add/remove as needed).
Step 5: Run make fmt && make lint && make test-unit — all must pass.
⚠️ Do NOT change any function logic. This is a pure code reorganization refactor.
Files to Modify
- Split:
pkg/workflow/expression_validation.go - Create:
pkg/workflow/expression_syntax_validation.go - Create:
pkg/workflow/runtime_import_validation.go - Rename/update:
pkg/workflow/expression_safety_validation.go(or keep original name reduced)
Acceptance Criteria
-
expression_safety_validation.gocontains orchestration and allowlist safety checks -
expression_syntax_validation.gocontains syntax-level helpers -
runtime_import_validation.gocontains import path logic - All three files are under 300 lines
-
make test-unitpasses after the split -
make fmt && make lintpass
Generated by Plan Command for issue #discussion #21398 · ◷
- expires on Mar 19, 2026, 11:46 PM UTC