You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(ide): share server install helpers - #1534
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.
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.
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.
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: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
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 checks: 4 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly and concisely describes the main change: sharing IDE server installation helpers through a refactor.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pkg/ide/internal/serverutilwith shared helpers:SuOrSh,UserHome,PrepareLocation,ChownIfNeeded,ReleaseSpec.URL,ExtensionInstall.Why
Each IDE package carried its own copy of the
su/shlauncher, 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:formatmise run cli:lint:ci: 0 issuesgolangci-lint run ./pkg/ide/...withGOOS=darwin,linux,windows. Remaining findings are on lines that already exist on origin/main.CodeRabbit CLI
coderabbit review --agent --committedon 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