Skip to content

Add JupyterHub deployment docs and cross-origin regression tests (issue #196)#386

Merged
blink1073 merged 3 commits intoCalysto:mainfrom
blink1073:fix-196
Mar 15, 2026
Merged

Add JupyterHub deployment docs and cross-origin regression tests (issue #196)#386
blink1073 merged 3 commits intoCalysto:mainfrom
blink1073:fix-196

Conversation

@blink1073
Copy link
Copy Markdown
Contributor

References

Closes #196 in combination with #375 (the code fixes already merged in #375 + this PR together fully address the issue).

Description

Adds a dedicated docs/jupyterhub.md page covering MetaKernel deployment on JupyterHub and behind an Apache or nginx reverse proxy. Also adds two unit tests that demonstrate the cross-origin (window.parent) bug reported in #196 and verify the fix introduced in #375 (_fix_cross_origin) handles every affected pattern.

Changes

  • docs/jupyterhub.md — new page covering:
    • System-wide kernel installation for JupyterHub
    • Apache (mod_proxy_wstunnel) and nginx reverse-proxy configuration with WebSocket support
    • Explanation of the Jigsaw CORS issue and how MetaKernel resolves it (postMessage, embedded XML, WebSocket fallback with base-URL handling)
    • Known limitations and troubleshooting
  • mkdocs.yml — adds the new page to the nav
  • tests/magics/test_jigsaw_magic.py — two new offline tests:
    • test_fix_cross_origin_jupyterhub — asserts all window.parent.* accesses are replaced by postMessage helpers (issue Hosting Jigsaw on Apache #196)
    • test_fix_cross_origin_embeds_saved_xml — asserts saved workspace XML is embedded as a JS variable instead of requiring an XHR

Backwards-incompatible changes

None

Testing

just test tests/magics/test_jigsaw_magic.py — all 5 tests pass, including the two new ones which run offline (no network required).

AI usage

  • Some or all of the content of this PR was generated by AI.
  • The human author has carefully reviewed this PR and run this code.
  • AI tools and models used: Claude Sonnet 4.6 (Claude Code)

 Calysto#196 with Calysto#375)

Adds docs/jupyterhub.md covering kernel installation, Apache/nginx reverse-proxy
config, and an explanation of the Jigsaw CORS fix. Adds two unit tests that
demonstrate the window.parent cross-origin issue and verify _fix_cross_origin
eliminates every direct property access in favour of postMessage and embedded XML.
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.79%. Comparing base (1edfb6f) to head (9b971e5).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #386   +/-   ##
=======================================
  Coverage   90.79%   90.79%           
=======================================
  Files          51       51           
  Lines        2943     2943           
  Branches      414      414           
=======================================
  Hits         2672     2672           
  Misses        190      190           
  Partials       81       81           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@blink1073 blink1073 enabled auto-merge (squash) March 15, 2026 20:02
@blink1073 blink1073 merged commit f14a081 into Calysto:main Mar 15, 2026
27 checks passed
@blink1073 blink1073 deleted the fix-196 branch March 15, 2026 20:06
@blink1073 blink1073 mentioned this pull request Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hosting Jigsaw on Apache

1 participant