coder / modules

A collection of Terraform Modules to extend Coder templates.
https://registry.coder.com
Apache License 2.0
33 stars 33 forks source link

VS code now give error when reinstalling an extension #317

Closed Flowrome closed 1 month ago

Flowrome commented 1 month ago

VS code web module that depends directly on the latest vscode build now returns an error when an extension is already installed even if using --force flag

input: code --install-extension "johnpapa.Angular2" --force
output: Installing extensions...
output: Extension 'johnpapa.angular2' is already installed.

This shouldn't be a blocking condition but this run.sh won't make the vscode module start.

my suggestion here is to remove that exit 1 if the error contains "is already installed"

We're currently blocked by this, any possibility to add a for of that module while we wait for an official fix?

matifali commented 1 month ago

Maybe we should allow pinning the version to prevent such issues with upstream breaking changes.

Flowrome commented 1 month ago

Maybe we should allow pinning the version to prevent such issues with upstream breaking changes.

That also could be an awesome idea

matifali commented 1 month ago

Hi @Flowrome, could you test the new changes with,

module "vscode-web" {
  source         = "git::https://github.com/coder/modules.git//vscode-web?ref=atif/vscode-web-exit"
  agent_id       = coder_agent.example.id # replace example with your coder_agent name
  extensions     = ["github.copilot", "ms-python.python", "ms-toolsai.jupyter"]
  accept_license = true
}

Let me know if it works. I can do the version pinning in a separate PR.

Flowrome commented 1 month ago

Hi @Flowrome, could you test the new changes with,

module "vscode-web" { source = "git::https://github.com/coder/modules.git//vscode-web?atif/vscode-web-exit" agent_id = coder_agent.example.id # replace example with your coder_agent name extensions = ["github.copilot", "ms-python.python", "ms-toolsai.jupyter"] accept_license = true }

Let me know if it works. I can do the version pinning in a separate PR.

As soon i'm back i'll test it many thanks!

EDIT:

I'm so sorry for my lack of experience but even with setting the private git module implementation it doesn't let me put this as source in the module config, do you have any ideas? @matifali

matifali commented 1 month ago

Sorry, @Flowrome, I had a typo. I have edited the source link. I forgot to type ref= before the branch name.