Skip to content

Repository sync: support removal #2

@waltergalvao

Description

@waltergalvao

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions