From 2de6a57a3f06381e490612073a77621f98abee04 Mon Sep 17 00:00:00 2001 From: Susana Ferreira Date: Thu, 2 Oct 2025 00:21:54 +0100 Subject: [PATCH 1/3] fix: claude-code api_key terraform test (#444) ## Description Fix claude-code module `test_claude_code_with_api_key` terraform test. --- registry/coder/modules/claude-code/main.tftest.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registry/coder/modules/claude-code/main.tftest.hcl b/registry/coder/modules/claude-code/main.tftest.hcl index 7931cca8..c48923cf 100644 --- a/registry/coder/modules/claude-code/main.tftest.hcl +++ b/registry/coder/modules/claude-code/main.tftest.hcl @@ -42,7 +42,7 @@ run "test_claude_code_with_api_key" { } assert { - condition = coder_env.claude_api_key.value == "test-api-key-123" + condition = coder_env.claude_api_key[0].value == "test-api-key-123" error_message = "Claude API key value should match the input" } } From af8b4f02fd27dcfcf26fee50c4541995b230790b Mon Sep 17 00:00:00 2001 From: Rowan Smith Date: Mon, 6 Oct 2025 08:29:33 +1100 Subject: [PATCH 2/3] chore: fix for jetbrains gateway agent_id issue (#437) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Fixes a regression added in #167 which implemented support for multiple agents by appending the agent id to the URI, however in a single agent environment it results in the agent id from the template apply (on upload to Coder from client) being injected, and when a workspace is later built using the template the agent id is no longer correct. Resolves the error `The workspace “” does not have an agent with ID “”` being thrown by Jetbrains Gateway app upon attempting to open a Jetbrains app from within a Coder workspace. When wishing to target a specific Coder Agent with the Jetbrains Gateway module one should use the `agent_name` variable in the module configuration to specify the desired agent name. This will append the agent name to the URI. ## Type of Change - [ ] New module - [x] Bug fix - [ ] Feature/enhancement - [ ] Documentation - [ ] Other ## Module Information **Path:** `registry/coder/modules/jetbrains-gateway` **New version:** `v1.2.4` **Breaking change:** [ ] Yes [x] No ## Testing & Validation - [x] Tests pass (`bun test`) - [x] Code formatted (`bun run fmt`) - [x] Changes tested locally ## Related Issues Reported by customer on Zendesk ticket 4391 --- .../coder/modules/jetbrains-gateway/README.md | 12 ++++----- .../modules/jetbrains-gateway/main.test.ts | 26 ++++++++++++++++++- .../coder/modules/jetbrains-gateway/main.tf | 9 +++---- 3 files changed, 35 insertions(+), 12 deletions(-) diff --git a/registry/coder/modules/jetbrains-gateway/README.md b/registry/coder/modules/jetbrains-gateway/README.md index 51b9a1ef..8cfe3b5e 100644 --- a/registry/coder/modules/jetbrains-gateway/README.md +++ b/registry/coder/modules/jetbrains-gateway/README.md @@ -19,7 +19,7 @@ Consult the [JetBrains documentation](https://www.jetbrains.com/help/idea/prereq module "jetbrains_gateway" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/jetbrains-gateway/coder" - version = "1.2.3" + version = "1.2.4" agent_id = coder_agent.example.id folder = "/home/coder/example" jetbrains_ides = ["CL", "GO", "IU", "PY", "WS"] @@ -37,7 +37,7 @@ module "jetbrains_gateway" { module "jetbrains_gateway" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/jetbrains-gateway/coder" - version = "1.2.3" + version = "1.2.4" agent_id = coder_agent.example.id folder = "/home/coder/example" jetbrains_ides = ["GO", "WS"] @@ -51,7 +51,7 @@ module "jetbrains_gateway" { module "jetbrains_gateway" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/jetbrains-gateway/coder" - version = "1.2.3" + version = "1.2.4" agent_id = coder_agent.example.id folder = "/home/coder/example" jetbrains_ides = ["IU", "PY"] @@ -66,7 +66,7 @@ module "jetbrains_gateway" { module "jetbrains_gateway" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/jetbrains-gateway/coder" - version = "1.2.3" + version = "1.2.4" agent_id = coder_agent.example.id folder = "/home/coder/example" jetbrains_ides = ["IU", "PY"] @@ -91,7 +91,7 @@ module "jetbrains_gateway" { module "jetbrains_gateway" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/jetbrains-gateway/coder" - version = "1.2.3" + version = "1.2.4" agent_id = coder_agent.example.id folder = "/home/coder/example" jetbrains_ides = ["GO", "WS"] @@ -109,7 +109,7 @@ Due to the highest priority of the `ide_download_link` parameter in the `(jetbra module "jetbrains_gateway" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/jetbrains-gateway/coder" - version = "1.2.3" + version = "1.2.4" agent_id = coder_agent.example.id folder = "/home/coder/example" jetbrains_ides = ["GO", "WS"] diff --git a/registry/coder/modules/jetbrains-gateway/main.test.ts b/registry/coder/modules/jetbrains-gateway/main.test.ts index 51802fab..74a02a12 100644 --- a/registry/coder/modules/jetbrains-gateway/main.test.ts +++ b/registry/coder/modules/jetbrains-gateway/main.test.ts @@ -20,7 +20,7 @@ describe("jetbrains-gateway", async () => { folder: "/home/coder", }); expect(state.outputs.url.value).toBe( - "jetbrains-gateway://connect#type=coder&workspace=default&owner=default&folder=/home/coder&url=https://mydeployment.coder.com&token=$SESSION_TOKEN&ide_product_code=IU&ide_build_number=243.21565.193&ide_download_link=https://download.jetbrains.com/idea/ideaIU-2024.3.tar.gz&agent_id=foo", + "jetbrains-gateway://connect#type=coder&workspace=default&owner=default&folder=/home/coder&url=https://mydeployment.coder.com&token=$SESSION_TOKEN&ide_product_code=IU&ide_build_number=243.21565.193&ide_download_link=https://download.jetbrains.com/idea/ideaIU-2024.3.tar.gz&agent=", ); const coder_app = state.resources.find( @@ -40,4 +40,28 @@ describe("jetbrains-gateway", async () => { }); expect(state.outputs.identifier.value).toBe("IU"); }); + + it("optionally includes agent when an agent name is provided", async () => { + const state = await runTerraformApply(import.meta.dir, { + agent_id: "foo", + agent_name: "main", + folder: "/home/coder", + }); + + expect(state.outputs.url.value).toBe( + "jetbrains-gateway://connect#type=coder&workspace=default&owner=default&folder=/home/coder&url=https://mydeployment.coder.com&token=$SESSION_TOKEN&ide_product_code=IU&ide_build_number=243.21565.193&ide_download_link=https://download.jetbrains.com/idea/ideaIU-2024.3.tar.gz&agent=main", + ); + }); + + it("includes the agent parameter even when the provided value is blank", async () => { + const state = await runTerraformApply(import.meta.dir, { + agent_id: "foo", + agent_name: " ", + folder: "/home/coder", + }); + + expect(state.outputs.url.value).toBe( + "jetbrains-gateway://connect#type=coder&workspace=default&owner=default&folder=/home/coder&url=https://mydeployment.coder.com&token=$SESSION_TOKEN&ide_product_code=IU&ide_build_number=243.21565.193&ide_download_link=https://download.jetbrains.com/idea/ideaIU-2024.3.tar.gz&agent= ", + ); + }); }); diff --git a/registry/coder/modules/jetbrains-gateway/main.tf b/registry/coder/modules/jetbrains-gateway/main.tf index eda5dcc8..64940b9e 100644 --- a/registry/coder/modules/jetbrains-gateway/main.tf +++ b/registry/coder/modules/jetbrains-gateway/main.tf @@ -36,9 +36,8 @@ variable "slug" { variable "agent_name" { type = string - description = "Agent name. (unused). Will be removed in a future version" - - default = "" + description = "Agent name." + default = "" } variable "folder" { @@ -348,8 +347,8 @@ resource "coder_app" "gateway" { local.build_number, "&ide_download_link=", local.download_link, - "&agent_id=", - var.agent_id, + "&agent=", + var.agent_name, ]) } From 056937a758d37b83caee375a713aaae3e937c417 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 07:59:23 -0500 Subject: [PATCH 3/3] chore(deps): bump crate-ci/typos from 1.36.3 to 1.37.2 in the github-actions group (#451) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: M Atif Ali --- .github/workflows/ci.yaml | 2 +- registry/coder/modules/jetbrains-gateway/main.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 39eb0197..7e14213c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -48,7 +48,7 @@ jobs: - name: Validate formatting run: bun fmt:ci - name: Check for typos - uses: crate-ci/typos@v1.36.3 + uses: crate-ci/typos@v1.37.2 with: config: .github/typos.toml validate-readme-files: diff --git a/registry/coder/modules/jetbrains-gateway/main.tf b/registry/coder/modules/jetbrains-gateway/main.tf index 64940b9e..f837825e 100644 --- a/registry/coder/modules/jetbrains-gateway/main.tf +++ b/registry/coder/modules/jetbrains-gateway/main.tf @@ -30,7 +30,7 @@ variable "agent_id" { variable "slug" { type = string - description = "The slug for the coder_app. Allows resuing the module with the same template." + description = "The slug for the coder_app. Allows reusing the module with the same template." default = "gateway" }