feat: add proxy discovery foundation#2
Conversation
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR establishes the initial architecture for plugproxy, a Go-based proxy source discovery, collection, and validation system. It introduces a proxy model, in-memory pool management, source abstraction with fetching, proxy validation via HTTP checking, HTTP API exposure, a CLI entry point with subcommands, and a comprehensive source discovery subsystem with GitHub/HTTP/OpenAI integrations. Supporting infrastructure includes CI/CD workflows, documentation, and project conventions. ChangesProxy Management Pipeline
Source Discovery Subsystem
Sequence DiagramsequenceDiagram
participant User
participant CLI as cmd/plugproxy
participant App as internal/app
participant Fetcher as internal/fetcher
participant Source as internal/source
participant Pool as internal/pool
participant Checker as internal/checker
participant Server as internal/server
User->>CLI: plugproxy fetch
CLI->>App: app.Fetch(ctx)
App->>Fetcher: FetchAll(ctx, sources)
loop Per source
Fetcher->>Source: src.Fetch(ctx)
Source-->>Fetcher: proxies, error
end
Fetcher-->>App: []Result
App->>Pool: pool.Add(proxy)
App-->>User: count added
User->>CLI: plugproxy check --workers=8 --target=http://example.com
CLI->>App: app.Check(ctx, workers, targetURL, timeout)
App->>Pool: pool.List(filter)
App->>Checker: check via worker pool
loop Per proxy
Checker->>Checker: HTTP GET via proxy
Checker-->>App: Result{OK, Latency}
end
App->>Pool: pool.Add(updated_proxy)
App-->>User: count healthy
User->>CLI: plugproxy run
CLI->>App: app.Serve(addr)
App->>Server: server.Handler()
Server-->>User: HTTP API listening
loop Client requests
User->>Server: GET /proxies
Server->>Pool: pool.List(filter)
Pool-->>Server: proxies
Server-->>User: JSON response
end
User->>CLI: plugproxy discover repo owner/repo
CLI->>CLI: runDiscover(discover repo)
CLI->>Discover: GitHubClient.DiscoverRepo(ctx, repo)
Discover->>GitHub: scan files (README, sources/*, proxies/*)
GitHub-->>Discover: file contents
Discover->>Discover: AnalyzeURLContent per file
Discover-->>CLI: DiscoveryReport{Candidates}
CLI-->>User: JSON candidates
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Summary
Validation
Refs #1
Summary by CodeRabbit
Release Notes
New Features
fetch,check,list,get,run, anddiscoversubcommands/health,/proxies, and/proxyendpoints for proxy accessDocumentation
Chores