Filter environments based on URL parameters #176
Draft
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.
This could partially fix plasmabio/tljh-repo2docker#29.
We discussed this in person with @pierrepo as a way to directly point a user to the right environment, via a link from outside JupyterHub.
The link would look like the following: https://hub.plasmabio.org/user-redirect/rstudio?environment-name=plasmabio-template-r
Giving it more thoughts, we should probably wait a bit before merging this in. To give it some time to really grasp the use case and make sure that having the two flows (with and without the environment name) is not confusing to the user.
Going the hub directly and selecting the environment would still use the
default_url
configured in the plugin, and not the one that a user could have used via a/user-redirect
link.However one advantage is that it could also make it easier to start using
nbgitpuller
if the author of the environment wants to. They would be able to construct URLs that would contain the link to the repo to pull withnbgitpuller
, the name of the environment to start and optionally the URL to redirect to (/rstudio
for RStudio).Also a better approach will be to use the
Spawner.options_from_query
that will be added tojupyterhub==1.2
:https://github.com/jupyterhub/jupyterhub/blob/3d524f2092c8f1ca4c2953d78156b73107ef8c1c/jupyterhub/spawner.py#L387-L415
Here is an example of the user flow: