Closed knownasilya closed 8 years ago
hmm maybe we should introduce this. However, I am not completely sure. A github webhook already includes quite a bit of information which would allow us to distinguish events/repos easily. We could thus simply 'announce' newly received webhooks to the rest of the system.
Example: as soon as the github endpoint receives a new webhook it emits an event 'webhook.github.received' with the arguments 'repo' and 'type' (pull_request etc.). The workflow manager of a project can then react to this event and trigger its workflow pipeline.
But what if you want to setup two projects with the same repo? For example, if you have a repo with an api and the client app together, but want to deploy separately.
Wouldn't this work the same way with your approach and my approach? For my approach:
For you approach:
The only difference I see is that the relationship 'project':'webhook url' is encoded explicitly into your approach. In my approach this relationship is not needed because a workflow manager 'knows' to which kind of webhook events (webhook event !== url) it wants to react to.
However, it might be that I missed something essential here or misunderstood you...
How does your webhook manager know which project the repo url is associated with? Github doesn't have that information, and I don't see a way to infer it, if you use the same repo for two projects.
Closing, since I think you converted it. Makes it easy to do other types of webhooks as well, e.g. rest
Currently there is a github endpoint, but really it should be
api/v1/projects/<projectId>/webhook/github
This will then trigger any environments that respond to the type of webhook triggered.