Uh oh!
There was an error while loading. Please reload this page.
fix(backend): fall back when GitHub App installation is missing - #1523
Conversation
This comment has been minimized.
This comment has been minimized.
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
WalkthroughGitHub App authentication now treats missing installations as absent tokens. GitHub client creation falls back to legacy authentication, repository credential generation continues to other sources, and the changelog documents the Enterprise synchronization fix. ChangesGitHub App authentication fallback
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Uh oh!
There was an error while loading. Please reload this page.
Fixes SOU-1588
Summary
Testing
yarn workspace @sourcebot/backend test --run src/ee/githubAppManager.test.ts src/githubAppAuth.test.tsyarn workspace @sourcebot/backend buildNote
Medium Risk
Changes which credential path runs for GitHub API and git clone when apps are configured; wrong fallback could use weaker or insufficient PAT access for orgs without an installation.
Overview
Fixes GitHub connection syncs failing when the GitHub App is configured but not installed on every org in the connection.
GithubAppManager.getInstallationTokennow returnsundefinedwhen there is no installation for an owner/host, instead of throwing.getOctokitWithGithubApplogs a warning and returns the existing (legacy PAT) Octokit when no installation token exists.getAuthCredentialsForRepoonly uses the app installation token when one is available; otherwise it keeps walking connections for a legacy GitHub token.Mixed setups—some orgs on the app, others only on PAT—can sync per-org without aborting the whole job.
Reviewed by Cursor Bugbot for commit b47a962. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit