feat: Support RFC extensions in environment templates#213
Merged
Conversation
Signed-off-by: David Leong <116610336+leongdl@users.noreply.github.com>
epmog
approved these changes
Jul 3, 2026
seant-aws
approved these changes
Jul 3, 2026
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)
The
runandcheckcommands accept an--extensionsallow-list, but that list was only applied when decoding job templates. Environment templates were always decoded against the default model surface, ignoring the requested extensions. As a result, an environment template that declares an extension (for exampleWRAP_ACTIONSfrom RFC 0008, orEXPRfrom RFCs 0005/0006) was rejected with a validation error even when the user explicitly requested that extension on the command line.Additionally,
EXPRandWRAP_ACTIONSwere not present in the CLI'sSUPPORTED_EXTENSIONSallow-list, so they could not be enabled at all.What was the solution? (How)
EXPRandWRAP_ACTIONStoSUPPORTED_EXTENSIONSin_common/_extensions.py.WRAP_ACTIONSimpliesEXPR; the model library handles that implication when parsing.read_environment_template()in_common/_validation_utils.pynow accepts an optional, keyword-onlysupported_extensionsargument and forwards it todecode_environment_template. When omitted, the previous behavior (default model surface only) is preserved.do_run(_run/_run_command.py) anddo_check(_check/_check_command.py) now pass the parsedextensionswhen decoding environment templates, matching how job templates are already handled.What is the impact of this change?
Environment templates that declare supported extensions now validate and run correctly through
openjd run --environment ...andopenjd check ..., consistent with job-template behavior. Behavior is unchanged for templates that do not declare extensions.How was this change tested?
See DEVELOPMENT.md for information on running tests.
hatch run lint(ruff, black--check, mypy) passes clean, and the full unit test suite passes: 289 passed, 2 skipped, total coverage 93.4% (above the 92% gate).Was this change documented?
read_environment_templatedocstring documents the newsupported_extensionsargument, and inline comments at each call site explain why extensions are forwarded.Is this a breaking change?
No.
read_environment_templategained a new optional keyword-only parameter that defaults to the previous behavior, so existing callers are unaffected. No public contract is changed in a backwards-incompatible way.Does this change impact security?
No. The change only forwards an existing, user-supplied extension allow-list to the environment-template decoder; it does not create or modify files/directories or alter permission handling.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.