Skip to content

Conversation

@mwiebe
Copy link
Contributor

@mwiebe mwiebe commented Feb 11, 2025

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

https://github.com/OpenJobDescription/openjd-specifications/blob/mainline/rfcs/0002-model-extensions.md

What was the solution? (How)

Implement support into template parsing.

What is the impact of this change?

RFC 0001 and other later RFCs can be implemented in a manner conformant with RFC 0002. The base 2023-09 specification stays the same, except when a list of names for extensions is provided in the template, and the implementation processing the template supports those extensions.

How was this change tested?

  • Have you run the unit tests?

Yes

Was this change documented?

  • Are relevant docstrings in the code base updated?

Yes

Is this a breaking change?

It's not a breaking change. the new parameter supported_extension for parsing a template is optional, and if none are provided, it uses the base specification with no extensions enabled.

Does this change impact security?

This does not impact the threat model, and the new extensions field and parameter follow the same level of input validation relevant for existing threats.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@mwiebe mwiebe requested a review from a team as a code owner February 11, 2025 17:30
@mwiebe mwiebe force-pushed the rfc-0002-extensions branch from 093ce61 to 797fc8b Compare February 11, 2025 17:36
@mwiebe mwiebe force-pushed the rfc-0002-extensions branch from b5c74c5 to 03ccc01 Compare February 11, 2025 20:03
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
24.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@mwiebe mwiebe merged commit 2e104e0 into OpenJobDescription:mainline Feb 11, 2025
18 of 19 checks passed
@mwiebe mwiebe deleted the rfc-0002-extensions branch February 11, 2025 21:06
if schema_version == TemplateSpecificationVersion.JOBTEMPLATE_v2023_09:
return parse_model(model=JobTemplate_2023_09, obj=template)
return parse_model(
model=JobTemplate_2023_09, obj=template, supported_extensions=supported_extensions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question, will we change this in the near future? 2025_03 or something like that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I think it's better to accumulate a series of extensions before starting a new revision.

Copy link

@leongdl leongdl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants