Skip to content

refactor(ide): share python install helper across jupyter and marimo - #1684

Merged
skevetter merged 2 commits into
mainfrom
refactor/surface-python-ide-install
Oct 25, 2026
Merged

skevetter merged 2 commits into
mainfrom
refactor/surface-python-ide-install

Conversation

@skevetter

@skevetter skevetter commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add serverutil.InstallPythonTool (pkg/ide/internal/serverutil/python.go) to own the existence check, install command selection, log lines, and error wrapping.
  • jupyter and marimo Install() now call the helper with their own Name, Package, and Executable. The duplicated installNotebook/installMarimo bodies are removed.
  • Argv and working dir are unchanged: SuOrSh(user, cmd, "") produces the same su/sh -c argv as before.

Why

Both IDEs carried a ~30-line copy of the same Python install path. The shared helper keeps install behavior and error wrapping consistent across tools, using the existing serverutil internal utility.

Validation

Head 748f41ff08cd1b6199acd9bc05b70f1ff2a31a36.

  • CI Lint on 84a3290 failed on the new python_test.go (funcorder, gosec G306, gosec G304). Local cli:lint:ci at 84a3290 used --new-from-patch, which skips untracked files, so it did not cover that file. The earlier "0 issues" result did not include it.
  • Fix in 748f41f: useFakeUv moved after the exported tests; the stub is written with os.OpenFile(filepath.Clean(path), …, 0o600) and f.Chmod(0o700) on the open handle; the read uses filepath.Clean. No nolint or #nosec added.
  • mise run cli:format: clean.
  • go test ./pkg/ide/internal/serverutil/... -count=1: pass.
  • golangci-lint run ./pkg/ide/... (full, no new-from-patch): no findings in serverutil/python*.go, jupyter/jupyter.go, or marimo/marimo.go. The package still reports pre-existing findings in untouched files (rstudio, jetbrains, openvscode, zed, vscode, fleet, opener); out of scope.
  • prek run --all-files: all hooks passed, including golangci-lint.
  • jupyter and marimo have no test files; no E2E run.

CodeRabbit CLI

Blocked: free OSS quota exhausted (rate_limit). Attempts at 84a3290 (--agent --fresh --committed) both returned rate_limit, about 5 min wait. A third attempt on 748f41f (--agent --fresh --committed) also returned rate_limit (waitTime 2 min). No review on 748f41f; no findings verified. GitHub review gates still apply.

Auto-merge

Eligible under devsy-auto-refactor: behavior-preserving internal API change, +54 / -64 (118 non-test lines, cap 300), no excluded paths. Subject to all coordinator gates.

Summary by CodeRabbit

  • Improvements
    • Jupyter Notebook and marimo are installed automatically when their executable is not already available for the selected user. Existing installations are reused, and the server starts after installation succeeds.
    • If installation fails, the error now includes the tool name and captured command output, making the failure details clearer.

@skevetter skevetter added the surface-refactor Unattended refactor (surface) label Oct 24, 2026
@netlify

netlify Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for images-devsy-sh canceled.

Name Link
🔨 Latest commit 748f41f
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6adc5c5fa5427685f78314b6

@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bc06910f-9e67-4659-8e55-7eabc39ccb21
Commits

Reviewing files that changed from the base of the PR and between df78ff3 and 748f41f.

Files selected for processing: 4
  • pkg/ide/internal/serverutil/python.go
  • pkg/ide/internal/serverutil/python_test.go
  • pkg/ide/jupyter/jupyter.go
  • pkg/ide/marimo/marimo.go

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Walkthrough

A shared Python tool installer now handles executable checks, installation commands, and installation errors. Jupyter Notebook and marimo call this installer before starting their servers.

Changes: Python tool installation

Layer / File(s) Summary
Shared installer and tests
pkg/ide/internal/serverutil/python.go, pkg/ide/internal/serverutil/python_test.go
Adds PythonTool and InstallPythonTool. The installer skips tools whose executable exists, runs uv tool install when needed, and wraps execution errors with the tool name and command output. Tests cover these cases.
Jupyter and marimo integration
pkg/ide/jupyter/jupyter.go, pkg/ide/marimo/marimo.go
Both server installers call serverutil.InstallPythonTool and return installation errors before starting the server. Their local installation methods are removed.

