-
Notifications
You must be signed in to change notification settings - Fork 110
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
Refactor "one or many" typed Hera values #905
Conversation
Signed-off-by: Elliot Gunton <egunton@bloomberg.net>
Signed-off-by: Elliot Gunton <egunton@bloomberg.net>
Signed-off-by: Elliot Gunton <egunton@bloomberg.net>
Signed-off-by: Elliot Gunton <egunton@bloomberg.net>
Signed-off-by: Elliot Gunton <egunton@bloomberg.net>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #905 +/- ##
=====================================
Coverage 80.3% 80.3%
=====================================
Files 49 49
Lines 3821 3831 +10
Branches 777 779 +2
=====================================
+ Hits 3069 3079 +10
Misses 557 557
Partials 195 195 ☔ View full report in Codecov by Sentry. |
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.
🎖️
Signed-off-by: Elliot Gunton <egunton@bloomberg.net>
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.
🚀
Pull Request Checklist
Description of PR
Currently, typing a value as a single value of a union or a list of the same union is verbose and becomes less readable. This PR adds an explicit
OneOrMany
type for us to reuse throughout the mixins, as well as validators that can normalize the value to a list (or as an alternative valid single-value).The issue also discusses moving the
_build_*
logic into the root validator - we could do something like that instead of thenormalize_to_list
functions, but chose to get to this halfway point first.