Skip to content

Commit a52249d

Browse files
Copilotpelikhan
andauthored
refactor: decompose 387-line validateWorkflowData into 4 focused validators (#28145)
* Initial plan * refactor: decompose validateWorkflowData into 4 focused validators - Create compiler_validators.go with validateExpressions, validateFeatureConfig, validatePermissions, and validateToolConfiguration (each ~100 lines, independently testable) - Reduce validateWorkflowData from 387 lines to a 25-line orchestrator - Add fmt.Errorf/isFormattedCompilerError defensive wrapping for the bare return err calls at CompileWorkflowData lines 775 and 789 - Add compiler_validators_test.go with tests for each new validator - Remove now-unused 'slices' import from compiler.go Agent-Logs-Url: https://github.com/github/gh-aw/sessions/7c5f96e4-396a-4b5a-b1df-52d8c72b86d7 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> * refactor: rename cachedPermissions to workflowPermissions for clarity Address code review feedback: rename the parameter and local variable from 'cachedPermissions' to 'workflowPermissions' in validateToolConfiguration, validateWorkflowData, and the test file to better reflect it is a freshly parsed permissions object rather than a performance cache. Agent-Logs-Url: https://github.com/github/gh-aw/sessions/7c5f96e4-396a-4b5a-b1df-52d8c72b86d7 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> * fix: address review feedback on compiler_validators and compiler error formatting - Replace console.FormatWarningMessage("⚠️ WARNING: ...") with formatCompilerMessage(markdownPath, "warning", ...) for the sandbox disabled warning to avoid duplicate icon/prefix and add file context - Replace fmt.Errorf fallback in CompileWorkflowData with formatCompilerError calls so unformatted errors still get proper compiler diagnostics context with file path Agent-Logs-Url: https://github.com/github/gh-aw/sessions/c3ba6830-0d95-4be1-878f-3ea9dc53b5c2 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> Co-authored-by: Peli de Halleux <pelikhan@users.noreply.github.com>
1 parent f596323 commit a52249d

3 files changed

Lines changed: 717 additions & 384 deletions

File tree

0 commit comments

Comments
 (0)