Skip to content

Conversation

blink-so[bot]
Copy link
Contributor

@blink-so blink-so bot commented Aug 20, 2025

Summary

Adds support for opening .code-workspace files directly in the VS Code Web module, resolving the issue where workspace files would open briefly then refresh.

Changes

  • New workspace variable: Allows specifying a path to a .code-workspace file
  • Mutual exclusion validation: Prevents using both folder and workspace parameters simultaneously
  • Enhanced URL generation: Properly constructs VS Code web URLs with ?workspace= parameter
  • Updated run.sh script: Passes workspace files as arguments to code-server serve-local
  • Documentation: Added example usage in README
  • Version bump: Updated to 1.3.2

Usage

module "vscode-web" {
  agent_id       = coder_agent.example.id
  workspace      = "/home/coder/project.code-workspace"
  accept_license = true
}

Technical Details

This implementation leverages VS Code web's native ?workspace= URL parameter support, which properly handles .code-workspace files without the refresh/redirect issues seen with direct file opening attempts.

Testing

  • Terraform formatting applied
  • Lifecycle preconditions validate mutual exclusion
  • Backward compatibility maintained for existing folder parameter
  • Documentation updated with examples

- Add 'workspace' variable to open .code-workspace files
- Add mutual exclusion validation between 'folder' and 'workspace'
- Update run.sh to handle workspace files as arguments to code-server
- Update README with workspace file example
- Bump version to 1.3.2

Fixes workspace file refresh issue by using proper VS Code web URL parameters.
@matifali matifali added the version:minor Add to PRs requiring a minor version upgrade label Aug 20, 2025
Fixes prettier formatting validation failure.
Copy link

❌ Version Bump Validation Failed

Bump Type: minor

Module versions need to be updated but haven't been bumped yet.

Required Actions:

  1. Run the version bump script locally: ./.github/scripts/version-bump.sh minor
  2. Commit the changes: git add . && git commit -m "chore: bump module versions (minor)"
  3. Push the changes: git push

Script Output:

🔍 Detecting modified modules...
Found modules:
registry/coder/modules/vscode-web

📦 Processing: coder/vscode-web
Found git tag: release/coder/vscode-web/v1.3.1 (v1.3.1)
Current version: 1.3.1
New version: 1.4.0
Updating version references for coder/vscode-web in registry/coder/modules/vscode-web/README.md

🔧 Running formatter to ensure consistent formatting...

📋 Summary:
Bump Type: minor

Modules Updated:

- coder/vscode-web: v1.3.1 → v1.4.0

READMEs Updated:

- coder/vscode-web

✅ Version bump completed successfully!
📝 README files have been updated with new versions.

Next steps:
1. Review the changes: git diff
2. Commit the changes: git add . && git commit -m 'chore: bump module versions (minor)'
3. Push the changes: git push

Please update the module versions and push the changes to continue.

blink-so bot added 5 commits August 20, 2025 23:13
…ble error

Fixes test failures by ensuring WORKSPACE_ARG is defined within the function
scope rather than as a global template variable.
Use 14899 to escape shell variables so they're not treated as Terraform
template variables by the templatefile() function.
- Add WORKSPACE_ARG template variable to main.tf using coalesce()
- Remove conditional logic from run.sh since precondition ensures only one is set
- Much cleaner approach that leverages Terraform's template system properly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
version:minor Add to PRs requiring a minor version upgrade
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant