Skip to content

fix!: require attribute and amount names to be unique#265

Open
crowecawcaw wants to merge 1 commit intoOpenJobDescription:mainlinefrom
crowecawcaw:fix-amount-attribute-uniqueness
Open

fix!: require attribute and amount names to be unique#265
crowecawcaw wants to merge 1 commit intoOpenJobDescription:mainlinefrom
crowecawcaw:fix-amount-attribute-uniqueness

Conversation

@crowecawcaw
Copy link
Contributor

What was the problem/requirement? (What/Why)

The amount and attribute names in host requirements are not required to be unique at the moment; duplicate names are allowed. Multiple requirements with the same name is non-sensical though and should be rejected.

Related OpenJD spec PR: OpenJobDescription/openjd-specifications#110

While updating the test, I noticed existing test was incorrectly set up and testing the wrong data model. Since the test just looked for failures, the test passed but the validation failures were for the wrong reason. I made the test more specific to ensure it's testing what we think we're testing.

There are other tests that make similar mistakes and will also need to be updated. Future work.

What was the solution? (How)

Reject a template if a step's host requirements has duplicated attribute or amount names.

What is the impact of this change?

Closes a undefined behavior gap.

How was this change tested?

Unit tests

Was this change documented?

n/a

Is this a breaking change?

Technically yes, but practically no. Duplicated requirements do not have a clear behavior, and templates with duplicates are likely buggy. Marking the PR with fix! to indicate a minor version bump is recommended.

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.

Signed-off-by: Stephen Crowe <6042774+crowecawcaw@users.noreply.github.com>
@crowecawcaw crowecawcaw requested a review from a team as a code owner February 12, 2026 15:53
@sonarqubecloud
Copy link

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.

1 participant

Comments