Repository navigation
feat(workflow-operator): bound Reservoir Sampling's k at 1 - #9563
Open
Matthew-DWM wants to merge 1 commit into
Open
Matthew-DWM wants to merge 1 commit into
Matthew-DWM wants to merge 1 commit into
Conversation
Reservoir Sampling's sample size had no lower bound in its schema, so the property editor accepted 0 or a negative number and let the run start. The engine refuses such a sample size at the first row, but the refusal pauses the worker, so the run stayed Running until it was killed. k now declares minimum: 1, and the editor shows "Invalid Workflow" instead. A k from the API, an imported workflow or a loop variable is still refused by the executor.
Contributor
Automated Reviewer SuggestionsBased on the
|
This branch has not been deployed
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.
What changes were proposed in this PR?
Reservoir Sampling's sample size k had no lower bound in its schema, so the property editor accepted 0 or a negative number and let the workflow run. The engine refuses a sample size below 1 at the first row, but the refusal pauses the worker, so the run stays Running until it is killed. k now declares
minimum: 1, so the editor rejects such a value before the run starts.The check runs in the editor only. A value set through the API, an imported workflow or a loop variable still reaches the engine, which refuses it at the first row as before. Inside a loop, k can still hold a loop variable such as
$i, since the bound applies only to numbers.Any related issues, documentation, discussions?
Closes #9506
How was this PR tested?
A new test in
ReservoirSamplingOpDescSpecchecks k = -1, 0, 1 and 5 against the generated schema, using the same validator asScanSourceOpDescSpec. It fails onmain, where the schema accepts -1, and passes with this change.The editor's validator (ajv 8.18.0, set up as in
ValidationWorkflowService) was also run on the schema before and after:Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 5.5)