feat(playground): Anonymous repository indexing (#125)#131
Merged
Conversation
Checkpoint 1: Request validation and session management - Add IndexRepoRequest Pydantic model with github_url and branch - Add POST /playground/index endpoint (returns 202) - Session validation: get existing or create new session - Check has_indexed_repo: return 409 if session already has active repo - Handle expired repos: allow re-indexing if existing repo expired - Reuse GitHub validation logic from validate-repo endpoint - Validate: URL format, repo exists, is public, file count <= 200 Next: Add job management and background indexing task
- Add partial=true parameter to index first 200 files of large repos - Fix create_session() call - generate token before creating session - Fix JSON serialization in validation error handler - Add missing capture_http_exception function to sentry module - Add comprehensive tests for anonymous indexing (30 tests) All 169 tests passing.
- Poll endpoint for job status (queued/cloning/processing/completed/failed) - Returns progress with percent_complete during processing - Returns repo_id on completion for search access - Returns error details on failure - Handles partial indexing info - 7 new tests for status endpoint Checkpoint 3 complete. 176 tests passing.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
CodeQL flagged information exposure through exception. Return generic 'error' string instead of str(e) to avoid leaking internal details. Detailed errors still logged server-side.
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.
Anonymous Repository Indexing
Summary
Implements anonymous repository indexing for the playground, allowing users to index any public GitHub repository without authentication.
Changes
New Endpoints
POST /playground/index - Start indexing a public GitHub repo
partial=truefor large repos)202 Acceptedwithjob_idfor pollingGET /playground/index/{job_id} - Check indexing status
repo_idon completion for search accessNew Files
services/anonymous_indexer.py- Job manager and background indexing tasktests/test_anonymous_indexing.py- 37 tests for new functionalityBug Fixes (discovered during implementation)
create_session()signature mismatchcapture_http_exceptionto sentry moduleAPI Flow
Testing
Checklist
Closes #125