Skip to content

refactor(ide): share server install helpers - #1534

Merged
skevetter merged 1 commit into
mainfrom
refactor/ide-share-server-install-helpers
Oct 17, 2026
Merged

skevetter merged 1 commit into
mainfrom
refactor/ide-share-server-install-helpers

Conversation

@skevetter

@skevetter skevetter commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add pkg/ide/internal/serverutil with shared helpers: SuOrSh, UserHome, PrepareLocation, ChownIfNeeded, ReleaseSpec.URL, ExtensionInstall.
  • Migrate codeserver, vscodeweb, openvscode, fleet, and jetbrains to these helpers and delete their local copies.
  • Command strings, log lines, error text, chown scopes, and URL templates are unchanged; per-IDE differences are parameters.
  • Add testify suite for the new helpers.

Why

Each IDE package carried its own copy of the su/sh launcher, home lookup, extension install loop, and per-arch URL selection. Keeping them in one place removes duplicated logic and keeps the escalation rule (total extension failure) explicit per IDE.

Validation

  • go build ./...
  • GOOS=darwin|linux|windows go vet ./pkg/ide/...
  • go test ./pkg/ide/...
  • mise run cli:format
  • mise run cli:lint:ci: 0 issues
  • golangci-lint run ./pkg/ide/... with GOOS=darwin, linux, windows. Remaining findings are on lines that already exist on origin/main.

CodeRabbit CLI

coderabbit review --agent --committed on the commit: 0 findings.

Auto-merge

Eligible: behaviour-preserving, 7 files and about 499 changed lines excluding the new test file, no go.mod, workflow, .golangci, or secret changes, no lint disabled, no tests removed. Not merged; left as draft for review.

Summary by CodeRabbit

  • Bug Fixes
    • IDE server downloads now select release URLs based on the system architecture and configured download settings, helping ensure the appropriate release is used for installation.
  • Improvements
    • IDE server setup and extension installation now use consistent handling across supported IDEs. Individual extension installation failures are tolerated; an error is reported if all requested extensions fail.

@skevetter skevetter added the auto-refactor Automated refactor PR label Oct 17, 2026
@netlify

netlify Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit 4d40f71
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6ad3f46f38279187d45aed43

@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6a85e22d-619c-40e4-83c2-ca080c023832
📥 Commits

Reviewing files that changed from the base of the PR and between 84c1453 and 4d40f71.

📒 Files selected for processing: 7
  • pkg/ide/codeserver/codeserver.go
  • pkg/ide/fleet/fleet.go
  • pkg/ide/internal/serverutil/serverutil.go
  • pkg/ide/internal/serverutil/serverutil_test.go
  • pkg/ide/jetbrains/generic.go
  • pkg/ide/openvscode/openvscode.go
  • pkg/ide/vscodeweb/vscodeweb.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

Shared utilities now handle common IDE server operations. Code-server, Fleet, JetBrains, OpenVSCode, and VS Code Web use the shared helpers for selected user, location, ownership, command, release URL, and extension-install operations.

Changes: IDE server utility reuse

Layer / File(s) Summary
Shared utility behavior
pkg/ide/internal/serverutil/*
Adds helpers for user-home lookup, command construction, location preparation, ownership changes, release URL selection, and extension installation. Tests cover these helpers and their outcomes.
User and location operations
pkg/ide/codeserver/codeserver.go, pkg/ide/fleet/fleet.go, pkg/ide/jetbrains/generic.go, pkg/ide/openvscode/openvscode.go, pkg/ide/vscodeweb/vscodeweb.go
These packages delegate user-home lookup, command construction, location preparation, and ownership handling to serverutil.
Release URLs and extension installation
pkg/ide/codeserver/codeserver.go, pkg/ide/openvscode/openvscode.go, pkg/ide/vscodeweb/vscodeweb.go
These packages use ReleaseSpec for architecture-based URL selection and ExtensionInstall for extension processing. Code-server and VS Code Web require an error when all requested extensions fail.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Refactor

Merge Risk: ⚪ Minimal · up to 4d40f

This refactor moves shared IDE server install helpers into one package without intended behavior changes. No concrete merge-blocking issue was found, and the author reports that build, tests, vet and lint pass.

Security architecture risk: ⚪ Minimal · up to 4d40f

The refactor preserves existing user selection, command execution, ownership scopes, download selection and extension-failure policies. No new privilege increase or externally reachable operation was identified in the compared changes.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — A future defect in the common execution or ownership mechanics could propagate across the three browser IDE integrations. The current extraction does not demonstrate broader tenant, service or environment authority: callers retain their existing identities and targets, while Fleet and JetBrains consume narrower operations.

Security Findings and Attack Paths

  • observed — Configured extension names still flow through IDE-specific shell-command builders into su or sh. The command templates and selected identities match the base behavior; centralization adds no input validation, but comparison does not establish newly introduced or worsened shell exposure. This is an inherited execution boundary, not a verified vulnerability finding.

Resilience and Maintainability Implications

  • inferred — The extraction preserves the existing non-transactional recovery model. Directory creation remains repeatable, ownership remains a separate operation, and interrupted or partially successful extension installation can leave work for a later retry without rollback. No new reservation, persistent marker, synchronization or cleanup obligation is introduced by the shared helper; this does not establish that concurrent callers are safe.
Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 70.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 7 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: sharing IDE server installation helpers through a refactor.
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.
  • Fix all pre-merge checks with AI
✨ 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 17, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for images-devsy-sh canceled.

Name Link
🔨 Latest commit 4d40f71
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6ad3f46f837e36348fbc55f7

@skevetter
skevetter marked this pull request as ready for review October 17, 2026 23:03
@mergify

mergify Bot commented Oct 17, 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
skevetter merged commit e0fe773 into main Oct 17, 2026
111 checks passed
@skevetter
skevetter deleted the refactor/ide-share-server-install-helpers branch October 17, 2026 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-refactor Automated refactor PR size/xl

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant