Skip to content
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

shell command filter #726

Closed
6 tasks done
ssube opened this issue Dec 28, 2019 · 1 comment
Closed
6 tasks done

shell command filter #726

ssube opened this issue Dec 28, 2019 · 1 comment
Assignees
Labels
scope/filter status/fixed issues that have been fixed and confirmed type/feature
Milestone

Comments

@ssube
Copy link
Owner

ssube commented Dec 28, 2019

Summary

Some filters are too complex for rules (they may require outside data sources, be written in other languages, etc). The simplest way to support a broad variety of other tools is a shell command hook. While a shell controller is probably necessary in the long-run, a shell filter should handle most of the requirements for #556, #557, and even #313 and #316 to some extent.

Scope

  • shell command filter
  • serialize filter value as JSON and write to stdin
  • behavior:
    • allow value when command succeeds, log stdout
    • drop value when command writes to stderr
    • drop value when command exits non-0

Use Case

Using curl/jq to check commit status.

Questions

Any benefits to using a shell-exec library over child_process.exec?

@ssube ssube added this to the 1.0 - stable milestone Dec 28, 2019
@ssube ssube self-assigned this Dec 28, 2019
@ssube ssube added status/progress issues that are in progress scope/filter size/small status/fixed issues that have been fixed and confirmed and removed status/new size/small status/progress issues that are in progress labels Dec 28, 2019
@ssube
Copy link
Owner Author

ssube commented Dec 29, 2019

exec had issues with sending input in headless envs (child would hang), spawn appears to work as expected and allows the bot to buffer/ignore output.

@ssube ssube closed this as completed Dec 29, 2019
@ssube ssube mentioned this issue Dec 29, 2019
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope/filter status/fixed issues that have been fixed and confirmed type/feature
Projects
None yet
Development

No branches or pull requests

1 participant