Feature request: Provide notebook version or pinned slug through web UI

Until recently the “Download code” option was a reasonably quick method to get the pinned notebook slug (via the first line comment), by viewing the module code directly in the browser.
Unfortunately selecting the option now triggers a download. Unless I want to download the code each time, I now have to follow these steps instead:

  1. in my importing notebook, have the dev tools’ network tab open
  2. import the notebook via its unpinned slug
  3. find the notebook request and view the response
  4. copy the pinned slug and update the cell accordingly

Plans to implement pinned notebook imports have been mentioned several times, but we’re not there yet. In the meantime I’d appreciate some easier means to obtain a pinned slug or revision (this could be as simple as displaying the revision near the notebook title).

3 Likes

Yep, we (as soon as we’re able) intend to implement version pinning similar to a yarn.lock or package-lock.json file, whereby imports and requires (and indirect imports and requires) are automatically pinned at the current version the first time they are evaluated, with some explicit option to upgrade dependencies when desired.

In the meantime, if you want a quick way to access the current version of your notebook, you can choose “View history” in the notebook menu, and the current version will be shown in the address bar.

We have some improvements related to downloading code that will hopefully be launching later today. I’ll post an update when that goes live.

I’m talking about current versions of arbitrary notebooks, not my own. Sorry if that wasn’t clear enough.

Ah, understood. I’ll try to see if we can find an interim solution before we implement version pinning. The challenge with the latter is that to do it right we need fairly extensive metadata (all transitive dependencies), and we also want it to be integrated with our history so that things work consistently when looking at old versions and across suggestions and forks.

Possibly we could do something like hook into autocomplete for imports to suggest pinning to the latest version.

3 Likes