-
Notifications
You must be signed in to change notification settings - Fork 372
Description
Let's provide a scalable way for Playground to interact with remote resources and GitHub repositories. The current one, github-proxy.com, might be challenging to scale in the longer term.
With JavaScript git clone sparse checkout support and a PHP CORS Proxy, the footprint would be as small as it gets.
- Start a new site, e.g.
playground-proxy.wordpress.netto separate this from the Playground server. - Deploy the PHP CORS Proxy there.
- Stress-test it with 2000 clones per hour to verify it's a viable approach.
- Set up rate limiting.
- Perhaps restrict the CORS proxy to git URLs for now.
- Map out a project of shutting down the
plugin-proxy.phpendpoint in favor of that CORS proxy. - For git operations, run
git clonevia JavaScript(), do a sparse checkout as needed. - Create a new
gitresource type for referencing git repositories. - Rewrite github-proxy.com and github.com references in Blueprints as the new
gitresource type. - Document the official and recommended way of interacting with git.
Optionally, we could migrate the PHP CORS proxy to Async\HttpClient to give that library more real-world testing.
GitHub rate-limiting shouldn't be a problem for those git clone operations.
Long term, we might run into issues with the actual throughput. If and when that happens, let’s explore edge-caching zip files, queuing and rate limiting requests, size limits for cloned repos and artifacts, maybe keeping hot clones of 10 most popular repos etc.