-
Notifications
You must be signed in to change notification settings - Fork 19
feat(rfc): Write RFC 004 to propose a grab bag of extensions #95
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
Conversation
| 4. *cancelation* — If defined, provides details regarding how this action should be canceled. If not provided, then it is | ||
| treated as though provided with `<CancelationMethodTerminate>`. | ||
|
|
||
| +5. *python | bash | cmd | powershell | node* - Syntactic sugar for scripts, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like these
| 3. **Simplified Template Authoring**: Syntax sugar for common interpreters | ||
| reduces boilerplate and makes templates more readable and maintainable. | ||
| 4. **Quicker Iteration**: Further parameterization allows for quicker iteration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At first read I didn't quite catch which of the changes fall under this - the parametrized action timeout and notifyPeriodInSeconds are described up top under "Enhanced format string support for" but being able to easily resubmit with parameter overrides for these is I think the real motivation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks! Maybe worth rephrasing in the summary to make that clearer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do!
| 1. Allowed characters: Any unicode character except those in the Cc unicode character category. | ||
| 2. Minimum length: 1 character. | ||
| -3. Maximum length: 128 characters, after the format string has been resolved. | ||
| +3. Maximum length: 512 characters, after the format string has been resolved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think any of the other names follow the "after the format string has been resolved" wording even if it's true. Maybe we need to fix the spec to make it consistent wording (no behaviour change)?
| 2. Must start with a letter or underscore character. | ||
| 3. Minimum length: 1 character | ||
| -4. Maximum length: 64 character | ||
| +4. Maximum length: 512 character |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: characters. Probably just an issue in the base spec
| + 2. *bash* - Implicitly creates a Bash embedded file, | ||
| + `command` becomes `bash`, and `args` get prefixed with the implicitly | ||
| + generated file. The file extension is `.sh`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it also be runnable? I guess only if it can be referenced outside this command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we want it to be runnable. As it's implicitly run with bash, so there's no need for the executable permission to be set. It seems to me that making the file runnable is something that should be explicit? I could be off base there though.
| + 1. *python* - Implicitly creates a Python embedded file, | ||
| + `command` becomes `python`, and `args` get prefixed with the implicitly | ||
| + generated file. The file extension is `.py`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious, do we need a way to refer to that embedded file elsewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems that this sort of depends on if we want to be able to refer to the same embedded file in an environment OnEnter/OnExit, since currently there is only OnRun for task runs. Maybe there's an an implicit embedded file we can expose via the action or top-level name?
Otherwise that's a use-case where maybe we acknowledge that the syntactic sugar doesn't make sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the conversation here #95 (comment)
I think that mostly addresses this.
| + 1. *python* - Implicitly creates a Python embedded file, | ||
| + `command` becomes `python`, and `args` get prefixed with the implicitly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering about an implementation detail specific to the python one. Some Linux distributions Python installs do not provide a python command on the PATH. They now only provide python3.
For example, on Ubuntu we see:
$ uname -a
Linux ip-172-31-11-201 6.14.0-1011-aws #11~24.04.1-Ubuntu SMP Fri Aug 1 02:07:25 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
$ python
sh: 2: python: not found
$ python3
Python 3.12.3 (main, Jun 18 2025, 17:59:45) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>We have a couple of options here:
- Specify that OpenJD-compatible session implementations account for this (determine whether
python/python3is available, and use it) - Provide a
pythonandpython3option here to let OpenJD template authors specify the command - Leave this as-is, but maybe expand in the spec that worker hosts have the
pythoncommand available. We could maybe document that debian-based distros can use thepython3-is-pythonpackage to achieve this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's also the converse issue, when there is python but not python3. I think it's important to nudge towards portable job templates, and solutions that avoid using a python3 command are better for portability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can keep it as is and add more clarification in the description that states something like
python (all lowercase) is expected to be a runnable command on a Worker host.
and similar for all other interpreters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe that messaging adjusted with "available to the user running the command". It's definitely something folks can get tripped up on for PATH, aliases, etc. if they only modify their user and now who runs the command
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it more "available in the runtime environment" compared to "available to the user"? The command could be provided by a step environment, a job environment, an externally defined environment, the user PATH configuration, or the system PATH configuration.
| ```yaml | ||
| steps: | ||
| - name: RunPythonScript | ||
| script: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would look nice to skip the 'actions' and 'onRun' nested objects when the only thing inside is a 'python' or other syntax sugar script. Do you think that's unambiguous/clear enough and doable in this rfc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that would be nice, let me play around with the spec a bit to see how that would look in practice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I can think of a couple ideas.
actions: <StepActions>
embeddedFiles: [ <EmbeddedFile>, ... ] # @optional
python | bash | cmd | powershell | node: <DataString> # @optional @fmtstring[host] @incompatible command embeddedFiles @extension FEATURE_BUNDLE_1in this you can optionally set the syntax sugar script at the <StepScript> level. If that is done you can't specify actions or embeddedFiles. Additionally you can't specify things like args, or timeouts. All defaults will be used.
This would be nice for quick, super simple scripts.
- We create a new object called
<SimpleAction>(let me know if you have a better name). This looks the exact same as anAction, but with all of the syntactic sugar included and no command.
actions: <StepActions>
embeddedFiles: [ <EmbeddedFile>, ... ] # @optional
python | bash | cmd | powershell | node: <SimpleAction> # @optional @fmtstring[host] @incompatible command embeddedFiles @extension FEATURE_BUNDLE_1script: <DataString> # @fmtstring[host]
args: [ <ArgString>, ... ] # @optional @fmtstring[host]
timeout: <posinteger> # @optional
timeout: <posinteger> | <posintstring> # @optional @fmtstring
cancelation: <CancelationMethod> # @optionalThis new object also gives us the option of using it for things like environment scripts.
Let me know what you think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the latter idea, that seems cleaner. If we want to apply it to the environment script case, the simple action would become onEnter and there would be no onExit, right? Similarly in the future if/when we add more actions than onRun to the step.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that makes sense.
Signed-off-by: Cody Edwards <[email protected]> added stuff again Signed-off-by: Cody Edwards <[email protected]> updated more stuff did more feat(rfc): Write RFC 004 to propose a grab bag of extensions Signed-off-by: Cody Edwards <[email protected]>
Signed-off-by: Cody Edwards <[email protected]>
Signed-off-by: Cody Edwards <[email protected]>
Signed-off-by: Cody Edwards <[email protected]>
|
Please note #95 is now in final-comments - if there are any other concerns please let me know! |
Tracking Issue: #92
This is a request for comments about Collection of Small Improvements.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.