Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support environment templates #30

Merged
merged 1 commit into from
Jan 24, 2024
Merged

feat: support environment templates #30

merged 1 commit into from
Jan 24, 2024

Conversation

ddneilson
Copy link
Contributor

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

Environment Templates are a part of the spec that allows an Environment to be defined outside of a Job Template, but still be applied when running Job(s) created from the Job Template. The CLI doesn't support these yet.

What was the solution? (How)

This commit teaches the CLI about environment templates:

  1. In the 'check' command, to verify a template syntax;
  2. In the 'schema' command, to generate json schema for EnvironmentTemplates; and
  3. In the 'run' command, to apply Environments when running a Job locally.

The implementation of this also applies a few small cleanups and refactors to make the implementation more straightforward.

There's also a bit of cleanup around "bundles" (not a thing) and the README.

What is the impact of this change?

The CLI understands what Environment Templates are, and lets the end-user work with them.

How was this change tested?

I've run tests locally just by running the CLI, and I've enhanced the unit tests to cover the functionality. I've also modified a couple of tests to no longer look for mocked calls but to, instead, actually run code and look at the results to determine whether it's functioning correctly or not.

Was this change documented?

Yes, I modified the README to cover the new CLI options.

Is this a breaking change?

No, all added CLI options are 100% optional.


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

@ddneilson ddneilson requested a review from a team as a code owner January 19, 2024 15:25
@ddneilson ddneilson force-pushed the ddneilson/16583 branch 8 times, most recently from 918cf7c to b9d53f8 Compare January 19, 2024 16:56
Copy link
Contributor

@mwiebe mwiebe left a comment

Choose a reason for hiding this comment

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

Looks great! I have a small suggested tweak to how the CLI argument works.

src/openjd/cli/_run/_run_command.py Show resolved Hide resolved
@ddneilson ddneilson requested a review from mwiebe January 23, 2024 15:32
justinsaws
justinsaws previously approved these changes Jan 23, 2024
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
src/openjd/cli/_check/_check_command.py Outdated Show resolved Hide resolved
src/openjd/cli/_common/_validation_utils.py Outdated Show resolved Hide resolved
test/openjd/cli/test_common.py Outdated Show resolved Hide resolved
test/openjd/cli/test_common.py Outdated Show resolved Hide resolved
mwiebe
mwiebe previously approved these changes Jan 24, 2024
Environment Templates are a part of the spec that allows an Environment
to be defined outside of a Job Template, but still be applied when
running Job(s) created from the Job Template. The CLI doesn't support
these yet.

This commit teaches the CLI about environment templates:
1. In the 'check' command, to verify a template syntax;
2. In the 'schema' command, to generate json schema for
   EnvironmentTemplates; and
3. In the 'run' command, to apply Environments when running a Job
   locally.

The implementation of this also applies a few small cleanups and
refactors to make the implementation more straightforward.

Signed-off-by: Daniel Neilson <[email protected]>
@ddneilson ddneilson merged commit b845d70 into mainline Jan 24, 2024
15 checks passed
@ddneilson ddneilson deleted the ddneilson/16583 branch January 24, 2024 21:35
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