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. We need a deletedAt, so that we don't lose metrics
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.removedwebhooks, we should remove the repository from our database.Notes:
GITHUB_REPOSITORIES_SYNCqueue currently handle both theaddedand theremovedevent. We can keep it that way and just add a delete method with a clause likeWHERE 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.We need a deletedAt, so that we don't lose metrics