sweetr-dev/sweetr.dev

Repository sync: support removal

Opened this issue · 0 comments

Context

When syncing repositories, our system is only adding new repositories to the database. It should also handle repository removals.

Requirements

When receiving installation_repositories.removed webhooks, we should remove the repository from our database.

Notes:

  • Our GITHUB_REPOSITORIES_SYNC queue currently handle both the added and the removed event. We can keep it that way and just add a delete method with a clause like WHERE id NOT IN (${repositoryIdsThatWereUpserted})
  • Hard deleting the repository should be okay, since any other event (like syncing a Pull Request from a repository) should sync the repository data again.