-
Notifications
You must be signed in to change notification settings - Fork 106
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
Script annotations for input Parameters #708
Conversation
Signed-off-by: Elliot Gunton <[email protected]>
d6e501c
to
1b28454
Compare
Codecov Report
@@ Coverage Diff @@
## main #708 +/- ##
=======================================
+ Coverage 77.4% 77.7% +0.2%
=======================================
Files 45 45
Lines 3346 3386 +40
Branches 639 649 +10
=======================================
+ Hits 2592 2632 +40
+ Misses 576 573 -3
- Partials 178 181 +3
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
3f342d3
to
47346eb
Compare
a036116
to
aa0374a
Compare
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.
Two small comments! Looking good 💯
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.
We need to add the old behaviour back in but otherwise LGTM!
Add support for easier declaration of script input parameters using typing.Annotated. It supports enum, default, name, and description. It is an experimental feature, enabled by script_annotation flag in global_config. Signed-off-by: GitHub <[email protected]>
c7622e3
to
5733e30
Compare
Signed-off-by: GitHub <[email protected]>
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.
More docs, slight change on env var then LGTM!
Signed-off-by: Mikolaj <[email protected]>
Signed-off-by: Mikolaj <[email protected]>
Pull Request Checklist
Description of PR
This PR adds some basic support for annotations for script. We can avoid duplication of parameter names and default values. See the old version
vs the new one:
We also allow for renaming parameters, using YAML rules for naming
kebab-case support for runner
Since we now allow for parameters to have a new name and the naming rules come from YAML, we allow kebab-case names for parameters which could be used in a script runner. A mapping of kwargs was created that maps the parameter name from annotations to the one found in the python function signature.