Conversation
Code Coverage Report
|
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request extracts and centralizes workflow step precondition handling logic, improves schema validation to ensure Condition/Precondition DSL parity, and adds comprehensive unit tests.
Changes:
- Extracted precondition validation logic into a dedicated private function
ConvertTo-IdleWorkflowStepPreconditionSettingsfor reusability - Enhanced
Test-IdleWorkflowSchemaby addingTest-IdleConditionSchemavalidation for bothConditionandPreconditionsfields, ensuring DSL parity - Refactored step collection validation into
Test-IdleWorkflowStepCollectionhelper to reduce duplication betweenStepsandOnFailureStepsvalidation
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/IdLE.Core/Private/ConvertTo-IdleWorkflowStepPreconditionSettings.ps1 | New function that validates, normalizes, and deep-copies step precondition settings (Preconditions, OnPreconditionFalse, PreconditionEvent) |
| src/IdLE.Core/Private/ConvertTo-IdleWorkflowSteps.ps1 | Refactored to delegate precondition handling to the new converter function, reducing ~90 lines of duplicated validation logic |
| src/IdLE.Core/Private/Test-IdleWorkflowSchema.ps1 | Added Test-IdleWorkflowStepCondition and Test-IdleWorkflowStepCollection helpers; enhanced Preconditions validation to use Test-IdleConditionSchema for DSL parity |
| tests/Core/ConvertTo-IdleWorkflowStepPreconditionSettings.Tests.ps1 | New unit tests covering precondition normalization, deep-copy behavior, and invalid value handling |
| tests/Core/Test-IdleWorkflowSchema.Tests.ps1 | New unit tests verifying Condition/Precondition DSL parity and schema validation for both Steps and OnFailureSteps |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
|
@blindzero I've opened a new pull request, #240, to work on those changes. Once the pull request is ready, I'll request review from you. |
6 tasks
…ma errors Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
…s generation Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
…atterns Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Fix invalid test dates and redundant step-name prefix in precondition schema errors
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.
Motivation
ConditionandPreconditionsvalidation.StepsandOnFailureStepscollections.Description
ConvertTo-IdleWorkflowStepPreconditionSettingsto validate, normalize, and deep-copyPreconditions,OnPreconditionFalse, andPreconditionEventinto a stable shape.ConvertTo-IdleWorkflowStepsto callConvertTo-IdleWorkflowStepPreconditionSettingsand assignPreconditions,OnPreconditionFalse, andPreconditionEventfrom the returned object.Test-IdleWorkflowSchemaby introducingTest-IdleWorkflowStepConditionandTest-IdleWorkflowStepCollection, improvePreconditionsschema error reporting, and centralize collection validation and duplicate-name checks.tests/Core:ConvertTo-IdleWorkflowStepPreconditionSettings.Tests.ps1for the new converter andTest-IdleWorkflowSchema.Tests.ps1to verify Condition/Precondition DSL parity and related validation rules.Testing
Invoke-Pesteragainst thetests/Coresuite which includes the newly added tests for precondition conversion and schema validation, and they passed.OnPreconditionFalsevalues, and invalid/valid condition/precondition DSL nodes.Codex Task