This repository was archived by the owner on Sep 30, 2024. It is now read-only.
fix(batches): switch github app installation handling from redirect flow to webhooks#64036
Merged
Conversation
peterguy
approved these changes
Jul 25, 2024
peterguy
left a comment
Contributor
There was a problem hiding this comment.
Should be much more reliable than the sleep approach :-D
Contributor
Author
To be honest, that doesn't remove the sleep approach. It's just a way to deal with eventual consistency between the sourcegraph instance and github. |
….tsx Co-authored-by: Peter Guy <peter.guy@sourcegraph.com>
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.
Closes SRCH-741
Closes SRCH-716
This PR removes the GitHub installation code from the redirect flow to a webhook-based appraoch. We expect that the GitHub server calls the webhook when the installation is ready, and therefore shouldn't see the errors explained in the issues above.
To handle the potential delay until the webhook is called and the credential is set up, I added a scrappy info notice that the user should refresh their page:
Below is what you see after you refreshed (or if the webhook was called faster than the user being redirected back to the settings):
I'm able to create PRs for sourcegraph-testing with an app that was created this way.
I'm seeing an error when getting an access token with a personal github app to run a batch change, but that will be handled with another PR.
Test plan
Manual testing locally, and more testing to be done on S2 where we have a more production like environment
Changelog