quarkiverse / quarkus-github-app

Develop your GitHub Apps in Java with Quarkus.
https://docs.quarkiverse.io/quarkus-github-app/dev/index.html
Apache License 2.0
60 stars 27 forks source link

Add support for manual firing of events #613

Open The-Huginn opened 2 months ago

The-Huginn commented 2 months ago

Hi,

We currently seek a way to fire events manually. We plan to deploy our application behind a VPN, where a webhook from GitHub would not be possible, due to security reasons (I know, this is not how this extensions was meant to be used). We are looking for scheduled polling of events from GitHub's API and then manually firing such events.

I do have a working PR in our repository for this. I was interested, what do you think about it. I have created also a similar testing framework to yours for that, where I tried to reused yours as much as possible (please see this. And usage can be seen here

I expect there would be possibility from this extension to create proxy for GitHubEventEmitter interface, where void fire() would instead be List<GitHubEvent> fire(GitHub github).

However, I understand this is somewhat different use-case from what this app is supposed to serve. Perhaps you could at least expose some functionality we are retrieving with reflection, which is not the best, to remove this class. Also it would be beneficial, if we could allow to serialize mocked GHRepository, such as this is causing exceptions by Mockito. This should be allowed by this setting

Let me know, what you think of this, if that makes sense or not :blush: