dregsy
dregsy copied to clipboard
implement js tags filter
added js tags filter for complex scenarios when regex and semver uncomfortable
Great PR! Thanks a lot! I just reviewed and this is looking good. A few questions came up:
- For each JS tag filter, an Otto VM is instantiated. I'm not familiar with the Otto library, but from a quick glance it looks as if this could be a bit resource heavy if many JS tag filters are used. Would it be possible to set aside a shared Otto VM? Note: currently, dregsy is processing tasks strictly in serial, so concurrent use of the VM wouldn't be a problem. This may change in the future though, so it would be good to keep concurrent access in mind when using a shared VM.
- Is it possible to somehow limit what can be run with the Otto VM? Potentially you could write any kind of JS code in a tag filter, even file deletions and the like. It's not that big of a security concern, since as the dregsy config author, you usually have full access to the system anyway. But limiting the scope of expressions could help prevent mishaps.
- Do you think you could add a few tests that are using JS tag filters?
Closing due to inactivity.