Skip to content

refactor(vscode-web): migrate to VS Code CLI with code serve-web - #627

Closed
matifali wants to merge 15 commits into
mainfrom
vscode-web-cli
Closed

matifali wants to merge 15 commits into
mainfrom
vscode-web-cli

Conversation

@matifali

Copy link
Copy Markdown
Collaborator
  • Replace code-server with official VS Code CLI
  • Download CLI from code.visualstudio.com using cli-alpine-* URLs
  • Add release_channel variable (stable/insiders)
  • Add commit_id variable to pin specific VS Code versions
  • Support offline mode with fallback to code-server or cached vscode-server
  • Add comprehensive bun tests for settings, extensions, and CLI arguments
  • Add Terraform tests for variable validation

- Replace code-server with official VS Code CLI
- Download CLI from code.visualstudio.com using cli-alpine-* URLs
- Add release_channel variable (stable/insiders)
- Add commit_id variable to pin specific VS Code versions
- Support offline mode with fallback to code-server or cached vscode-server
- Add comprehensive bun tests for settings, extensions, and CLI arguments
- Add Terraform tests for variable validation
@matifali
matifali requested a review from Copilot December 31, 2025 11:29
@matifali

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the vscode-web module to use the official VS Code CLI instead of code-server, enabling better version control and alignment with official VS Code tooling.

  • Migrates from code-server to official VS Code CLI with code serve-web command
  • Adds release_channel variable to support stable/insiders releases
  • Implements comprehensive offline mode with fallback to code-server or cached vscode-server
  • Adds extensive test coverage with 21 new integration tests

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
main.tf Removes platform variable, adds release_channel and repositions commit_id variable with updated description
run.sh Complete rewrite to download and use VS Code CLI instead of code-server, with offline fallback mechanisms
main.test.ts Adds comprehensive test suite with 21 tests covering script generation, settings management, extension installation, and container integration
vscode-web.tftest.hcl New Terraform validation tests for variable constraints and URL generation
README.md Updates documentation to reflect VS Code CLI usage and new configuration options

matifali and others added 14 commits January 5, 2026 12:18
Separate declaration and assignment for local variable to avoid masking return values.
… settings

- Changed test description to reflect merging behavior of settings.
- Updated Terraform variable description to clarify merging of settings.
- Implemented a new function in the run script to merge settings using jq or Python3.
- Adjusted the settings file creation logic to merge new settings with existing ones.
- Updated README to reflect changes in settings configuration and merging requirements.
…installed after server starts

- Added a sleep command to allow the VS Code Web server to start before installing extensions.
- Modified the script to run the VS Code Web CLI first, followed by the installation of extensions.
…ensions

- Added a function to wait for the VS Code Web server to be ready before proceeding with the installation of extensions.
- Replaced sleep commands with a conditional wait to ensure extensions are only installed after the server is confirmed to be running.
@matifali matifali closed this Mar 2, 2026
Edd88-pixel added a commit that referenced this pull request Nov 20, 2026
## Why

The current `serve-local` launcher leaves browser extension secrets in
memory, causing authentication sessions to disappear after reload
(#584). The official `code serve-web` launcher provides encrypted
browser storage backed by a persistent server key.

## Changes

- Add `use_cli = true` while keeping the existing launcher as the
default.
- Reuse the existing settings and extension installation logic, with
`coder-utils` handling installation and startup ordering.
- Persist the CLI key and cache under the module directory and require
an isolated application subdomain.
- Use `platform` to select the server archive and pass `disable_trust`
and `extensions_dir` to the server launched by `code serve-web`. All
three options work together.
- Add regression tests and a browser probe for secret storage and the
built-in GitHub/Microsoft authentication providers. Both sign-in flows
were verified with end-to-end (E2E) tests behind Coder, including
browser reload and workspace restart.

## Type of Change

- [x] Bug fix
- [x] Feature/enhancement
- [x] Documentation

## Module Information

**Path:** `registry/coder/modules/vscode-web`
**New version:** `v2.0.0`
**Breaking change:** Yes — requires Coder provider 2.13+ in both launch
modes and Terraform 1.2+. The default launcher remains unchanged.

## Related Issues

Related to #584 and follows the investigation in #627. Persistent
browser secrets require explicitly enabling CLI mode.
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.

3 participants