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

Fix extension toggling at different level #16102

Merged
merged 8 commits into from Apr 25, 2024

Conversation

divyansshhh
Copy link
Contributor

References

Fixes #16101

Code changes

Changed the _AppHandler.toggle_extension method to look into all levels to decide whether an extension is enabled or not, if it's not, we change the page_config at the specified level

Copy link

Thanks for making a pull request to jupyterlab!
To try out this branch on binder, follow this link: Binder

@krassowski krassowski added this to the 4.1.x milestone Apr 3, 2024
@krassowski krassowski added the bug label Apr 3, 2024
@krassowski
Copy link
Member

If an extension is [disabled] at the sys-prefix level, it can't be enabled at the user level.

I think this was intentional prior to having extension locks. This guaranteed that admin could disable extension globally and user would not be able to change it.

Now that we have plugin locks this change makes sense to me.

This looks like a step in the right direction, but we would need some tests to:

  • ensure that plugin cannot be toggled if locked at the higher level
  • ensure that jupyter labextension list reflects the expected status

Those can be added in the "usage" tests group.

@divyansshhh
Copy link
Contributor Author

divyansshhh commented Apr 19, 2024

nvm

@divyansshhh
Copy link
Contributor Author

FYI, this also needs jupyterlab/jupyterlab_server#448

@divyansshhh
Copy link
Contributor Author

@krassowski can you re-run the checks here now that jupyterlab_server 2.27.0 is released (I don't have the perms to)

@krassowski
Copy link
Member

I think we need to pin the dependency anyways to ensure users who are upgrading do not get an import error.

@divyansshhh
Copy link
Contributor Author

@krassowski the failures seem unrelated to this PR, can you take a look and let me know if this is good to merge?

@krassowski krassowski modified the milestones: 4.1.x, 4.2.0 Apr 24, 2024
Copy link
Member

@krassowski krassowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @divyansshhh!

@krassowski krassowski modified the milestones: 4.2.0, 4.1.x Apr 25, 2024
@krassowski krassowski merged commit 3206e7c into jupyterlab:main Apr 25, 2024
80 of 81 checks passed
@krassowski
Copy link
Member

@meeseeksdev please backport to 4.1.x

meeseeksmachine pushed a commit to meeseeksmachine/jupyterlab that referenced this pull request Apr 25, 2024
krassowski pushed a commit that referenced this pull request Apr 25, 2024
Co-authored-by: Divyansh Choudhary <divyanshchoudhary99@gmail.com>
gderocher pushed a commit to gderocher/jupyterlab that referenced this pull request Apr 26, 2024
* Fix extension toggling at different level

Fixes jupyterlab#16101

* Address review comments

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Pin jupyterlab_server dependency

* Fix usage test

* Remove check for uninstalled extension

---------

Co-authored-by: Divyansh Choudhary <choudhdi@deshaw.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

An extension disabled at the sys-prefix level can't be enabled at the user level
2 participants