sanitizers / octomachinery

🤖 Invisible engine driving octobot machines. Simple, yet powerful. [DEMO BOT @ https://github.com/sanitizers/chronographer-github-app] | [tutorial @ https://tutorial.octomachinery.dev] | [docs @ https://docs.octomachinery.dev] | official web-site is at -->
https://octomachinery.dev
GNU General Public License v3.0
56 stars 12 forks source link

[TODO] Implement a mechanism for synthetic events #43

Open webknjaz opened 4 years ago

webknjaz commented 4 years ago

There's some commonly needed events that are combos of a few conditions. One example is PR "merged", GitHub does not emit such an event, it does not exist. But we could make it easier for the end-users to subscribe to it.

The idea is to synthetize fake events that would essentially implement pre-processing of any incoming events and so that the user-defined event handlers are only invoked under certain conditions. Checking the merged PR means checking two flags: closed and merged (because some closed PRs are unmerged).

Users can have a boilerplate for such event but it'd be cleaner to subscribe to a synthetic pull_request.merged event.

I think implementing this feature may also help us implement #36 using the same technique as it would be a synthetic event matching anything too.

Fund with Polar

webknjaz commented 4 years ago

Possible extra use case: https://github.com/thoth-station/qeb-hwt/blob/19d3d3f/app.py#L156-L157