Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the serverRoot variable available in DOM #6604

Closed
wants to merge 1 commit into from

Conversation

brichet
Copy link
Collaborator

@brichet brichet commented Oct 28, 2022

This PR is a proposition to fix #6603

It make the serverRoot path available in #jupyter-config-data script when the option exposeAppInBrowser is True.

@github-actions
Copy link
Contributor

Binder 👈 Launch a Binder on branch brichet/notebook/serverRoot

@jtpio
Copy link
Member

jtpio commented Oct 28, 2022

Thanks @brichet.

I checked the JupyterLab (server) code and serverRoot does not seem to be exposed there: https://github.com/jupyterlab/jupyterlab_server/blob/904bd9535934f210ca270c9a43bf85afdfe7c3f2/jupyterlab_server/handlers.py#L89

Although it might be in another place.

What kind of testing requires accessing serverRoot?

@brichet
Copy link
Collaborator Author

brichet commented Nov 8, 2022

@jtpio if I'm not wrong it is exposed here: https://github.com/jupyterlab/jupyterlab_server/blob/904bd9535934f210ca270c9a43bf85afdfe7c3f2/jupyterlab_server/handlers.py#L86
BTW, maybe it should be changed as it exposes the full path without any specific setting.

The serverRoot is used in UI tests (playwright) that requires to switch to the root directory of the application, to run some system command: https://github.com/jupyter/nbgrader/blob/066e793fb973b8ed03ea222a28c81950361edc94/nbgrader/tests/labextension_ui-tests/tests/test_utils.ts#L61
That was the easiest way I found to retrieve the root directory from UI tests, but there might be other ways.

@brichet
Copy link
Collaborator Author

brichet commented Nov 14, 2022

Finally we found a work around with @fcollonval, using environment variables.
I close this PR, feel free to reopen it if the feature can be useful.

@brichet brichet closed this Nov 14, 2022
@jtpio
Copy link
Member

jtpio commented Nov 14, 2022

Alright. For now I would say it's best to not expose more options to the client unless very necessary.

@brichet brichet deleted the serverRoot branch December 28, 2022 13:25
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide the 'serverRoot' in jupyter-config-data for tests
2 participants