-
Notifications
You must be signed in to change notification settings - Fork 567
Switch from callbacks to webhooks for repos #2466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ceb95d5 to
0dca4b0
Compare
|
|
||
| accountLogin, accountId := getAccountDetails(installation.Installation.Account) | ||
|
|
||
| link, err := models.DB.GetGithubInstallationLinkForInstallationId(installationId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in case its first instllation the link will only be created on the callback and here we depend on it so we need a retry mechanism incase the webhook arrives before the callback over here. We can retry like 3 to 5 times to fetch the link and if not we call it a failure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed
motatoes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the callback function there is this part on top
if !codeExists || len(codeParams) == 0 {
slog.Error("There was no code in the url query parameters")
c.String(http.StatusBadRequest, "could not find the code query parameter for github app")
return
}
However since moving updates to webhook a missing code parameter is no longer considered an error (the update will happen in the webhook) so that step should return a success message
🧠 AI Assistance Disclosure Policy
Important
Inspired by ghostty.
If you used any AI assistance while contributing to Digger, you must disclose it in this PR.
✅ AI Disclosure Checklist
Details (if applicable):
💡 Notes