Skip to content

Conversation

@andyjakubowski
Copy link
Contributor

@andyjakubowski andyjakubowski commented Oct 15, 2025

The goal of this PR is to set kernel metadata on .deepnote files, so you don’t get that Select Kernel dialog every time you open the .deepnote file.

Fallback kernel metadata to use until the .deepnote file format includes kernel information.

Signed-off-by: Andy Jakubowski hello@andyjakubowski.com

Summary by CodeRabbit

  • New Features

    • Adds a built-in fallback kernel and language metadata so notebooks lacking kernel info open with sensible defaults.
  • Bug Fixes

    • Notebooks missing kernel metadata now open reliably.
    • Notebook metadata is auto-enriched during import/transform to improve compatibility and reduce manual setup.
  • Tests

    • New tests cover file-route responses, date formatting, and explicit error handling for missing, permission, and runtime errors.

Signed-off-by: Andy Jakubowski <hello@andyjakubowski.com>
@linear
Copy link

linear bot commented Oct 15, 2025

GRN-4810 feat: add kernel metadata fallback

Fallback kernel metadata to use until the .deepnote file format includes kernel information.

So that we don’t show the kernel selection dialog on .deepnote file open.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 15, 2025

📝 Walkthrough

Walkthrough

  • Added src/kernel-metadata-fallback.ts exporting a constant kernelMetadataFallback containing static kernelspec and language_info.
  • Updated src/transform-deepnote-yaml-to-notebook-content.ts to import kernelMetadataFallback and spread it into the returned notebook content metadata so default kernel data is present when missing from the source.
  • Added tests in jupyterlab_deepnote/tests/test_handlers.py to validate file-route success and various error mappings; updated cspell.json with new technical words.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant C as Caller
    participant T as transformDeepnoteYamlToNotebookContent
    participant Y as Deepnote YAML
    participant F as kernelMetadataFallback

    C->>T: transform(yaml)
    T->>Y: Read metadata from YAML
    alt Kernel info present in YAML
        T->>T: Use YAML kernel metadata
    else No kernel info in YAML
        T->>F: Import and read fallback metadata
        T->>T: Merge fallback into notebook metadata
    end
    T-->>C: Return notebook content with metadata
Loading

Pre-merge checks

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly captures the primary change—introducing a fallback for kernel metadata—using clear, conventional commit phrasing without extraneous detail. It directly reflects the core feature added in the pull request.

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Oct 15, 2025

Codecov Report

❌ Patch coverage is 95.00000% with 2 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@ea98a58). Learn more about missing BASE report.
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/kernel-metadata-fallback.ts 0.00% 1 Missing ⚠️
src/transform-deepnote-yaml-to-notebook-content.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #32   +/-   ##
=======================================
  Coverage        ?   37.29%           
=======================================
  Files           ?       13           
  Lines           ?      244           
  Branches        ?       26           
=======================================
  Hits            ?       91           
  Misses          ?      153           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ea98a58 and 3db00b1.

📒 Files selected for processing (2)
  • src/kernel-metadata-fallback.ts (1 hunks)
  • src/transform-deepnote-yaml-to-notebook-content.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/transform-deepnote-yaml-to-notebook-content.ts (1)
src/kernel-metadata-fallback.ts (1)
  • kernelMetadataFallback (2-20)
🪛 GitHub Actions: CI
src/kernel-metadata-fallback.ts

[error] 3-3: Unknown word (kernelspec)


[error] 4-4: Unknown word (ipykernel)


[error] 10-10: Unknown word (ipython)


[error] 16-16: Unknown word (nbconvert)


[error] 17-17: Unknown word (pygments)


[error] 17-17: Unknown word (ipython)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Lint & Format
  • GitHub Check: Audit - Production
  • GitHub Check: Audit - All
  • GitHub Check: build
  • GitHub Check: check_release
🔇 Additional comments (2)
src/kernel-metadata-fallback.ts (1)

3-19: Pipeline spell-check failures are false positives.

Terms like kernelspec, ipykernel, ipython, nbconvert, and pygments are legitimate Jupyter/Python identifiers. Add them to your spell-check dictionary or ignore list.

src/transform-deepnote-yaml-to-notebook-content.ts (1)

5-5: LGTM.

Import and spread correctly provide fallback kernel metadata.

Also applies to: 46-46

Artmann
Artmann previously approved these changes Oct 15, 2025
Copy link
Member

@Artmann Artmann left a comment

Choose a reason for hiding this comment

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

:shipit:

@saltenasl
Copy link
Member

@andyjakubowski build and spellchecks failing

coderabbitai[bot]
coderabbitai bot previously approved these changes Oct 16, 2025
Signed-off-by: Andy Jakubowski <hello@andyjakubowski.com>
coderabbitai[bot]
coderabbitai bot previously approved these changes Oct 16, 2025
Signed-off-by: Andy Jakubowski <hello@andyjakubowski.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 83182b2 and ae02719.

📒 Files selected for processing (1)
  • jupyterlab_deepnote/tests/test_handlers.py (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
jupyterlab_deepnote/tests/test_handlers.py (1)
jupyterlab_deepnote/handlers.py (2)
  • RouteHandler (10-59)
  • get (15-59)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Spell Check
  • GitHub Check: check_release
  • GitHub Check: build
🔇 Additional comments (4)
jupyterlab_deepnote/tests/test_handlers.py (4)

21-24: LGTM!

Correctly validates 400 for missing path parameter.


45-52: Same mock concern as permission denied test.

Logic correct for 500 on unexpected error. Same verification needed for mock approach.


27-32: Ignore inconsistency warning; test is correct
contents_manager.get raises tornado.web.HTTPError(404), not FileNotFoundError, so the FileNotFoundError catch is never hit and the generic exception yields a 500—exactly what the test asserts.

Likely an incorrect or invalid review comment.


35-42: Mocking contents_manager with patch.object(create=True) is correct Instances inherit the class attribute, so the test properly triggers the 403 path. No changes needed.

@andyjakubowski andyjakubowski merged commit 2ff5a4c into main Oct 16, 2025
13 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants