NBs becoming untrusted in save hook
Currently NBs become untrusted when saving, if using the save hook.
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. https://github.com/jupyterlab/jupyterlab/issues/9765 is similar but is in Lab.
Repro:
- Open any notebook
- Trust it (click the "Untrusted" button on the top-right)
- Create a cell of any type - it should remain trusted (should show "Trusted" on the top-right)
- 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: https://github.com/jupyterlab/jupyterlab/issues/12889. It's a different issue to the previous and only affects Lab.
Repro:
- Open any notebook
- Trust it (open the command prompt and run "Trust Notebook")
- Create a blank code cell or markdown cell - it should now be untrusted (should show a shield with an x in the bottom-right)
- Trust it - it should still be untrusted
- Refresh the page - it should still be untrusted