Skip to content

chore(dogfood): add IDE selection parameter #19194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 80 additions & 8 deletions dogfood/coder/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ locals {
], ["us-pittsburgh"])[0]
}


data "coder_parameter" "region" {
type = "string"
name = "Region"
Expand Down Expand Up @@ -261,6 +260,74 @@ data "coder_workspace_tags" "tags" {
}
}

data "coder_parameter" "ide_choices" {
type = "list(string)"
name = "Select IDEs"
form_type = "multi-select"
mutable = true
description = "Choose one or more IDEs to enable in your workspace"
default = jsonencode(["vscode", "code-server", "cursor"])
option {
name = "VS Code Desktop"
value = "vscode"
icon = "/icon/code.svg"
}
option {
name = "code-server"
value = "code-server"
icon = "/icon/code.svg"
}
option {
name = "VS Code Web"
value = "vscode-web"
icon = "/icon/code.svg"
}
option {
name = "JetBrains IDEs"
value = "jetbrains"
icon = "/icon/jetbrains.svg"
}
option {
name = "JetBrains Fleet"
value = "fleet"
icon = "/icon/fleet.svg"
}
option {
name = "Cursor"
value = "cursor"
icon = "/icon/cursor.svg"
}
option {
name = "Windsurf"
value = "windsurf"
icon = "/icon/windsurf.svg"
}
option {
name = "Zed"
value = "zed"
icon = "/icon/zed.svg"
}
}

data "coder_parameter" "vscode_channel" {
count = contains(jsondecode(data.coder_parameter.ide_choices.value), "vscode") ? data.coder_workspace.me.start_count : 0
type = "string"
name = "VS Code Desktop channel"
description = "Choose the VS Code Desktop channel"
mutable = true
default = "stable"
option {
value = "stable"
name = "Stable"
icon = "/icon/code.svg"
}
option {
value = "insiders"
name = "Insiders"
icon = "/icon/code-insiders.svg"
}
}

module "slackme" {
count = data.coder_workspace.me.start_count
source = "dev.registry.coder.com/coder/slackme/coder"
Expand Down Expand Up @@ -293,7 +360,7 @@ module "personalize" {
}

module "code-server" {
count = data.coder_workspace.me.start_count
count = contains(jsondecode(data.coder_parameter.ide_choices.value), "code-server") ? data.coder_workspace.me.start_count : 0
source = "dev.registry.coder.com/coder/code-server/coder"
version = "1.3.1"
agent_id = coder_agent.dev.id
Expand All @@ -303,7 +370,7 @@ module "code-server" {
}

module "vscode-web" {
count = data.coder_workspace.me.start_count
count = contains(jsondecode(data.coder_parameter.ide_choices.value), "vscode-web") ? data.coder_workspace.me.start_count : 0
source = "dev.registry.coder.com/coder/vscode-web/coder"
version = "1.3.1"
agent_id = coder_agent.dev.id
Expand All @@ -315,7 +382,7 @@ module "vscode-web" {
}

module "jetbrains" {
count = data.coder_workspace.me.start_count
count = contains(jsondecode(data.coder_parameter.ide_choices.value), "jetbrains") ? data.coder_workspace.me.start_count : 0
source = "dev.registry.coder.com/coder/jetbrains/coder"
version = "1.0.0"
agent_id = coder_agent.dev.id
Expand All @@ -340,23 +407,23 @@ module "coder-login" {
}

module "cursor" {
count = data.coder_workspace.me.start_count
count = contains(jsondecode(data.coder_parameter.ide_choices.value), "cursor") ? data.coder_workspace.me.start_count : 0
source = "dev.registry.coder.com/coder/cursor/coder"
version = "1.2.1"
agent_id = coder_agent.dev.id
folder = local.repo_dir
}

module "windsurf" {
count = data.coder_workspace.me.start_count
count = contains(jsondecode(data.coder_parameter.ide_choices.value), "windsurf") ? data.coder_workspace.me.start_count : 0
source = "dev.registry.coder.com/coder/windsurf/coder"
version = "1.1.1"
agent_id = coder_agent.dev.id
folder = local.repo_dir
}

module "zed" {
count = data.coder_workspace.me.start_count
count = contains(jsondecode(data.coder_parameter.ide_choices.value), "zed") ? data.coder_workspace.me.start_count : 0
source = "dev.registry.coder.com/coder/zed/coder"
version = "1.0.1"
agent_id = coder_agent.dev.id
Expand All @@ -365,7 +432,7 @@ module "zed" {
}

module "jetbrains-fleet" {
count = data.coder_workspace.me.start_count
count = contains(jsondecode(data.coder_parameter.ide_choices.value), "fleet") ? data.coder_workspace.me.start_count : 0
source = "registry.coder.com/coder/jetbrains-fleet/coder"
version = "1.0.1"
agent_id = coder_agent.dev.id
Expand All @@ -389,6 +456,11 @@ resource "coder_agent" "dev" {
}
startup_script_behavior = "blocking"

display_apps {
vscode = contains(jsondecode(data.coder_parameter.ide_choices.value), "vscode") && try(data.coder_parameter.vscode_channel[0].value, "stable") == "stable"
vscode_insiders = contains(jsondecode(data.coder_parameter.ide_choices.value), "vscode") && try(data.coder_parameter.vscode_channel[0].value, "stable") == "insiders"
}

# The following metadata blocks are optional. They are used to display
# information about your workspace in the dashboard. You can remove them
# if you don't want to display any information.
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy