a8n: Persist GitHub ChangesetEvents to database
Created by: tsenart
This adds the necessary methods to the a8n.Store
to upsert, list and count a8n.ChangesetEvents
.
After loading changesets in the a8n.Syncer
we upsert them into the database, making sure that on conflict they're updated.
The key
column on changeset_events
is added in preparation for the introduction of webhooks, where we could potentially receive the same event via API calls and via webhook payloads. In that case, we want to make sure that we can reconcile the two different representations of the same event and update the database entry to its newest version.
The PR also adds a minimal first GraphQL API for changeset events. It's minimal, because we still need to work out the schema.
cc @felixfbecker