Skip to content

First interactive code example#2897

Open
paoloredis wants to merge 25 commits intomainfrom
DOC-6375
Open

First interactive code example#2897
paoloredis wants to merge 25 commits intomainfrom
DOC-6375

Conversation

@paoloredis
Copy link
Collaborator

@paoloredis paoloredis commented Mar 17, 2026

Note

Medium Risk
Adds substantial inline JS/CSS to the global Hugo base template to bootstrap Thebe/Binder sessions and intercept fetch/EventSource, which could affect page behavior and performance. CI build steps also change for versioned docs builds, so regressions would surface at build/deploy time.

Overview
Adds a new jupyter-example shortcode that renders step-based code blocks with Thebe-powered “Run here” execution, full-file visibility toggling, copy/link actions, and optional output suppression, sourcing code from example files and deriving Binder/kernel metadata.

Updates the Hugo base layout to conditionally inject extensive Thebe configuration, styling, and client-side logic (lazy-loading Thebe, session restore, dependency gating between cells, output relocation, and rate-limit/session-expiry handling), and adjusts global copy-button injection to skip .thebe-container blocks.

Converts the redis-py client landing page to use the new interactive examples and updates its example source to include a KERNEL_NAME marker; CI versioned-docs builds now run make components before building each matrix version.

Written by Cursor Bugbot for commit f22480c. This will update automatically on new commits. Configure here.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 17, 2026

DOC-6375

@github-actions
Copy link
Contributor

@jit-ci
Copy link

jit-ci bot commented Mar 17, 2026

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

Copy link
Collaborator

@dwdougherty dwdougherty left a comment

Choose a reason for hiding this comment

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

I didn't heavily scrutinize the code, but the results look great!

Copy link
Contributor

@andy-stark-redis andy-stark-redis left a comment

Choose a reason for hiding this comment

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

This is excellent, but if you can fix the issues I mentioned then that would be very helpful :-)

@mich-elle-luna
Copy link
Collaborator

Thank you this is looking great

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

// Don't set kernelReady yet - that happens after successful bootstrap
// Set firstCellExecuted to true since kernel was already running
firstCellExecuted = true;
enableAllButtons();
Copy link

Choose a reason for hiding this comment

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

Stale session leaves dependent buttons incorrectly enabled

Medium Severity

When a saved session exists, firstCellExecuted is set to true and enableAllButtons() is called before bootstrapThebe(true) completes. If the saved session is stale and auto-reconnect fails, firstCellExecuted remains true because the general bootstrap failure path (the catch block at line 1656) only resets thebeBootstrapped — it never resets firstCellExecuted. This leaves dependent cell buttons (like r.set(...)) enabled and clickable. A user clicking one triggers a fresh kernel bootstrap but executes the dependent cell without running the connect cell first, producing a NameError because r was never defined.

Additional Locations (1)
Fix in Cursor Fix in Web

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