Skip to content

fix: enforce maximum of 1024 items in range expressions#268

Closed
crowecawcaw wants to merge 1 commit intoOpenJobDescription:mainlinefrom
crowecawcaw:fix-range-items-limit
Closed

fix: enforce maximum of 1024 items in range expressions#268
crowecawcaw wants to merge 1 commit intoOpenJobDescription:mainlinefrom
crowecawcaw:fix-range-items-limit

Conversation

@crowecawcaw
Copy link
Contributor

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.

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>
@crowecawcaw crowecawcaw force-pushed the fix-range-items-limit branch from 20f7552 to 3cdaceb Compare February 18, 2026 00:40
@sonarqubecloud
Copy link

@mwiebe
Copy link
Contributor

mwiebe commented Feb 18, 2026

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 <IntRangeList> but not on <IntRangeExpr>.

@crowecawcaw
Copy link
Contributor Author

I see. Closing this PR. Created a spec issue for clarification: OpenJobDescription/openjd-specifications#114

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments