Users should be able to copy paste the URL they are in and share it
with someone else. This should "just work" - unlike how things now go with
mybinder.org.
No state must be maintained anywhere.
Is perfectly ok to have some build redirects in there to show people proper
UI when we need to do a build. We aren't trying to trigger rebuilds for
requests to JS, for example.
And we check if the repoprovider, repo, ref exists. If it does, we then
_manually proxy (not redirect) to the source file. This adds additional
complexity - we act as a somewhat inefficient proxy. However, that is the
only way to give the user the experience of being able to copy paste what
they see in their URL bar and 'just' have it work. That is a very important
UX affordance we must offer to people.
request comes in
We parse the parts out
Check if it has been built
If it has been built, we proxy out the appropriate files.
If it has not been built, we redirect to a build UI.
Braindump + plan from the plane!
State required for building is:
so a URL structure could be like:
/v1/<repo-provider>/<repo-slug>/<optional-ref>/
So if we get a request for
/v1/gh/yuvipanda/environment.yml/rel/index.html
we parse this out first into:
repo_provider = gh repo = yuvipanda/environment.yml ref = rel file_path = index.html
And we check if the repoprovider, repo, ref exists. If it does, we then _manually proxy (not redirect) to the source file. This adds additional complexity - we act as a somewhat inefficient proxy. However, that is the only way to give the user the experience of being able to copy paste what they see in their URL bar and 'just' have it work. That is a very important UX affordance we must offer to people.
So simple staticfiles won't be enough.