allegroplanet / allegro-planet

1 stars 1 forks source link

Move GithubWebhooks into Scope of Game #58

Closed MarkOates closed 6 years ago

MarkOates commented 6 years ago

Allow for Per-Project GitHub Webhook Addresses

Each game will need to link its GitHub repo to a corresponding Allegro Planet project in order to trigger builds. To do that, each user will need to create a webhook on their GitHub's project page, and grab a unique webhook URL from their Allegro Planet project to plug into there. An example endpoint generated by Allegro Planet for their project might look something like this:

https://www.allegroplanet.com/games/my-project-name/github-webhooks/94e4f0ef-e0e3-45c7-ae62-6cb35f21ebad/events

This URL can be generated and there can only be one per project. (For now, these can be generated by an admin and passed onto the user. Eventually, the user can "opt-in" to GitHub builds and generate this URL in their project settings).

Correspondingly, Allegro Planet will need to keep track of the GitHub "events" that are posted to its webhook endpoints. As a result, a GithubWebhookEvent is used (and the payload stored) when a webhook callback is made to that address. Consequently, this PR repurposes the name GithubWebook to represent an endpoint that a repo will post to for that project.

Also in This PR


Related: #55