-
-
Notifications
You must be signed in to change notification settings - Fork 325
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
Starlark #341
base: master
Are you sure you want to change the base?
Starlark #341
Conversation
log.Println("\tExecuting filter:", filter) | ||
func execFilter(source string, opts map[string]interface{}) bool { | ||
name := "template" | ||
if strings.Contains(source, "def main(") { |
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 not too happy with this "string magic". Maybe we could introduce proper filter types? I was also pondering having simple bash-scripts as filters, which either return 0 or 1 as a result.
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 also not sure if it is a good solution but it requires a selector on the UI side and I'm not ready to dive into Ember. If you're ready to do such adjustments, please, do.
If to talk about a better backend-only solution, I can propose shebangs. In that case, this line will be if strings.HasPrefix(source, "#!/usr/bin/env starlark")
, for example.
Bash scripts is a cool and fun idea. I'm sure some will be happy to build grep/sed/awk/perl pipelines.
Add Starlark template filter syntax support. See the included documentation for more information
Motivation
Requirements
Blocked by #340 (contains that PR in the diff)
TODO
The
input
field for filters in beehive-admin should be changed totextarea
. For now, I'm using YAML configuration file from #339 to write starlark filters.