fix: enforce maximum of 1024 items in range expressions#268
Closed
crowecawcaw wants to merge 1 commit intoOpenJobDescription:mainlinefrom
Closed
fix: enforce maximum of 1024 items in range expressions#268crowecawcaw wants to merge 1 commit intoOpenJobDescription:mainlinefrom
crowecawcaw wants to merge 1 commit intoOpenJobDescription:mainlinefrom
Conversation
Range expressions like '1-1025' were accepted despite exceeding the spec limit of 1024 items. Add validation in IntRangeExpr._validate() to reject range expressions that produce more than 1024 values. Signed-off-by: Stephen Crowe <6042774+crowecawcaw@users.noreply.github.com>
20f7552 to
3cdaceb
Compare
|
Contributor
|
I recall we didn't have the same low limit for them on purpose, as it's a much more efficient way to express 10,000 or 100,000 task jobs. A limit makes sense, maybe a million is better? Reviewing the spec, I see the 1024 limit on |
Contributor
Author
|
I see. Closing this PR. Created a spec issue for clarification: OpenJobDescription/openjd-specifications#114 |
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 was the problem/requirement? (What/Why)
Range expressions should only allow 1024 items, but this package doesn't enforce the limit.
https://github.com/OpenJobDescription/openjd-specifications/blob/mainline/wiki/2023-09-Template-Schemas.md#3411-inttaskparameterdefinition
What was the solution? (How)
Enforce the limit.
What is the impact of this change?
Library matches spec closer.
How was this change tested?
Unit tests
Was this change documented?
n/a
Is this a breaking change?
No
Does this change impact security?
No
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.