-
Notifications
You must be signed in to change notification settings - Fork 36
Use Github APIs to sync state instead of webhooks #426
Comments
To expand on this: the issues @rcullito linked are all caused by our DB state getting out of sync with the "source of truth" (which is GitHub). Our current approach derives state from a set of webhook payloads. This is troubling for two reasons:
An alternative approach to doing this kind of event sourcing on webhook payloads might be utilizing GitHub's API to derive the state that should be in our database. This could still be triggered by incoming webhooks but would allow us to elegantly avoid the two problems outlined above. In case of trouble, we could also easily initiate this process from the REPL or via an API. |
Some time ago when we had to re-check our data against Github state we used a small fn: open-bounty/src/clj/commiteth/github/core.clj Line 367 in a70696f
|
I think the |
We'd still need to search for issues with a bounty label because it might happen that we don't have an issue in our db, so no |
I reached out to GitHub support to understand how we could use their API to identify PRs that are claims towards a bounty/issue. While it's not directly possible to retrieve the PR that closed an issue the (beta) timeline API allows finding all PRs that referenced an issue. Parsing the body and title as we do now should then allow us to identify claims quite easily:
https://developer.github.com/changes/2016-05-23-timeline-preview-api/ |
This is meant to generally address a certain class of issue around discrepancies between github state and the local SOB state – which is currently linked via webhooks listening for manually generated user actions taken on Github's UI.
The goal here would be to replace the need for taking a defined series of manual steps with a central function such as
refresh-state
examples of specific issues this should help address include:
bounty
label is not recognizable as open claim #423The text was updated successfully, but these errors were encountered: