Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

batches: setup worker for validating GitHub apps#52897

Merged
BolajiOlajide merged 9 commits into
batches/commit-signingfrom
bo/create-worker-validity-gh-app-install
Jun 9, 2023
Merged

batches: setup worker for validating GitHub apps#52897
BolajiOlajide merged 9 commits into
batches/commit-signingfrom
bo/create-worker-validity-gh-app-install

Conversation

@BolajiOlajide

@BolajiOlajide BolajiOlajide commented Jun 3, 2023

Copy link
Copy Markdown
Contributor

This PR introduces a background worker that runs every 24 hours. This background worker adds data for new installations of a GitHub app to the database and removes installations that no longer exist on GitHub.

This ensures that Sourcegraph has some level of sync consistency with GitHub.

Test plan

  • Create a GitHub app and ensure the installation information isn't saved in the database. If you have pre-existing apps before the introduction of batches: save installation id on github apps install #52618 then you already have GitHub apps without installation data saved.
  • Starting your SG instance instantiates a background worker that'll backfill the installation information and save it in the github_app_installs table.

@cla-bot cla-bot Bot added the cla-signed label Jun 3, 2023
@BolajiOlajide BolajiOlajide force-pushed the bo/create-worker-validity-gh-app-install branch 2 times, most recently from efbacc3 to 428d18f Compare June 6, 2023 22:44
@BolajiOlajide BolajiOlajide force-pushed the bo/create-worker-validity-gh-app-install branch from 428d18f to 97595a9 Compare June 7, 2023 22:38
@BolajiOlajide BolajiOlajide marked this pull request as ready for review June 7, 2023 22:55
@BolajiOlajide BolajiOlajide self-assigned this Jun 7, 2023
@sourcegraph-bot

sourcegraph-bot commented Jun 7, 2023

Copy link
Copy Markdown
Contributor

Codenotify: Notifying subscribers in CODENOTIFY files for diff d84a5a8...67edb11.

Notify File(s)
@efritz enterprise/cmd/worker/internal/githubapps/BUILD.bazel
enterprise/cmd/worker/internal/githubapps/job.go
enterprise/cmd/worker/internal/githubapps/worker/BUILD.bazel
enterprise/cmd/worker/internal/githubapps/worker/installation_backfill.go
enterprise/cmd/worker/internal/githubapps/worker/installation_backfill_test.go
enterprise/cmd/worker/shared/BUILD.bazel
enterprise/cmd/worker/shared/shared.go

@sourcegraph-bot

sourcegraph-bot commented Jun 7, 2023

Copy link
Copy Markdown
Contributor

📖 Storybook live preview

@BolajiOlajide BolajiOlajide requested a review from a team June 8, 2023 13:58

@courier-new courier-new left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff, love all the test coverage.

Comment thread enterprise/internal/github_apps/store/store.go
@BolajiOlajide BolajiOlajide merged commit fc8071b into batches/commit-signing Jun 9, 2023
@BolajiOlajide BolajiOlajide deleted the bo/create-worker-validity-gh-app-install branch June 9, 2023 15:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants