Repository navigation
feat(knowledge): connect GitHub repositories through a GitHub App - #13
Conversation
Replaces pasting a public repository URL with a read-only GitHub App, so private repositories work and the knowledge base stays current on push. - Install/authorize flow with a signed, expiring state; installations are linked only after the installing GitHub user is verified through OAuth - Repository picker with branch, include/skip folders, release notes and optional issues - Indexes README, changelog and docs at any depth via the git tree API; source code, tests and dependencies are skipped - Signed webhook re-syncs on push, release and issue changes, and takes sources out of retrieval when access is removed - Private repositories never expose file links to customers - Unchanged documents reuse their stored embeddings, so a sync only re-embeds what changed (all source types)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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 |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary
Replaces pasting a public GitHub URL with a read-only GitHub App, so the support assistant can use private repositories and stays current on push. Unchanged documents now reuse their stored embeddings, so a sync only re-embeds what changed. This applies to every source type.
What changed
Connecting
/user/installationsconfirms that the installing GitHub user can access it, so a forgedinstallation_idin the callback URL is rejected.stateis HMAC-signed, expires after 30 minutes and is bound to the Supo user who started it.Indexing (
src/lib/knowledge/github.ts).githuband licence files are skipped.Updates (
/api/webhooks/github)X-Hub-Signature-256) before the body is parsed.Embedding reuse (
ingest.ts)Database
drizzle/0028_github_app.sqladds agithub_installationtable and two columns onknowledge_source:github_installation_idandgithub_repo_id, indexed. It is additive and idempotent. Runbun run db:migrateon production before deploying.Configuration
Optional env vars:
GITHUB_APP_ID,GITHUB_APP_SLUG,GITHUB_APP_CLIENT_ID,GITHUB_APP_CLIENT_SECRET,GITHUB_APP_PRIVATE_KEY,GITHUB_APP_WEBHOOK_SECRET. These are documented in the README and.env.example. Without them, the GitHub tab falls back to adding a public repository by URL.Testing
tsc,eslintandnext buildpass.TEST_DATABASE_URLset (Postgres 16 + pgvector).Not yet tested against a live GitHub App.
Generated by Claude Code