From 27e3faf31cde4ae28fbf55dbbac0babb0e3ab264 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Thu, 14 Nov 2024 11:30:00 +0500 Subject: [PATCH 1/8] feat: enable multiple IDE buttons in JetBrains Add support for specifying a list of default IDEs to be displayed on the Workspace page. This allows users to see multiple IDE options simultaneously. Ensure no duplicates are included and validate provided IDE codes against allowed set. Adjust logic to dynamically render IDE buttons based on specified defaults, improving flexibility in user interface setup. --- jetbrains-gateway/main.tf | 71 +++++++++++++++++++++++++++------------ 1 file changed, 50 insertions(+), 21 deletions(-) diff --git a/jetbrains-gateway/main.tf b/jetbrains-gateway/main.tf index 24bf4768..8fa67f2a 100644 --- a/jetbrains-gateway/main.tf +++ b/jetbrains-gateway/main.tf @@ -44,6 +44,26 @@ variable "default" { description = "Default IDE" } +variable "defaults" { + default = [] + type = list(string) + description = "List of default IDEs to be added to the Workspace page. Conflicts with the default variable." + # check if the list is unique + validation { + condition = length(var.defaults) == length(toset(var.defaults)) + error_message = "The defaults must not contain duplicates." + } + # check if defaults are valid jetbrains_ides + validation { + condition = ( + alltrue([ + for code in var.defaults : contains(["IU", "PS", "WS", "PY", "CL", "GO", "RM", "RD"], code) + ]) + ) + error_message = "The defaults must be a list of valid product codes. Valid product codes are ${join(",", ["IU", "PS", "WS", "PY", "CL", "GO", "RM", "RD"])}." + } +} + variable "order" { type = number description = "The order determines the position of app in the UI presentation. The lowest order is shown first and apps with equal order are sorted by name (ascending order)." @@ -124,7 +144,7 @@ variable "jetbrains_ide_versions" { variable "jetbrains_ides" { type = list(string) - description = "The list of IDE product codes." + description = "The list of IDE product codes to be shown to the user. Does not apply when defaults are used." default = ["IU", "PS", "WS", "PY", "CL", "GO", "RM", "RD"] validation { condition = ( @@ -239,17 +259,18 @@ locals { } } - icon = local.jetbrains_ides[data.coder_parameter.jetbrains_ide.value].icon - json_data = var.latest ? jsondecode(data.http.jetbrains_ide_versions[data.coder_parameter.jetbrains_ide.value].response_body) : {} + icon = local.jetbrains_ides[try(data.coder_parameter.jetbrains_ide[0].value, var.defaults[0])].icon + json_data = var.latest ? jsondecode(data.http.jetbrains_ide_versions[try(data.coder_parameter.jetbrains_ide[0].value, var.defaults[0])].response_body) : {} key = var.latest ? keys(local.json_data)[0] : "" - display_name = local.jetbrains_ides[data.coder_parameter.jetbrains_ide.value].name - identifier = data.coder_parameter.jetbrains_ide.value - download_link = var.latest ? local.json_data[local.key][0].downloads.linux.link : local.jetbrains_ides[data.coder_parameter.jetbrains_ide.value].download_link - build_number = var.latest ? local.json_data[local.key][0].build : local.jetbrains_ides[data.coder_parameter.jetbrains_ide.value].build_number - version = var.latest ? local.json_data[local.key][0].version : var.jetbrains_ide_versions[data.coder_parameter.jetbrains_ide.value].version + display_name = local.jetbrains_ides[try(data.coder_parameter.jetbrains_ide[0].value, var.defaults[0])].name + identifier = try(data.coder_parameter.jetbrains_ide[0].value, var.defaults[0]) + download_link = var.latest ? local.json_data[local.key][0].downloads.linux.link : local.jetbrains_ides[try(data.coder_parameter.jetbrains_ide[0].value, var.defaults[0])].download_link + build_number = var.latest ? local.json_data[local.key][0].build : local.jetbrains_ides[try(data.coder_parameter.jetbrains_ide[0].value, var.defaults[0])].build_number + version = var.latest ? local.json_data[local.key][0].version : var.jetbrains_ide_versions[try(data.coder_parameter.jetbrains_ide[0].value, var.defaults[0])].version } data "coder_parameter" "jetbrains_ide" { + count = length(var.defaults) > 0 ? 0 : 1 type = "string" name = "jetbrains_ide" display_name = "JetBrains IDE" @@ -272,10 +293,11 @@ data "coder_workspace" "me" {} data "coder_workspace_owner" "me" {} resource "coder_app" "gateway" { + for_each = length(var.defaults) > 0 ? toset(var.defaults) : toset([data.coder_parameter.jetbrains_ide[0].value]) agent_id = var.agent_id slug = var.slug - display_name = local.display_name - icon = local.icon + display_name = local.jetbrains_ides[each.value].name + icon = local.jetbrains_ides[each.value].icon external = true order = var.order url = join("", [ @@ -292,38 +314,45 @@ resource "coder_app" "gateway" { "&token=", "$SESSION_TOKEN", "&ide_product_code=", - data.coder_parameter.jetbrains_ide.value, + each.value, "&ide_build_number=", - local.build_number, + local.jetbrains_ides[each.value].build_number, "&ide_download_link=", - local.download_link, + local.jetbrains_ides[each.value].download_link, ]) } output "identifier" { - value = local.identifier + value = local.identifier + description = "The product code of the JetBrains IDE." } output "display_name" { - value = local.display_name + value = local.display_name + description = "The display name of the JetBrains IDE." } output "icon" { - value = local.icon + value = local.icon + description = "The icon of the JetBrains IDE." } output "download_link" { - value = local.download_link + value = local.download_link + description = "The download link of the JetBrains IDE." } output "build_number" { - value = local.build_number + value = local.build_number + description = "The build number of the JetBrains IDE." } output "version" { - value = local.version + value = local.version + description = "The version of the JetBrains IDE." } output "url" { - value = coder_app.gateway.url -} + value = [for key in keys(coder_app.gateway) : coder_app.gateway[key].url] + description = "The URLs to connect to the JetBrains IDEs." +} \ No newline at end of file From 4452630a7ea38f5ccfc68e41cf54ddff7560f0e0 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Thu, 14 Nov 2024 18:41:40 +0500 Subject: [PATCH 2/8] Support multiple default IDEs in JetBrains Gateway --- jetbrains-gateway/main.tf | 72 +++++++++++++++++++++++---------------- 1 file changed, 42 insertions(+), 30 deletions(-) diff --git a/jetbrains-gateway/main.tf b/jetbrains-gateway/main.tf index 8fa67f2a..e1f14262 100644 --- a/jetbrains-gateway/main.tf +++ b/jetbrains-gateway/main.tf @@ -39,28 +39,22 @@ variable "folder" { } variable "default" { - default = "" - type = string - description = "Default IDE" -} - -variable "defaults" { default = [] type = list(string) - description = "List of default IDEs to be added to the Workspace page. Conflicts with the default variable." + description = "List of default IDEs to be added to the Workspace page." # check if the list is unique validation { - condition = length(var.defaults) == length(toset(var.defaults)) - error_message = "The defaults must not contain duplicates." + condition = length(var.default) == length(toset(var.default)) + error_message = "The default must not contain duplicates." } - # check if defaults are valid jetbrains_ides + # check if default are valid jetbrains_ides validation { condition = ( alltrue([ - for code in var.defaults : contains(["IU", "PS", "WS", "PY", "CL", "GO", "RM", "RD"], code) + for code in var.default : contains(["IU", "PS", "WS", "PY", "CL", "GO", "RM", "RD"], code) ]) ) - error_message = "The defaults must be a list of valid product codes. Valid product codes are ${join(",", ["IU", "PS", "WS", "PY", "CL", "GO", "RM", "RD"])}." + error_message = "The default must be a list of valid product codes. Valid product codes are ${join(",", ["IU", "PS", "WS", "PY", "CL", "GO", "RM", "RD"])}." } } @@ -144,7 +138,7 @@ variable "jetbrains_ide_versions" { variable "jetbrains_ides" { type = list(string) - description = "The list of IDE product codes to be shown to the user. Does not apply when defaults are used." + description = "The list of IDE product codes to be shown to the user. Does not apply when there are multiple defaults." default = ["IU", "PS", "WS", "PY", "CL", "GO", "RM", "RD"] validation { condition = ( @@ -259,24 +253,42 @@ locals { } } - icon = local.jetbrains_ides[try(data.coder_parameter.jetbrains_ide[0].value, var.defaults[0])].icon - json_data = var.latest ? jsondecode(data.http.jetbrains_ide_versions[try(data.coder_parameter.jetbrains_ide[0].value, var.defaults[0])].response_body) : {} - key = var.latest ? keys(local.json_data)[0] : "" - display_name = local.jetbrains_ides[try(data.coder_parameter.jetbrains_ide[0].value, var.defaults[0])].name - identifier = try(data.coder_parameter.jetbrains_ide[0].value, var.defaults[0]) - download_link = var.latest ? local.json_data[local.key][0].downloads.linux.link : local.jetbrains_ides[try(data.coder_parameter.jetbrains_ide[0].value, var.defaults[0])].download_link - build_number = var.latest ? local.json_data[local.key][0].build : local.jetbrains_ides[try(data.coder_parameter.jetbrains_ide[0].value, var.defaults[0])].build_number - version = var.latest ? local.json_data[local.key][0].version : var.jetbrains_ide_versions[try(data.coder_parameter.jetbrains_ide[0].value, var.defaults[0])].version + identifier = try([data.coder_parameter.jetbrains_ide[0].value], var.default) + list_json_data = var.latest ? [ + for ide in local.identifier : jsondecode(data.http.jetbrains_ide_versions[ide].response_body) + ] : [] + list_key = var.latest ? [ + for j in local.list_json_data : keys(j)[0] + ] : [] + download_links = length(local.list_key) > 0 ? [ + for i, j in local.list_json_data : j[local.list_key[i]][0].downloads.linux.link + ] : [ + for ide in local.identifier : local.jetbrains_ides[ide].download_link + ] + build_numbers = length(local.list_key) > 0 ? [ + for i, j in local.list_json_data : j[local.list_key[i]][0].build + ] : [ + for ide in local.identifier : local.jetbrains_ides[ide].build_number + ] + versions = length(local.list_key) > 0 ? [ + for i, j in local.list_json_data : j[local.list_key[i]][0].version + ] : [ + for ide in local.identifier : local.jetbrains_ides[ide].version + ] + display_names = [for key in keys(coder_app.gateway) : coder_app.gateway[key].display_name] + icons = [for key in keys(coder_app.gateway) : coder_app.gateway[key].icon] + urls = [for key in keys(coder_app.gateway) : coder_app.gateway[key].url] } data "coder_parameter" "jetbrains_ide" { - count = length(var.defaults) > 0 ? 0 : 1 + # remove the coder_parameter if there are multiple default + count = length(var.default) > 1 ? 0 : 1 type = "string" name = "jetbrains_ide" display_name = "JetBrains IDE" icon = "/icon/gateway.svg" mutable = true - default = var.default == "" ? var.jetbrains_ides[0] : var.default + default = length(var.default) > 0 ? var.default[0] : var.jetbrains_ides[0] order = var.coder_parameter_order dynamic "option" { @@ -293,7 +305,7 @@ data "coder_workspace" "me" {} data "coder_workspace_owner" "me" {} resource "coder_app" "gateway" { - for_each = length(var.defaults) > 0 ? toset(var.defaults) : toset([data.coder_parameter.jetbrains_ide[0].value]) + for_each = length(var.default) > 1 ? toset(var.default) : toset([data.coder_parameter.jetbrains_ide[0].value]) agent_id = var.agent_id slug = var.slug display_name = local.jetbrains_ides[each.value].name @@ -328,31 +340,31 @@ output "identifier" { } output "display_name" { - value = local.display_name + value = [for key in keys(coder_app.gateway) : coder_app.gateway[key].display_name] description = "The display name of the JetBrains IDE." } output "icon" { - value = local.icon + value = [for key in keys(coder_app.gateway) : coder_app.gateway[key].icon] description = "The icon of the JetBrains IDE." } output "download_link" { - value = local.download_link + value = local.download_links description = "The download link of the JetBrains IDE." } output "build_number" { - value = local.build_number + value = local.build_numbers description = "The build number of the JetBrains IDE." } output "version" { - value = local.version + value = local.versions description = "The version of the JetBrains IDE." } output "url" { value = [for key in keys(coder_app.gateway) : coder_app.gateway[key].url] - description = "The URLs to connect to the JetBrains IDEs." + description = "The URL to connect to the JetBrains IDE." } \ No newline at end of file From 5bc2aa4aa0f024f077b7a0c033e4e8a4ba1e810c Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Thu, 14 Nov 2024 19:36:04 +0500 Subject: [PATCH 3/8] Fix JetBrains Gateway tests for multiple IDEs - Allow creation of links with multiple IDEs. - Ensure outputs handle arrays for identifying multiple IDEs. - Update runTerraformApply to handle array values as JSON strings. --- jetbrains-gateway/main.test.ts | 29 +++++++++++++++++++++++------ test.ts | 3 ++- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/jetbrains-gateway/main.test.ts b/jetbrains-gateway/main.test.ts index 0a5b3bc3..d9df0efc 100644 --- a/jetbrains-gateway/main.test.ts +++ b/jetbrains-gateway/main.test.ts @@ -16,14 +16,13 @@ describe("jetbrains-gateway", async () => { it("should create a link with the default values", async () => { const state = await runTerraformApply(import.meta.dir, { - // These are all required. agent_id: "foo", agent_name: "foo", folder: "/home/coder", }); - expect(state.outputs.url.value).toBe( + expect(state.outputs.url.value).toEqual([ "jetbrains-gateway://connect#type=coder&workspace=default&owner=default&agent=foo&folder=/home/coder&url=https://mydeployment.coder.com&token=$SESSION_TOKEN&ide_product_code=IU&ide_build_number=241.14494.240&ide_download_link=https://download.jetbrains.com/idea/ideaIU-2024.1.tar.gz", - ); + ]); const coder_app = state.resources.find( (res) => res.type === "coder_app" && res.name === "gateway", @@ -34,13 +33,31 @@ describe("jetbrains-gateway", async () => { expect(coder_app?.instances[0].attributes.order).toBeNull(); }); - it("default to first ide", async () => { + it("default to first IDE", async () => { + const state = await runTerraformApply(import.meta.dir, { + agent_id: "foo", + agent_name: "foo", + folder: "/home/foo", + jetbrains_ides: ["IU", "PY"], + }); + expect(state.outputs.identifier.value).toEqual(["IU"]); + expect(state.outputs.url.value).toEqual([ + "jetbrains-gateway://connect#type=coder&workspace=default&owner=default&agent=foo&folder=/home/foo&url=https://mydeployment.coder.com&token=$SESSION_TOKEN&ide_product_code=IU&ide_build_number=241.14494.240&ide_download_link=https://download.jetbrains.com/idea/ideaIU-2024.1.tar.gz", + ]); + }); + + it("should create multiple IDEs", async () => { const state = await runTerraformApply(import.meta.dir, { agent_id: "foo", agent_name: "foo", folder: "/home/foo", - jetbrains_ides: '["IU", "GO", "PY"]', + default: ["GO", "IU", "PY"], }); - expect(state.outputs.identifier.value).toBe("IU"); + expect(state.outputs.identifier.value).toEqual(["GO", "IU", "PY"]); + expect(state.outputs.url.value).toEqual([ + "jetbrains-gateway://connect#type=coder&workspace=default&owner=default&agent=foo&folder=/home/foo&url=https://mydeployment.coder.com&token=$SESSION_TOKEN&ide_product_code=GO&ide_build_number=241.14494.238&ide_download_link=https://download.jetbrains.com/go/goland-2024.1.tar.gz", + "jetbrains-gateway://connect#type=coder&workspace=default&owner=default&agent=foo&folder=/home/foo&url=https://mydeployment.coder.com&token=$SESSION_TOKEN&ide_product_code=IU&ide_build_number=241.14494.240&ide_download_link=https://download.jetbrains.com/idea/ideaIU-2024.1.tar.gz", + "jetbrains-gateway://connect#type=coder&workspace=default&owner=default&agent=foo&folder=/home/foo&url=https://mydeployment.coder.com&token=$SESSION_TOKEN&ide_product_code=PY&ide_build_number=241.14494.241&ide_download_link=https://download.jetbrains.com/python/pycharm-professional-2024.1.tar.gz", + ]); }); }); diff --git a/test.ts b/test.ts index 5437374f..c6772535 100644 --- a/test.ts +++ b/test.ts @@ -200,7 +200,8 @@ export const runTerraformApply = async ( const combinedEnv = env === undefined ? {} : { ...env }; for (const [key, value] of Object.entries(vars)) { - combinedEnv[`TF_VAR_${key}`] = String(value); + // Convert arrays to JSON strings + combinedEnv[`TF_VAR_${key}`] = Array.isArray(value) ? JSON.stringify(value) : String(value); } const proc = spawn( From 937ffcd47b91f739bec1f4752e292e6c2313edd3 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Thu, 14 Nov 2024 19:50:09 +0500 Subject: [PATCH 4/8] Update slug format for JetBrains Gateway apps This change improves URL uniqueness by appending a lowercase IDE identifier to the slug, ensuring distinct slugs for each default IDE. --- jetbrains-gateway/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jetbrains-gateway/main.tf b/jetbrains-gateway/main.tf index e1f14262..920ac2db 100644 --- a/jetbrains-gateway/main.tf +++ b/jetbrains-gateway/main.tf @@ -307,7 +307,7 @@ data "coder_workspace_owner" "me" {} resource "coder_app" "gateway" { for_each = length(var.default) > 1 ? toset(var.default) : toset([data.coder_parameter.jetbrains_ide[0].value]) agent_id = var.agent_id - slug = var.slug + slug = "${var.slug}-${lower(each.value)}" display_name = local.jetbrains_ides[each.value].name icon = local.jetbrains_ides[each.value].icon external = true From 70020d8b8c930cf63eda46a2ac67092f5c48c3ed Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Thu, 14 Nov 2024 19:54:58 +0500 Subject: [PATCH 5/8] Support multiple default IDEs in JetBrains Gateway --- jetbrains-gateway/README.md | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/jetbrains-gateway/README.md b/jetbrains-gateway/README.md index 00beb83f..0910f7cc 100644 --- a/jetbrains-gateway/README.md +++ b/jetbrains-gateway/README.md @@ -19,7 +19,7 @@ module "jetbrains_gateway" { agent_name = "example" folder = "/home/coder/example" jetbrains_ides = ["CL", "GO", "IU", "PY", "WS"] - default = "GO" + default = ["GO"] } ``` @@ -37,7 +37,7 @@ module "jetbrains_gateway" { agent_name = "example" folder = "/home/coder/example" jetbrains_ides = ["GO", "WS"] - default = "GO" + default = ["GO"] } ``` @@ -51,7 +51,7 @@ module "jetbrains_gateway" { agent_name = "example" folder = "/home/coder/example" jetbrains_ides = ["GO", "WS"] - default = "GO" + default = ["GO"] latest = true } ``` @@ -66,7 +66,7 @@ module "jetbrains_gateway" { agent_name = "example" folder = "/home/coder/example" jetbrains_ides = ["GO", "WS"] - default = "GO" + default = ["GO"] latest = true channel = "eap" } @@ -86,7 +86,22 @@ module "jetbrains_gateway" { jetbrains_ides = ["GO", "WS"] releases_base_link = "https://releases.internal.site/" download_base_link = "https://download.internal.site/" - default = "GO" + default = ["GO"] +} +``` + +### Add multiple IDEs + +**Note:** This removes the choice of IDE from the user. + +```tf +module "jetbrains_gateway" { + source = "registry.coder.com/modules/jetbrains-gateway/coder" + version = "1.0.23" + agent_id = coder_agent.example.id + agent_name = "example" + folder = "/home/coder/example" + default = ["GO", "WS"] } ``` From d45f2e6ad16f7edbfc02baeb8ee846905c44d9df Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Thu, 14 Nov 2024 20:06:39 +0500 Subject: [PATCH 6/8] Update JetBrains Gateway module to v1.0.24 --- jetbrains-gateway/README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/jetbrains-gateway/README.md b/jetbrains-gateway/README.md index 0910f7cc..cdf2ddfd 100644 --- a/jetbrains-gateway/README.md +++ b/jetbrains-gateway/README.md @@ -14,7 +14,7 @@ This module adds a JetBrains Gateway Button to open any workspace with a single ```tf module "jetbrains_gateway" { source = "registry.coder.com/modules/jetbrains-gateway/coder" - version = "1.0.23" + version = "1.0.24" agent_id = coder_agent.example.id agent_name = "example" folder = "/home/coder/example" @@ -32,7 +32,7 @@ module "jetbrains_gateway" { ```tf module "jetbrains_gateway" { source = "registry.coder.com/modules/jetbrains-gateway/coder" - version = "1.0.23" + version = "1.0.24" agent_id = coder_agent.example.id agent_name = "example" folder = "/home/coder/example" @@ -46,7 +46,7 @@ module "jetbrains_gateway" { ```tf module "jetbrains_gateway" { source = "registry.coder.com/modules/jetbrains-gateway/coder" - version = "1.0.23" + version = "1.0.24" agent_id = coder_agent.example.id agent_name = "example" folder = "/home/coder/example" @@ -61,7 +61,7 @@ module "jetbrains_gateway" { ```tf module "jetbrains_gateway" { source = "registry.coder.com/modules/jetbrains-gateway/coder" - version = "1.0.23" + version = "1.0.24" agent_id = coder_agent.example.id agent_name = "example" folder = "/home/coder/example" @@ -79,7 +79,7 @@ Due to the highest priority of the `ide_download_link` parameter in the `(jetbra ```tf module "jetbrains_gateway" { source = "registry.coder.com/modules/jetbrains-gateway/coder" - version = "1.0.23" + version = "1.0.24" agent_id = coder_agent.example.id agent_name = "example" folder = "/home/coder/example" @@ -96,12 +96,12 @@ module "jetbrains_gateway" { ```tf module "jetbrains_gateway" { - source = "registry.coder.com/modules/jetbrains-gateway/coder" - version = "1.0.23" - agent_id = coder_agent.example.id - agent_name = "example" - folder = "/home/coder/example" - default = ["GO", "WS"] + source = "registry.coder.com/modules/jetbrains-gateway/coder" + version = "1.0.24" + agent_id = coder_agent.example.id + agent_name = "example" + folder = "/home/coder/example" + default = ["GO", "WS"] } ``` From 2f51d70fb75fd6f325788127c3416c76873005cb Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 26 Nov 2024 13:50:55 +0500 Subject: [PATCH 7/8] always use latest and update default versions to 2024.3 --- jetbrains-gateway/README.md | 4 ++-- jetbrains-gateway/main.tf | 32 ++++++++++++++++---------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/jetbrains-gateway/README.md b/jetbrains-gateway/README.md index cdf2ddfd..a3afec5c 100644 --- a/jetbrains-gateway/README.md +++ b/jetbrains-gateway/README.md @@ -41,7 +41,7 @@ module "jetbrains_gateway" { } ``` -### Use the latest release version +### Use the fixed version ```tf module "jetbrains_gateway" { @@ -52,7 +52,7 @@ module "jetbrains_gateway" { folder = "/home/coder/example" jetbrains_ides = ["GO", "WS"] default = ["GO"] - latest = true + latest = false # current version is 2024.3 } ``` diff --git a/jetbrains-gateway/main.tf b/jetbrains-gateway/main.tf index 920ac2db..99c4499f 100644 --- a/jetbrains-gateway/main.tf +++ b/jetbrains-gateway/main.tf @@ -73,7 +73,7 @@ variable "coder_parameter_order" { variable "latest" { type = bool description = "Whether to fetch the latest version of the IDE." - default = false + default = true } variable "channel" { @@ -94,36 +94,36 @@ variable "jetbrains_ide_versions" { description = "The set of versions for each jetbrains IDE" default = { "IU" = { - build_number = "241.14494.240" - version = "2024.1" + build_number = "243.21565.193" + version = "2024.3" } "PS" = { - build_number = "241.14494.237" - version = "2024.1" + build_number = "243.21565.202" + version = "2024.3" } "WS" = { - build_number = "241.14494.235" - version = "2024.1" + build_number = "243.21565.180" + version = "2024.3" } "PY" = { - build_number = "241.14494.241" - version = "2024.1" + build_number = "243.21565.199" + version = "2024.3" } "CL" = { - build_number = "241.14494.288" + build_number = "243.21565.238" version = "2024.1" } "GO" = { - build_number = "241.14494.238" - version = "2024.1" + build_number = "243.21565.208" + version = "2024.3" } "RM" = { - build_number = "241.14494.234" - version = "2024.1" + build_number = "243.21565.197" + version = "2024.3" } "RD" = { - build_number = "241.14494.307" - version = "2024.1" + build_number = "243.21565.191" + version = "2024.3" } } validation { From cd6aa274f1a9e43257500d30e0974d2ed48b4db4 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 26 Nov 2024 14:08:24 +0500 Subject: [PATCH 8/8] fix tests --- jetbrains-gateway/main.test.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/jetbrains-gateway/main.test.ts b/jetbrains-gateway/main.test.ts index d9df0efc..08f8972d 100644 --- a/jetbrains-gateway/main.test.ts +++ b/jetbrains-gateway/main.test.ts @@ -21,7 +21,7 @@ describe("jetbrains-gateway", async () => { folder: "/home/coder", }); expect(state.outputs.url.value).toEqual([ - "jetbrains-gateway://connect#type=coder&workspace=default&owner=default&agent=foo&folder=/home/coder&url=https://mydeployment.coder.com&token=$SESSION_TOKEN&ide_product_code=IU&ide_build_number=241.14494.240&ide_download_link=https://download.jetbrains.com/idea/ideaIU-2024.1.tar.gz", + "jetbrains-gateway://connect#type=coder&workspace=default&owner=default&agent=foo&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", ]); const coder_app = state.resources.find( @@ -42,7 +42,7 @@ describe("jetbrains-gateway", async () => { }); expect(state.outputs.identifier.value).toEqual(["IU"]); expect(state.outputs.url.value).toEqual([ - "jetbrains-gateway://connect#type=coder&workspace=default&owner=default&agent=foo&folder=/home/foo&url=https://mydeployment.coder.com&token=$SESSION_TOKEN&ide_product_code=IU&ide_build_number=241.14494.240&ide_download_link=https://download.jetbrains.com/idea/ideaIU-2024.1.tar.gz", + "jetbrains-gateway://connect#type=coder&workspace=default&owner=default&agent=foo&folder=/home/foo&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", ]); }); @@ -55,9 +55,9 @@ describe("jetbrains-gateway", async () => { }); expect(state.outputs.identifier.value).toEqual(["GO", "IU", "PY"]); expect(state.outputs.url.value).toEqual([ - "jetbrains-gateway://connect#type=coder&workspace=default&owner=default&agent=foo&folder=/home/foo&url=https://mydeployment.coder.com&token=$SESSION_TOKEN&ide_product_code=GO&ide_build_number=241.14494.238&ide_download_link=https://download.jetbrains.com/go/goland-2024.1.tar.gz", - "jetbrains-gateway://connect#type=coder&workspace=default&owner=default&agent=foo&folder=/home/foo&url=https://mydeployment.coder.com&token=$SESSION_TOKEN&ide_product_code=IU&ide_build_number=241.14494.240&ide_download_link=https://download.jetbrains.com/idea/ideaIU-2024.1.tar.gz", - "jetbrains-gateway://connect#type=coder&workspace=default&owner=default&agent=foo&folder=/home/foo&url=https://mydeployment.coder.com&token=$SESSION_TOKEN&ide_product_code=PY&ide_build_number=241.14494.241&ide_download_link=https://download.jetbrains.com/python/pycharm-professional-2024.1.tar.gz", + "jetbrains-gateway://connect#type=coder&workspace=default&owner=default&agent=foo&folder=/home/foo&url=https://mydeployment.coder.com&token=$SESSION_TOKEN&ide_product_code=GO&ide_build_number=243.21565.208&ide_download_link=https://download.jetbrains.com/go/goland-2024.3.tar.gz", + "jetbrains-gateway://connect#type=coder&workspace=default&owner=default&agent=foo&folder=/home/foo&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", + "jetbrains-gateway://connect#type=coder&workspace=default&owner=default&agent=foo&folder=/home/foo&url=https://mydeployment.coder.com&token=$SESSION_TOKEN&ide_product_code=PY&ide_build_number=243.21565.199&ide_download_link=https://download.jetbrains.com/python/pycharm-professional-2024.3.tar.gz", ]); }); });