Skip to content

Commit 5713bda

Browse files
Merge branch 'main' into cat/copilot-cli
2 parents fe83041 + 056937a commit 5713bda

File tree

4 files changed

+37
-14
lines changed

4 files changed

+37
-14
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
- name: Validate formatting
4949
run: bun fmt:ci
5050
- name: Check for typos
51-
uses: crate-ci/typos@v1.36.3
51+
uses: crate-ci/typos@v1.37.2
5252
with:
5353
config: .github/typos.toml
5454
validate-readme-files:

registry/coder/modules/jetbrains-gateway/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Consult the [JetBrains documentation](https://www.jetbrains.com/help/idea/prereq
1919
module "jetbrains_gateway" {
2020
count = data.coder_workspace.me.start_count
2121
source = "registry.coder.com/coder/jetbrains-gateway/coder"
22-
version = "1.2.3"
22+
version = "1.2.4"
2323
agent_id = coder_agent.example.id
2424
folder = "/home/coder/example"
2525
jetbrains_ides = ["CL", "GO", "IU", "PY", "WS"]
@@ -37,7 +37,7 @@ module "jetbrains_gateway" {
3737
module "jetbrains_gateway" {
3838
count = data.coder_workspace.me.start_count
3939
source = "registry.coder.com/coder/jetbrains-gateway/coder"
40-
version = "1.2.3"
40+
version = "1.2.4"
4141
agent_id = coder_agent.example.id
4242
folder = "/home/coder/example"
4343
jetbrains_ides = ["GO", "WS"]
@@ -51,7 +51,7 @@ module "jetbrains_gateway" {
5151
module "jetbrains_gateway" {
5252
count = data.coder_workspace.me.start_count
5353
source = "registry.coder.com/coder/jetbrains-gateway/coder"
54-
version = "1.2.3"
54+
version = "1.2.4"
5555
agent_id = coder_agent.example.id
5656
folder = "/home/coder/example"
5757
jetbrains_ides = ["IU", "PY"]
@@ -66,7 +66,7 @@ module "jetbrains_gateway" {
6666
module "jetbrains_gateway" {
6767
count = data.coder_workspace.me.start_count
6868
source = "registry.coder.com/coder/jetbrains-gateway/coder"
69-
version = "1.2.3"
69+
version = "1.2.4"
7070
agent_id = coder_agent.example.id
7171
folder = "/home/coder/example"
7272
jetbrains_ides = ["IU", "PY"]
@@ -91,7 +91,7 @@ module "jetbrains_gateway" {
9191
module "jetbrains_gateway" {
9292
count = data.coder_workspace.me.start_count
9393
source = "registry.coder.com/coder/jetbrains-gateway/coder"
94-
version = "1.2.3"
94+
version = "1.2.4"
9595
agent_id = coder_agent.example.id
9696
folder = "/home/coder/example"
9797
jetbrains_ides = ["GO", "WS"]
@@ -109,7 +109,7 @@ Due to the highest priority of the `ide_download_link` parameter in the `(jetbra
109109
module "jetbrains_gateway" {
110110
count = data.coder_workspace.me.start_count
111111
source = "registry.coder.com/coder/jetbrains-gateway/coder"
112-
version = "1.2.3"
112+
version = "1.2.4"
113113
agent_id = coder_agent.example.id
114114
folder = "/home/coder/example"
115115
jetbrains_ides = ["GO", "WS"]

registry/coder/modules/jetbrains-gateway/main.test.ts

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("jetbrains-gateway", async () => {
2020
folder: "/home/coder",
2121
});
2222
expect(state.outputs.url.value).toBe(
23-
"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",
23+
"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=",
2424
);
2525

2626
const coder_app = state.resources.find(
@@ -40,4 +40,28 @@ describe("jetbrains-gateway", async () => {
4040
});
4141
expect(state.outputs.identifier.value).toBe("IU");
4242
});
43+
44+
it("optionally includes agent when an agent name is provided", async () => {
45+
const state = await runTerraformApply(import.meta.dir, {
46+
agent_id: "foo",
47+
agent_name: "main",
48+
folder: "/home/coder",
49+
});
50+
51+
expect(state.outputs.url.value).toBe(
52+
"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",
53+
);
54+
});
55+
56+
it("includes the agent parameter even when the provided value is blank", async () => {
57+
const state = await runTerraformApply(import.meta.dir, {
58+
agent_id: "foo",
59+
agent_name: " ",
60+
folder: "/home/coder",
61+
});
62+
63+
expect(state.outputs.url.value).toBe(
64+
"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= ",
65+
);
66+
});
4367
});

registry/coder/modules/jetbrains-gateway/main.tf

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,14 @@ variable "agent_id" {
3030

3131
variable "slug" {
3232
type = string
33-
description = "The slug for the coder_app. Allows resuing the module with the same template."
33+
description = "The slug for the coder_app. Allows reusing the module with the same template."
3434
default = "gateway"
3535
}
3636

3737
variable "agent_name" {
3838
type = string
39-
description = "Agent name. (unused). Will be removed in a future version"
40-
41-
default = ""
39+
description = "Agent name."
40+
default = ""
4241
}
4342

4443
variable "folder" {
@@ -348,8 +347,8 @@ resource "coder_app" "gateway" {
348347
local.build_number,
349348
"&ide_download_link=",
350349
local.download_link,
351-
"&agent_id=",
352-
var.agent_id,
350+
"&agent=",
351+
var.agent_name,
353352
])
354353
}
355354

0 commit comments

Comments
 (0)