-
Notifications
You must be signed in to change notification settings - Fork 4
feat: Ensure Toolkit doesn't connect to Deepnote backend (webapp) #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Ensure Toolkit doesn't connect to Deepnote backend (webapp) #25
Conversation
BLU-4936 Ensure there's no dependency if toolkit helpers on webapp when launched as CLI
This is related to all code for all integrations - ensure that they are usable independently from webapp. There are various places which request webapp directly and it should be handled in case it's configured to run in standalone mode, which should be default for CLI. |
📝 WalkthroughWalkthroughIntroduces a new environment variable in Deepnote server startup: DETEPNOTE_RUNTIME__RUNNING_IN_DETACHED_MODE='true'. When set, the server runs in detached mode: no backend or proxy requests are made, integration environment variable injection is skipped, and post-start hooks are disabled. All other startup behaviors (virtualenv PATH/VIRTUAL_ENV handling, pip constraints, working directory, server launch, lockfile behavior, and timeouts) remain unchanged. Sequence Diagram(s)sequenceDiagram
autonumber
participant U as User/CLI
participant S as DeepnoteServerStarter
participant E as Environment
participant P as Server Process
participant B as Backend (Webapp)
U->>S: start()
S->>E: Set VIRTUAL_ENV/PATH, constraints, cwd
S->>E: Set DETEPNOTE_RUNTIME__RUNNING_IN_DETACHED_MODE = "true"
S->>P: Launch server
alt Detached mode (flag = "true")
Note over S,P: Skip integration env injection
Note over S,P: Skip post-start hooks
S--xB: Do not make backend/proxy requests
else Normal mode
S->>P: Inject integration env vars
S->>P: Run post-start hooks
P->>B: Optional backend/proxy requests
end
S->>S: Handle lockfile & timeouts (unchanged)
Possibly related PRs
Suggested reviewers
Pre-merge checks✅ Passed checks (5 passed)
Comment |
There was a problem hiding this 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
📒 Files selected for processing (1)
src/kernels/deepnote/deepnoteServerStarter.node.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.node.ts
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Use
*.node.tsfor Desktop-specific implementations that require full file system access and Python environments
Files:
src/kernels/deepnote/deepnoteServerStarter.node.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.{ts,tsx}: Inject interfaces, not concrete classes
Avoid circular dependencies
Usel10n.t()for user-facing strings
Use typed error classes fromsrc/platform/errors/when throwing or handling errors
Use theILoggerservice instead ofconsole.log
Preserve error details while scrubbing PII in messages and telemetry
Include the Microsoft copyright header in source files
Prefer async/await and handle cancellation withCancellationToken
**/*.{ts,tsx}: Order class members (methods, fields, properties) first by accessibility, then alphabetically
Separate third-party imports from local file imports
Files:
src/kernels/deepnote/deepnoteServerStarter.node.ts
src/kernels/**/*.ts
📄 CodeRabbit inference engine (.github/instructions/kernel.instructions.md)
src/kernels/**/*.ts: Use event-driven updates (EventEmitter) for state changes
Monitor and dispose pending promises to prevent leaks during teardown
Use WeakRef/weak references for notebook/object backreferences to avoid memory leaks
Respect CancellationToken in all async operations
Files:
src/kernels/deepnote/deepnoteServerStarter.node.ts
🧬 Code graph analysis (1)
src/kernels/deepnote/deepnoteServerStarter.node.ts (1)
.vscode-test.mjs (1)
env(70-73)
closes BLU-4936
Summary by CodeRabbit