From 80f429faf10a4e31ba3ab8849c439e96e221c7d0 Mon Sep 17 00:00:00 2001 From: DevCats Date: Tue, 30 Sep 2025 07:44:41 -0500 Subject: [PATCH 1/7] chore: remove it wrappers from required variables tests (#442) ## Description Remove it wrappers from required variables tf test in jfrog-oauth and jfrog-token modules. This solves the failing tf tests that we were encountering in all PR's across the board. ## Type of Change - [ ] New module - [X] Bug fix - [ ] Feature/enhancement - [ ] Documentation - [ ] Other ## Testing & Validation - [X] Tests pass (`bun test`) - [X] Code formatted (`bun run fmt`) - [X] Changes tested locally ## Related Issues --- registry/coder/modules/jfrog-oauth/main.test.ts | 10 ++++------ registry/coder/modules/jfrog-token/main.test.ts | 12 +++++------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/registry/coder/modules/jfrog-oauth/main.test.ts b/registry/coder/modules/jfrog-oauth/main.test.ts index 0a8e62c0..940d166b 100644 --- a/registry/coder/modules/jfrog-oauth/main.test.ts +++ b/registry/coder/modules/jfrog-oauth/main.test.ts @@ -24,12 +24,10 @@ describe("jfrog-oauth", async () => { const fakeFrogUrl = "http://localhost:8081"; const user = "default"; - it("can run apply with required variables", async () => { - testRequiredVariables(import.meta.dir, { - agent_id: "some-agent-id", - jfrog_url: fakeFrogUrl, - package_managers: "{}", - }); + testRequiredVariables(import.meta.dir, { + agent_id: "some-agent-id", + jfrog_url: fakeFrogUrl, + package_managers: "{}", }); it("generates an npmrc with scoped repos", async () => { diff --git a/registry/coder/modules/jfrog-token/main.test.ts b/registry/coder/modules/jfrog-token/main.test.ts index 9e3097b0..419b5f28 100644 --- a/registry/coder/modules/jfrog-token/main.test.ts +++ b/registry/coder/modules/jfrog-token/main.test.ts @@ -55,13 +55,11 @@ describe("jfrog-token", async () => { const user = "default"; const token = "xxx"; - it("can run apply with required variables", async () => { - testRequiredVariables(import.meta.dir, { - agent_id: "some-agent-id", - jfrog_url: fakeFrogUrl, - artifactory_access_token: "XXXX", - package_managers: "{}", - }); + testRequiredVariables(import.meta.dir, { + agent_id: "some-agent-id", + jfrog_url: fakeFrogUrl, + artifactory_access_token: "XXXX", + package_managers: "{}", }); it("generates an npmrc with scoped repos", async () => { From 80acbd7e3a95290fe1ebb562b6675d1f08a074c9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Sep 2025 12:53:03 +0000 Subject: [PATCH 2/7] chore(deps): bump crate-ci/typos from 1.36.2 to 1.36.3 in the github-actions group (#438) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1bdc5f68..39eb0197 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.2 + uses: crate-ci/typos@v1.36.3 with: config: .github/typos.toml validate-readme-files: From 44354b202dc76988462bb508cad4433d432171df Mon Sep 17 00:00:00 2001 From: Atif Ali Date: Tue, 30 Sep 2025 18:02:35 +0500 Subject: [PATCH 3/7] Fix claude-code module not passing workdir to agentapi (#439) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Fixes #436 - The claude-code 3.0.0 module was not passing the custom `workdir` variable to the agentapi module, causing it to default to `/home/coder` instead of using the specified working directory. ## Changes - Added missing `folder = local.workdir` parameter to the agentapi module call in `main.tf:247` - This ensures that custom working directories are properly propagated to the agentapi module ## Test Plan - [x] Terraform validation passes - [x] Code formatting applied with `bun run fmt` - [x] Basic terraform test passes (one pre-existing test failure unrelated to this change) ## Verification The fix adds the missing parameter that was identified in the issue: ```terraform module "agentapi" { # ... other parameters folder = local.workdir # <- Added this line # ... rest of configuration } ``` 🤖 Generated with [Claude Code](https://claude.ai/code) --------- Co-authored-by: DevCats --- registry/coder/modules/claude-code/README.md | 8 ++++---- registry/coder/modules/claude-code/main.tf | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/registry/coder/modules/claude-code/README.md b/registry/coder/modules/claude-code/README.md index 04d8f8c8..3c334e74 100644 --- a/registry/coder/modules/claude-code/README.md +++ b/registry/coder/modules/claude-code/README.md @@ -13,7 +13,7 @@ Run the [Claude Code](https://docs.anthropic.com/en/docs/agents-and-tools/claude ```tf module "claude-code" { source = "registry.coder.com/coder/claude-code/coder" - version = "3.0.0" + version = "3.0.1" agent_id = coder_agent.example.id workdir = "/home/coder/project" claude_api_key = "xxxx-xxxxx-xxxx" @@ -49,7 +49,7 @@ data "coder_parameter" "ai_prompt" { module "claude-code" { source = "registry.coder.com/coder/claude-code/coder" - version = "3.0.0" + version = "3.0.1" agent_id = coder_agent.example.id workdir = "/home/coder/project" @@ -85,7 +85,7 @@ Run and configure Claude Code as a standalone CLI in your workspace. ```tf module "claude-code" { source = "registry.coder.com/coder/claude-code/coder" - version = "3.0.0" + version = "3.0.1" agent_id = coder_agent.example.id workdir = "/home/coder" install_claude_code = true @@ -108,7 +108,7 @@ variable "claude_code_oauth_token" { module "claude-code" { source = "registry.coder.com/coder/claude-code/coder" - version = "3.0.0" + version = "3.0.1" agent_id = coder_agent.example.id workdir = "/home/coder/project" claude_code_oauth_token = var.claude_code_oauth_token diff --git a/registry/coder/modules/claude-code/main.tf b/registry/coder/modules/claude-code/main.tf index d391e479..4836347b 100644 --- a/registry/coder/modules/claude-code/main.tf +++ b/registry/coder/modules/claude-code/main.tf @@ -244,6 +244,7 @@ module "agentapi" { web_app_group = var.group web_app_icon = var.icon web_app_display_name = var.web_app_display_name + folder = local.workdir cli_app = var.cli_app cli_app_slug = var.cli_app ? "${local.app_slug}-cli" : null cli_app_display_name = var.cli_app ? var.cli_app_display_name : null From 60fec19d7d42ebbe853b78bb4649a4e10fbe3f56 Mon Sep 17 00:00:00 2001 From: Jiachen Jiang Date: Tue, 30 Sep 2025 09:14:16 -0700 Subject: [PATCH 4/7] Update README.md (#440) Added recommendation to the Gateway README, pointing to the Toolbox module. --------- Co-authored-by: DevCats --- registry/coder/modules/jetbrains-gateway/README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/registry/coder/modules/jetbrains-gateway/README.md b/registry/coder/modules/jetbrains-gateway/README.md index 7caa6dad..51b9a1ef 100644 --- a/registry/coder/modules/jetbrains-gateway/README.md +++ b/registry/coder/modules/jetbrains-gateway/README.md @@ -10,6 +10,8 @@ tags: [ide, jetbrains, parameter, gateway] This module adds a JetBrains Gateway Button to open any workspace with a single click. +> We recommend using the [Coder Toolbox module](https://registry.coder.com/modules/coder/jetbrains), which offers significant stability and connectivity benefits over Gateway. Reference our [documentation](https://coder.com/docs/user-guides/workspace-access/jetbrains/toolbox) for more information. + JetBrains recommends a minimum of 4 CPU cores and 8GB of RAM. Consult the [JetBrains documentation](https://www.jetbrains.com/help/idea/prerequisites.html#min_requirements) to confirm other system requirements. @@ -17,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.2" + version = "1.2.3" agent_id = coder_agent.example.id folder = "/home/coder/example" jetbrains_ides = ["CL", "GO", "IU", "PY", "WS"] @@ -35,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.2" + version = "1.2.3" agent_id = coder_agent.example.id folder = "/home/coder/example" jetbrains_ides = ["GO", "WS"] @@ -49,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.2" + version = "1.2.3" agent_id = coder_agent.example.id folder = "/home/coder/example" jetbrains_ides = ["IU", "PY"] @@ -64,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.2" + version = "1.2.3" agent_id = coder_agent.example.id folder = "/home/coder/example" jetbrains_ides = ["IU", "PY"] @@ -89,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.2" + version = "1.2.3" agent_id = coder_agent.example.id folder = "/home/coder/example" jetbrains_ides = ["GO", "WS"] @@ -107,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.2" + version = "1.2.3" agent_id = coder_agent.example.id folder = "/home/coder/example" jetbrains_ides = ["GO", "WS"] From 2de6a57a3f06381e490612073a77621f98abee04 Mon Sep 17 00:00:00 2001 From: Susana Ferreira Date: Thu, 2 Oct 2025 00:21:54 +0100 Subject: [PATCH 5/7] 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 6/7] 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 7/7] 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" }