Priority: Low

Estimated code review effort: 2 (Simple) | ~15 minutes

Change: Refactor

Merge Risk: Minimal · up to 748f4

No installation regression is identified. The failing Windows CI check still needs investigation and a passing result before merge.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description explains the refactor, rationale, validation results, CI status, and review limitations. However, it omits required template sections for the issue reference, type of change, AI assist… Update the description to include the required template sections. State the issue reference or write "none"; mark the change as a refactor; disclose AI tool usage and complete the required attestations; record unit and integration-test deci…
Docstring Coverage Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: sharing a Python installation helper between Jupyter and Marimo.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the refactor, rationale, validation results, CI status, and review limitations. However, it omits required template sections for the issue reference, type of change, AI assistance, checklist, and explicit manual verification details.

Resolution

Update the description to include the required template sections. State the issue reference or write "none"; mark the change as a refactor; disclose AI tool usage and complete the required attestations; record unit and integration-test decisions; list lint, test, documentation, security, and CLA checklist results; and document manual verification commands and outcomes. Include the known Windows CI failure and its blocking status.

Finishing Touches
✨ Simplify code
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@netlify

netlify Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit 748f41f
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6adc5c5f570879468a0c1c00

@skevetter
skevetter marked this pull request as ready for review October 24, 2026 08:17
@skevetter

Copy link
Copy Markdown
Contributor Author

Needs human: current head 748f41f has a failing Windows ssh-tunnel-mode test (job 120819045768), so CI Success failed. The sequential-SSH spec failed during startDetachedTunnelUp with deadline_exceeded before workspace creation; three preceding specs passed. Logs do not prove a transient infrastructure failure, so no rerun or unrelated source change was made. All other CI checks are terminal. Non-test diff remains +54/-64 (118 lines); both commits are signed and verified. Auto-merge is blocked pending investigation and passing CI. Local CodeRabbit CLI was quota-limited; GitHub completed review is still required.

@skevetter

Copy link
Copy Markdown
Contributor Author

@greptileai review

@greptile-apps

greptile-apps Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; the shared helper preserves the existing install behavior.

Summary

Moves the shared Python install steps into serverutil.InstallPythonTool.

  • Jupyter Notebook and marimo use one shared Python installer.

Reviews (1) · Last reviewed commit: "test(ide): satisfy lint in python instal..." · Reviewed by Greptile

@skevetter

Copy link
Copy Markdown
Contributor Author

Final cycle disposition: needs human. Greptile completed on 748f41f with 5/5 confidence, four files reviewed and no findings. CodeRabbit CLI and GitHub are quota-limited; the GitHub success status says Review rate limited and is not completed review coverage (reset advertised in 39 minutes at 08:17 UTC). CI is terminal: 99 successes including Greptile, 3 conditional skips, 7 neutral checks, and 2 failures (Windows ssh-tunnel-mode plus CI Success). No unresolved review threads. No rerun was made because logs do not establish a transient infrastructure failure. PR is ready for human investigation; workspace and branch retained for the next cycle.

@mergify

mergify Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@skevetter

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@skevetter

Copy link
Copy Markdown
Contributor Author

Current-head review disposition: CodeRabbit completed full coverage of 748f41f with no actionable findings. Its Windows failure note is stale: latest Windows ssh-tunnel-mode job 120922102759 and CI Success 120923558695 passed. Docstring warning: no change, following the refactor skill preference for self-documenting code and sparse comments. Description warning: the body follows the devsy-auto-refactor template; this is an AI-assisted behavior-preserving refactor, no linked issue, focused unit tests and full CI passed, no manual notebook installation was performed. Greptile reviewed the same head at 5/5. No unresolved threads; both commits verified. Local CodeRabbit CLI remained quota-blocked.

@skevetter
skevetter merged commit f5e8f5c into main Oct 25, 2026
206 of 208 checks passed
@skevetter
skevetter deleted the refactor/surface-python-ide-install branch October 25, 2026 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/l surface-refactor Unattended refactor (surface)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant