Repository sync: support removal
Opened this issue · 0 comments
waltergalvao commented
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 theadded
and theremoved
event. 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.