-
Notifications
You must be signed in to change notification settings - Fork 30
feat(templates): allow for compile-time rulesets for template steps #720
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
Codecov Report
@@ Coverage Diff @@
## main #720 +/- ##
==========================================
+ Coverage 58.09% 58.12% +0.03%
==========================================
Files 255 255
Lines 15880 15892 +12
==========================================
+ Hits 9226 9238 +12
Misses 6249 6249
Partials 405 405
|
cognifloyd
left a comment
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.
A little hacky, yes. But I think that's ok here. Let's get the functionality and then figure out if we need a more extensive refactor.
jbrockopp
left a comment
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.
LGTM
wass3rw3rk
left a comment
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.
👍🏼
Closes go-vela/community#547
A couple things to note about this PR:
It does not account for runtime rules, such as
continueandstatus. The reason being: templates are compiled and merged into the parent pipeline, and there is no way of referring to a template-level ruleset once that has happened.This PR struck me as the only way to accommodate rulesets at a template level without re-hauling a bit. Another idea would be to create a
templatefield for eachpipeline.Buildwhich carries the slice of steps (or perhaps references to them) as well as the ruleset. In other words: a lot of work.That said, I recognize this solution is a bit hacky, and if we'd rather come to a conclusion on whether or not we want this feature in the first place (and if so, probably work on a proposal to establish a design), that would be a viable outcome for this PR! Let me know your thoughts!