Skip to content
Merged
Show file tree
Hide file tree
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
36 changes: 30 additions & 6 deletions registry/coder/modules/jetbrains/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ This module adds JetBrains IDE buttons to launch IDEs directly from the dashboar
module "jetbrains" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/jetbrains/coder"
version = "1.0.3"
version = "1.1.0"
agent_id = coder_agent.example.id
folder = "/home/coder/project"
# tooltip = "You need to [Install Coder Desktop](https://coder.com/docs/user-guides/desktop#install-coder-desktop) to use this button." # Optional
}
```

Expand All @@ -39,7 +40,7 @@ When `default` contains IDE codes, those IDEs are created directly without user
module "jetbrains" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/jetbrains/coder"
version = "1.0.3"
version = "1.1.0"
agent_id = coder_agent.example.id
folder = "/home/coder/project"
default = ["PY", "IU"] # Pre-configure GoLand and IntelliJ IDEA
Expand All @@ -52,7 +53,7 @@ module "jetbrains" {
module "jetbrains" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/jetbrains/coder"
version = "1.0.3"
version = "1.1.0"
agent_id = coder_agent.example.id
folder = "/home/coder/project"
# Show parameter with limited options
Expand All @@ -66,7 +67,7 @@ module "jetbrains" {
module "jetbrains" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/jetbrains/coder"
version = "1.0.3"
version = "1.1.0"
agent_id = coder_agent.example.id
folder = "/home/coder/project"
default = ["IU", "PY"]
Expand All @@ -81,7 +82,7 @@ module "jetbrains" {
module "jetbrains" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/jetbrains/coder"
version = "1.0.3"
version = "1.1.0"
agent_id = coder_agent.example.id
folder = "/workspace/project"

Expand All @@ -107,7 +108,7 @@ module "jetbrains" {
module "jetbrains_pycharm" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/jetbrains/coder"
version = "1.0.3"
version = "1.1.0"
agent_id = coder_agent.example.id
folder = "/workspace/project"

Expand All @@ -119,6 +120,22 @@ module "jetbrains_pycharm" {
}
```

### Custom Tooltip

Add helpful tooltip text that appears when users hover over the IDE app buttons:

```tf
module "jetbrains" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/jetbrains/coder"
version = "1.1.0"
agent_id = coder_agent.example.id
folder = "/home/coder/project"
default = ["IU", "PY"]
tooltip = "You need to [Install Coder Desktop](https://coder.com/docs/user-guides/desktop#install-coder-desktop) to use this button."
}
```

## Behavior

### Parameter vs Direct Apps
Expand All @@ -132,6 +149,13 @@ module "jetbrains_pycharm" {
- If the API is unreachable (air-gapped environments), the module automatically falls back to build numbers from `ide_config`
- `major_version` and `channel` control which API endpoint is queried (when API access is available)

### Tooltip

- **`tooltip`**: Optional markdown text displayed when hovering over IDE app buttons
- If not specified, no tooltip is shown
- Supports markdown formatting for rich text (bold, italic, links, etc.)
- All IDE apps created by this module will show the same tooltip text

## Supported IDEs

All JetBrains IDEs with remote development capabilities:
Expand Down
31 changes: 31 additions & 0 deletions registry/coder/modules/jetbrains/jetbrains.tftest.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,34 @@ run "app_order_when_default_not_empty" {
error_message = "Expected coder_app order to be set to 10"
}
}

run "tooltip_when_provided" {
command = plan

variables {
agent_id = "foo"
folder = "/home/coder"
default = ["GO"]
tooltip = "You need to [Install Coder Desktop](https://coder.com/docs/user-guides/desktop#install-coder-desktop) to use this button."
}

assert {
condition = anytrue([for app in values(resource.coder_app.jetbrains) : app.tooltip == "You need to [Install Coder Desktop](https://coder.com/docs/user-guides/desktop#install-coder-desktop) to use this button."])
error_message = "Expected coder_app tooltip to be set when provided"
}
}

run "tooltip_null_when_not_provided" {
command = plan

variables {
agent_id = "foo"
folder = "/home/coder"
default = ["GO"]
}

assert {
condition = anytrue([for app in values(resource.coder_app.jetbrains) : app.tooltip == null])
error_message = "Expected coder_app tooltip to be null when not provided"
}
}
30 changes: 30 additions & 0 deletions registry/coder/modules/jetbrains/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,36 @@ describe("jetbrains", async () => {
);
expect(parameter?.instances[0].attributes.order).toBe(5);
});

it("should set tooltip when specified", async () => {
const state = await runTerraformApply(import.meta.dir, {
agent_id: "foo",
folder: "/home/coder",
default: '["GO"]',
tooltip:
"You need to [Install Coder Desktop](https://coder.com/docs/user-guides/desktop#install-coder-desktop) to use this button.",
});

const coder_app = state.resources.find(
(res) => res.type === "coder_app" && res.name === "jetbrains",
);
expect(coder_app?.instances[0].attributes.tooltip).toBe(
"You need to [Install Coder Desktop](https://coder.com/docs/user-guides/desktop#install-coder-desktop) to use this button.",
);
});

it("should have null tooltip when not specified", async () => {
const state = await runTerraformApply(import.meta.dir, {
agent_id: "foo",
folder: "/home/coder",
default: '["GO"]',
});

const coder_app = state.resources.find(
(res) => res.type === "coder_app" && res.name === "jetbrains",
);
expect(coder_app?.instances[0].attributes.tooltip).toBeNull();
});
});

// URL Generation Tests
Expand Down
7 changes: 7 additions & 0 deletions registry/coder/modules/jetbrains/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ variable "coder_parameter_order" {
default = null
}

variable "tooltip" {
type = string
description = "Markdown text that is displayed when hovering over workspace apps."
default = null
}

variable "major_version" {
type = string
description = "The major version of the IDE. i.e. 2025.1"
Expand Down Expand Up @@ -232,6 +238,7 @@ resource "coder_app" "jetbrains" {
external = true
order = var.coder_app_order
group = var.group
tooltip = var.tooltip
url = join("", [
"jetbrains://gateway/coder?&workspace=", # requires 2.6.3+ version of Toolbox
data.coder_workspace.me.name,
Expand Down