This repository was archived by the owner on Sep 30, 2024. It is now read-only.
batches: save installation id on github apps install#52618
Merged
BolajiOlajide merged 2 commits intoJun 1, 2023
Conversation
Contributor
|
Codenotify: Notifying subscribers in CODENOTIFY files for diff 046709c...aa79c78.
|
Collaborator
Bundle size report 📦
Look at the Statoscope report for a full comparison between the commits 05884be and 9ee59be or learn more. Open explanation
|
Contributor
courier-new
approved these changes
May 30, 2023
Contributor
There was a problem hiding this comment.
Thanks for this! The revert looks good, but two comments:
- I know it's possible to uninstall an App from the GitHub side, so the opportunity exists for SG and GH to get out of sync with each other when that happens. Are we concerned about that happening at all? I guess worst case it might lead to semi-cryptic auth error messages surfacing in the UI? This could be in a follow up PR, but I'm wondering if it makes sense to setup a very simple cron-like background worker that once every [day? hour?] refetches that list of installations from the GitHub API and makes sure that whatever we have in the DB matches. This serves a secondary purpose, which is...
- Even if the repo syncing GH Apps don't rely on the installation IDs being set in the DB, we probably ought to backfill them for completeness. The background worker I suggested would take care of that automatically, but if we decide not to proceed with that plan then we'll want to do something else to address this.
Contributor
Author
#52648 takes care of that. |
05884be to
aa79c78
Compare
BolajiOlajide
added a commit
that referenced
this pull request
Jun 9, 2023
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 <!-- All pull requests REQUIRE a test plan: https://docs.sourcegraph.com/dev/background-information/testing_principles --> * 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 #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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is a revert of 52136. It creates a
github_app_installstable that tracks the installation of every GitHub app on the Sourcegraph instance.Closes #52494
Test plan
sg migration upinstallation_idcolumn in thegithub_app_installstable.