fix: handle GitHub 403 'Resource not accessible' in PR delivery recovery #SUPERLOG - #469
Open
superlog-app[bot] wants to merge 1 commit into
Open
Conversation
…ery #SUPERLOG Delivery-Id: 2b4caa5e611cff20bae24f14bbddbbccea531619af35f0ca7d3ae4cc6204fa50 Delivery-Base: main
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
When the Superlog GitHub App installation lacks
pull_requests: readpermission on a repository, the PR delivery recovery lookup throws aGithubRequestErrorwith status 403 "Resource not accessible by integration". This error was not handled insidelistPullRequestsingithubPullRequestDeliveryLookup, causing it to propagate throughrecoverPullRequestDelivery→findGithubPullRequestDelivery→preflightProposedPullRequest, which caught it, logged ERROR, and returnedok: false— blocking PR delivery entirely.This surfaced in production for
taventech/hedge(3 ERROR events between 15:01–15:07 UTC on 2026-08-17, incidenteb6caa41-4405-492a-b43a-6ff0a7451649).Root cause
getBranchHeadin the samegithubPullRequestDeliveryLookupobject already catches 404 viaisGithubNotFoundand returnsnull.listPullRequestshad no equivalent for the 403 "Resource not accessible" class of error. The distinction matters: a rate-limit 403 is retryable and should propagate; a permission-denied 403 is permanent and should be treated as "no PRs accessible" to allow fresh delivery to proceed.Remediation
Adds
isGithubResourceNotAccessible(err)— parallel toisGithubNotFound— which matches only non-retryable 403 errors whose message contains "Resource not accessible by integration".listPullRequestsnow catches this condition and returns[], sorecoverPullRequestDeliveryfalls through tonull(no prior delivery found) andpreflightProposedPullRequestproceeds to fresh delivery rather than failing.The function is exported so it can be unit-tested directly; one new test covers true-positive, false-positive (rate-limit), false-positive (404), and false-positive (plain Error) cases.
Incident: eb6caa41-4405-492a-b43a-6ff0a7451649
Was this PR helpful? Leave feedback — goes straight to the Superlog team.
Summary by cubic
Handles GitHub 403 “Resource not accessible by integration” during PR delivery recovery so lack of
pull_requests: readpermission no longer blocks delivery. Previously we threw and failed preflight; now we treat this as “no PRs found” and proceed with fresh delivery. Rate-limit 403s still retry.isGithubResourceNotAccessibleto detect non-retryable 403 permission errors.githubPullRequestDeliveryLookup.listPullRequestsand returns[]; other errors still propagate.Written for commit 4d1d733. Summary will update on new commits.