feat(playground): add GitHub URL validation endpoint (#124)#130
Merged
DevanshuNEU merged 2 commits intoDec 25, 2025
Merged
Conversation
- Add POST /api/v1/playground/validate-repo endpoint - Parse and validate GitHub URLs (owner/repo extraction) - Fetch repo metadata from GitHub API (public/private, stars, language) - Count code files using tree API (filters by CODE_EXTENSIONS) - Handle edge cases: 404, rate limits, truncated trees, timeouts - Cache validation results (5 min TTL) - Enforce 200-file limit for anonymous indexing - Add 25 comprehensive tests Closes OpenCodeIntel#124
|
@DevanshuNEU is attempting to deploy a commit to the Dev's projects Team on Vercel. A member of the Team first needs to authorize it. |
- Fix repo_manager mocking to use patch.object on instance - Add early patching in conftest.py to prevent import-time errors - Fix auth module reload cleanup in DevApiKeySecurity tests - Remove module-level sys.modules pollution from test_validate_repo.py - Clean up lint issues (unused imports, line length, whitespace) All 139 tests now pass consistently.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
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
Implements GitHub URL validation endpoint for anonymous indexing (Epic #114).
Changes
New Endpoint
Request
{ "github_url": "https://github.com/user/repo" }Response Cases
Valid & Can Index:
{ "valid": true, "repo_name": "repo", "owner": "user", "is_public": true, "default_branch": "main", "file_count": 150, "size_kb": 2048, "language": "Python", "stars": 1234, "can_index": true, "message": "Ready to index" }Too Large (>200 files):
{ "valid": true, "can_index": false, "reason": "too_large", "message": "Repository has 2,500 code files. Anonymous limit is 200." }Private Repository:
{ "valid": true, "is_public": false, "can_index": false, "reason": "private" }Not Found:
{ "valid": false, "reason": "not_found" }Implementation Details
RepoValidator.CODE_EXTENSIONSnode_modules,.git, etc.Testing
Files Changed
backend/routes/playground.py- Added endpoint + helpersbackend/tests/test_validate_repo.py- New test fileCloses #124