Refactor: Extract engine validation methods to dedicated file#3491
Merged
Refactor: Extract engine validation methods to dedicated file#3491
Conversation
- Create new file pkg/workflow/engine_validation.go following established pattern - Move validateEngine method (23 lines) - Move validateSingleEngineSpecification method (49 lines) - Add comprehensive documentation header following validation file pattern - Maintain all imports and logger usage - All tests pass, linter passes - Total 76 lines removed from engine.go, new file 118 lines Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Extract validation methods from engine.go to engine_validation.go
Refactor: Extract engine validation methods to dedicated file
Nov 8, 2025
pelikhan
approved these changes
Nov 8, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the engine validation code by extracting validation functions from engine.go into a new dedicated file engine_validation.go. This follows the project's code organization guidelines for domain-specific validation.
- Moves
validateEngine()andvalidateSingleEngineSpecification()functions to a new file dedicated to engine validation - Adds comprehensive documentation explaining when to add validation to this file
- Maintains identical functionality - this is purely a code organization improvement
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/workflow/engine_validation.go | New file containing engine validation functions with comprehensive documentation following the validation architecture pattern |
| pkg/workflow/engine.go | Removes engine validation functions (moved to engine_validation.go) - keeps engine configuration extraction logic |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extracted validation methods from
engine.goto improve code organization and follow the established*_validation.gopattern used throughout the codebase.Changes
Created
pkg/workflow/engine_validation.govalidateEnginemethod (validates engine ID support via registry)validateSingleEngineSpecificationmethod (enforces single engine across imports)docker_validation.go,npm_validation.go, etc.engineValidationLoglogger with namespaceworkflow:engine_validationUpdated
pkg/workflow/engine.goContext
This aligns with the validation file pattern where domain-specific validation lives in dedicated
*_validation.gofiles rather than mixed with core logic. Improves discoverability and maintains architectural consistency.Related to #3478
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.