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

NBs becoming untrusted in save hook #892

Open
jph00 opened this issue Aug 18, 2022 · 1 comment
Open

NBs becoming untrusted in save hook #892

jph00 opened this issue Aug 18, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@jph00
Copy link
Contributor

jph00 commented Aug 18, 2022

Currently NBs become untrusted when saving, if using the save hook.

@jph00 jph00 changed the title Trust NBs in save hook NBs becoming untrusted in save hook Aug 18, 2022
@jph00 jph00 added the bug Something isn't working label Aug 18, 2022
@seeM
Copy link
Contributor

seeM commented Aug 23, 2022

I've been looking into this and there seem to be quite a few issues with Jupyter's trust system with hooks completely disabled. I'm not sure when/why these first appeared. See section below for more.

One idea would be to allow users to opt-in to completely disabling the trust system for notebooks in nbdev repos by configuring a repo-specific setting (e.g. trust_nbs = True). I'm not yet sure if this is possible or if its a good idea, will tinker some more. Another idea would be to deal with the current behaviour until its fixed upstream (or try make a PR). @hamelsmu @jph00 what do you think?

Jupyter trust issues

Creating a cell of any type breaks trust in Notebook

I haven't seen an issue tracking this in the Notebook repo. jupyterlab/jupyterlab#9765 is similar but is in Lab.

Repro:

  1. Open any notebook
  2. Trust it (click the "Untrusted" button on the top-right)
  3. Create a cell of any type - it should remain trusted (should show "Trusted" on the top-right)
  4. Refresh the page - it will now be untrusted

This isn't the case in Lab. For example, creating a code cell with source "1" keeps trust in Lab.

Markdown cells break trust in Lab

This is being tracked in: jupyterlab/jupyterlab#12889. It's a different issue to the previous and only affects Lab.

Repro:

  1. Open any notebook
  2. Trust it (open the command prompt and run "Trust Notebook")
  3. Create a blank code cell or markdown cell - it should now be untrusted (should show a shield with an x in the bottom-right)
  4. Trust it - it should still be untrusted
  5. Refresh the page - it should still be untrusted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants