From d44db503b0e09d281e1ee849a6cce8a26863690e Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Mon, 6 Nov 2023 16:35:05 +0300 Subject: [PATCH 01/11] chore(jetbrans-gateway): update JetBrains IDEs 1. Updated IDEs to the latest available version 2. Remove the Community editions as it does not support working with the gateway. --- jetbrains-gateway/main.tf | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/jetbrains-gateway/main.tf b/jetbrains-gateway/main.tf index 1ce564d0..9a3d66ab 100644 --- a/jetbrains-gateway/main.tf +++ b/jetbrains-gateway/main.tf @@ -58,37 +58,37 @@ locals { "GO" = { icon = "/icon/goland.svg", name = "GoLand", - value = jsonencode(["GO", "232.9921.53", "https://download.jetbrains.com/go/goland-2023.2.2.tar.gz"]) + value = jsonencode(["GO", "232.10203.20", "https://download.jetbrains.com/go/goland-2023.2.4.tar.gz"]) }, "WS" = { icon = "/icon/webstorm.svg", name = "WebStorm", - value = jsonencode(["WS", "232.9921.42", "https://download.jetbrains.com/webstorm/WebStorm-2023.2.2.tar.gz"]) + value = jsonencode(["WS", "232.10203.14", "https://download.jetbrains.com/webstorm/WebStorm-2023.2.4.tar.gz"]) }, "IU" = { icon = "/icon/intellij.svg", name = "IntelliJ IDEA Ultimate", - value = jsonencode(["IU", "232.9921.47", "https://download.jetbrains.com/idea/ideaIU-2023.2.2.tar.gz"]) + value = jsonencode(["IU", "232.10203.10", "https://download.jetbrains.com/idea/ideaIU-2023.2.4.tar.gz"]) }, "IC" = { icon = "/icon/intellij.svg", name = "IntelliJ IDEA Community", - value = jsonencode(["IC", "232.9921.47", "https://download.jetbrains.com/idea/ideaIC-2023.2.2.tar.gz"]) + value = jsonencode(["IC", "232.10203.10", "https://download.jetbrains.com/idea/ideaIC-2023.2.2.tar.gz"]) }, "PY" = { icon = "/icon/pycharm.svg", name = "PyCharm Professional", - value = jsonencode(["PY", "232.9559.58", "https://download.jetbrains.com/python/pycharm-professional-2023.2.1.tar.gz"]) + value = jsonencode(["PY", "232.10203.26", "https://download.jetbrains.com/python/pycharm-professional-2023.2.4.tar.gz"]) }, "PC" = { icon = "/icon/pycharm.svg", name = "PyCharm Community", - value = jsonencode(["PC", "232.9559.58", "https://download.jetbrains.com/python/pycharm-community-2023.2.1.tar.gz"]) + value = jsonencode(["PC", "232.10203.26", "https://download.jetbrains.com/python/pycharm-community-2023.2.4.tar.gz"]) }, "RD" = { icon = "/icon/rider.svg", name = "Rider", - value = jsonencode(["RD", "232.9559.61", "https://download.jetbrains.com/rider/JetBrains.Rider-2023.2.1.tar.gz"]) + value = jsonencode(["RD", "232.10203.29", "https://download.jetbrains.com/rider/JetBrains.Rider-2023.2.3.tar.gz"]) } "CL" = { icon = "/icon/clion.svg", @@ -98,17 +98,17 @@ locals { "DB" = { icon = "/icon/datagrip.svg", name = "DataGrip", - value = jsonencode(["DB", "232.9559.28", "https://download.jetbrains.com/datagrip/datagrip-2023.2.1.tar.gz"]) + value = jsonencode(["DB", "232.10203.8", "https://download.jetbrains.com/datagrip/datagrip-2023.2.3.tar.gz"]) }, "PS" = { icon = "/icon/phpstorm.svg", name = "PhpStorm", - value = jsonencode(["PS", "232.9559.64", "https://download.jetbrains.com/webide/PhpStorm-2023.2.1.tar.gz"]) + value = jsonencode(["PS", "232.10072.32", "https://download.jetbrains.com/webide/PhpStorm-2023.2.3.tar.gz"]) }, "RM" = { icon = "/icon/rubymine.svg", name = "RubyMine", - value = jsonencode(["RM", "232.9921.48", "https://download.jetbrains.com/ruby/RubyMine-2023.2.2.tar.gz"]) + value = jsonencode(["RM", "232.10203.15", "https://download.jetbrains.com/ruby/RubyMine-2023.2.4.tar.gz"]) } } } From ed1fde0be375c283bea75bbf0667024445052917 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Mon, 6 Nov 2023 16:36:33 +0300 Subject: [PATCH 02/11] remove community editions --- jetbrains-gateway/main.tf | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/jetbrains-gateway/main.tf b/jetbrains-gateway/main.tf index 9a3d66ab..9bee0611 100644 --- a/jetbrains-gateway/main.tf +++ b/jetbrains-gateway/main.tf @@ -36,10 +36,10 @@ variable "jetbrains_ides" { validation { condition = ( alltrue([ - for code in var.jetbrains_ides : contains(["IU", "IC", "PS", "WS", "PY", "PC", "CL", "GO", "DB", "RD", "RM"], code) + for code in var.jetbrains_ides : contains(["IU", "PS", "WS", "PY", "CL", "GO", "DB", "RD", "RM"], code) ]) ) - error_message = "The jetbrains_ides must be a list of valid product codes. Valid product codes are: IU, IC, PS, WS, PY, PC, CL, GO, DB, RD, RM." + error_message = "The jetbrains_ides must be a list of valid product codes. Valid product codes are: IU, PS, WS, PY, CL, GO, DB, RD, RM." } # check if the list is empty validation { @@ -70,21 +70,11 @@ locals { name = "IntelliJ IDEA Ultimate", value = jsonencode(["IU", "232.10203.10", "https://download.jetbrains.com/idea/ideaIU-2023.2.4.tar.gz"]) }, - "IC" = { - icon = "/icon/intellij.svg", - name = "IntelliJ IDEA Community", - value = jsonencode(["IC", "232.10203.10", "https://download.jetbrains.com/idea/ideaIC-2023.2.2.tar.gz"]) - }, "PY" = { icon = "/icon/pycharm.svg", name = "PyCharm Professional", value = jsonencode(["PY", "232.10203.26", "https://download.jetbrains.com/python/pycharm-professional-2023.2.4.tar.gz"]) }, - "PC" = { - icon = "/icon/pycharm.svg", - name = "PyCharm Community", - value = jsonencode(["PC", "232.10203.26", "https://download.jetbrains.com/python/pycharm-community-2023.2.4.tar.gz"]) - }, "RD" = { icon = "/icon/rider.svg", name = "Rider", From d4e9bc590fd5171c4d5c24e91b9dc3c6006e346d Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Mon, 6 Nov 2023 17:03:59 +0300 Subject: [PATCH 03/11] fix test --- jetbrains-gateway/main.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jetbrains-gateway/main.test.ts b/jetbrains-gateway/main.test.ts index 9a0628f9..139be215 100644 --- a/jetbrains-gateway/main.test.ts +++ b/jetbrains-gateway/main.test.ts @@ -13,7 +13,7 @@ describe("jetbrains-gateway", async () => { agent_id: "foo", agent_name: "bar", folder: "/baz/", - jetbrains_ides: '["IU", "IC", "PY"]', + jetbrains_ides: '["IU", "GO", "PY"]', }); it("default to first ide", async () => { @@ -21,10 +21,10 @@ describe("jetbrains-gateway", async () => { agent_id: "foo", agent_name: "bar", folder: "/baz/", - jetbrains_ides: '["IU", "IC", "PY"]', + jetbrains_ides: '["IU", "GO", "PY"]', }); expect(state.outputs.jetbrains_ides.value).toBe( - '["IU","232.9921.47","https://download.jetbrains.com/idea/ideaIU-2023.2.2.tar.gz"]', + '["IU","232.10203.10","https://download.jetbrains.com/idea/ideaIU-2023.2.4.tar.gz"]', ); }); }); From f9215ded528831753e3b8f7812c519bb99894d1a Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 14 Nov 2023 01:16:47 +0300 Subject: [PATCH 04/11] Update README.md --- jetbrains-gateway/README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/jetbrains-gateway/README.md b/jetbrains-gateway/README.md index f3e107c3..a5539402 100644 --- a/jetbrains-gateway/README.md +++ b/jetbrains-gateway/README.md @@ -17,7 +17,8 @@ module "jetbrains_gateway" { agent_id = coder_agent.example.id agent_name = "example" folder = "/home/coder/example" - jetbrains_ides = ["GO", "WS", "IU", "IC", "PY", "PC", "PS", "CL", "RM", "DB", "RD"] + jetbrains_ides = ["GO", "WS", "IU", "PY", "PS", "CL", "RM", "DB", "RD"] + default = "PY" } ``` @@ -45,9 +46,7 @@ This module and JetBrains Gateway support the following JetBrains IDEs: - GoLand (`GO`) - WebStorm (`WS`) - IntelliJ IDEA Ultimate (`IU`) -- IntelliJ IDEA Community (`IC`) - PyCharm Professional (`PY`) -- PyCharm Community (`PC`) - PhpStorm (`PS`) - CLion (`CL`) - RubyMine (`RM`) From adff0e72fcbf66c9a7db483af43d28ad4e3a92bc Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Thu, 16 Nov 2023 14:49:08 +0300 Subject: [PATCH 05/11] Update coder_app resource to use agent_id instead of agent_name --- jetbrains-gateway/main.tf | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/jetbrains-gateway/main.tf b/jetbrains-gateway/main.tf index 9bee0611..157deb96 100644 --- a/jetbrains-gateway/main.tf +++ b/jetbrains-gateway/main.tf @@ -14,11 +14,6 @@ variable "agent_id" { description = "The ID of a Coder agent." } -variable "agent_name" { - type = string - description = "The name of a Coder agent." -} - variable "folder" { type = string description = "The directory to open in the IDE. e.g. /home/coder/project" @@ -133,8 +128,8 @@ resource "coder_app" "gateway" { url = join("", [ "jetbrains-gateway://connect#type=coder&workspace=", data.coder_workspace.me.name, - "&agent=", - var.agent_name, + "&agent_id=", + var.agent_id, "&folder=", var.folder, "&url=", From 98bc69440c1ebb2d2b31b5f3ea371d4fcb3218d3 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Thu, 16 Nov 2023 14:53:17 +0300 Subject: [PATCH 06/11] fix tests --- jetbrains-gateway/main.test.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/jetbrains-gateway/main.test.ts b/jetbrains-gateway/main.test.ts index 139be215..7789bc5d 100644 --- a/jetbrains-gateway/main.test.ts +++ b/jetbrains-gateway/main.test.ts @@ -2,7 +2,6 @@ import { it, expect, describe } from "bun:test"; import { runTerraformInit, testRequiredVariables, - executeScriptInContainer, runTerraformApply, } from "../test"; @@ -11,7 +10,6 @@ describe("jetbrains-gateway", async () => { await testRequiredVariables(import.meta.dir, { agent_id: "foo", - agent_name: "bar", folder: "/baz/", jetbrains_ides: '["IU", "GO", "PY"]', }); @@ -19,7 +17,6 @@ describe("jetbrains-gateway", async () => { it("default to first ide", async () => { const state = await runTerraformApply(import.meta.dir, { agent_id: "foo", - agent_name: "bar", folder: "/baz/", jetbrains_ides: '["IU", "GO", "PY"]', }); From 16bb55d299c2eae4e06df8d8aabe7ab7cc1aa9ca Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 5 Dec 2023 15:20:39 +0300 Subject: [PATCH 07/11] remove DB and RD Datalore and Rider are not supported with gateway yet. --- jetbrains-gateway/README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/jetbrains-gateway/README.md b/jetbrains-gateway/README.md index a5539402..fcbf21dc 100644 --- a/jetbrains-gateway/README.md +++ b/jetbrains-gateway/README.md @@ -17,7 +17,7 @@ module "jetbrains_gateway" { agent_id = coder_agent.example.id agent_name = "example" folder = "/home/coder/example" - jetbrains_ides = ["GO", "WS", "IU", "PY", "PS", "CL", "RM", "DB", "RD"] + jetbrains_ides = ["GO", "WS", "IU", "PY", "PS", "CL", "RM"] default = "PY" } ``` @@ -50,5 +50,3 @@ This module and JetBrains Gateway support the following JetBrains IDEs: - PhpStorm (`PS`) - CLion (`CL`) - RubyMine (`RM`) -- DataGrip (`DB`) -- Rider (`RD`) From 88aea58779051d9d7fb1cd6ae13c5bb7c5182feb Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 5 Dec 2023 15:22:19 +0300 Subject: [PATCH 08/11] Update main.tf --- jetbrains-gateway/main.tf | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/jetbrains-gateway/main.tf b/jetbrains-gateway/main.tf index 157deb96..315ae60c 100644 --- a/jetbrains-gateway/main.tf +++ b/jetbrains-gateway/main.tf @@ -31,10 +31,10 @@ variable "jetbrains_ides" { validation { condition = ( alltrue([ - for code in var.jetbrains_ides : contains(["IU", "PS", "WS", "PY", "CL", "GO", "DB", "RD", "RM"], code) + for code in var.jetbrains_ides : contains(["IU", "PS", "WS", "PY", "CL", "GO", "RM"], code) ]) ) - error_message = "The jetbrains_ides must be a list of valid product codes. Valid product codes are: IU, PS, WS, PY, CL, GO, DB, RD, RM." + error_message = "The jetbrains_ides must be a list of valid product codes. Valid product codes are IU, PS, WS, PY, CL, GO, RM." } # check if the list is empty validation { @@ -70,21 +70,11 @@ locals { name = "PyCharm Professional", value = jsonencode(["PY", "232.10203.26", "https://download.jetbrains.com/python/pycharm-professional-2023.2.4.tar.gz"]) }, - "RD" = { - icon = "/icon/rider.svg", - name = "Rider", - value = jsonencode(["RD", "232.10203.29", "https://download.jetbrains.com/rider/JetBrains.Rider-2023.2.3.tar.gz"]) - } "CL" = { icon = "/icon/clion.svg", name = "CLion", value = jsonencode(["CL", "232.9921.42", "https://download.jetbrains.com/cpp/CLion-2023.2.2.tar.gz"]) }, - "DB" = { - icon = "/icon/datagrip.svg", - name = "DataGrip", - value = jsonencode(["DB", "232.10203.8", "https://download.jetbrains.com/datagrip/datagrip-2023.2.3.tar.gz"]) - }, "PS" = { icon = "/icon/phpstorm.svg", name = "PhpStorm", From 6acab56d1e3f8308cdaf478020b7a7c6704b3bd6 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Fri, 8 Dec 2023 01:53:37 +0300 Subject: [PATCH 09/11] populate default list with all IDEs --- jetbrains-gateway/main.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/jetbrains-gateway/main.tf b/jetbrains-gateway/main.tf index 315ae60c..56717336 100644 --- a/jetbrains-gateway/main.tf +++ b/jetbrains-gateway/main.tf @@ -28,6 +28,7 @@ variable "default" { variable "jetbrains_ides" { type = list(string) description = "The list of IDE product codes." + default = ["IU", "PS", "WS", "PY", "CL", "GO", "RM"] validation { condition = ( alltrue([ From 75cfafa4dc976eeb6f68e35b49da9f0c38a64a18 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Fri, 8 Dec 2023 01:54:54 +0300 Subject: [PATCH 10/11] remove `agent_name` from README.md --- jetbrains-gateway/README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/jetbrains-gateway/README.md b/jetbrains-gateway/README.md index fcbf21dc..a48765bd 100644 --- a/jetbrains-gateway/README.md +++ b/jetbrains-gateway/README.md @@ -15,7 +15,6 @@ This module adds a JetBrains Gateway Button to open any workspace with a single module "jetbrains_gateway" { source = "https://registry.coder.com/modules/jetbrains-gateway" agent_id = coder_agent.example.id - agent_name = "example" folder = "/home/coder/example" jetbrains_ides = ["GO", "WS", "IU", "PY", "PS", "CL", "RM"] default = "PY" @@ -32,7 +31,6 @@ module "jetbrains_gateway" { module "jetbrains_gateway" { source = "https://registry.coder.com/modules/jetbrains-gateway" agent_id = coder_agent.example.id - agent_name = "example" folder = "/home/coder/example" jetbrains_ides = ["GO", "WS"] default = "GO" From 4ac1865d0fdf1cda24e98c1eeabfbe1976025b83 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Fri, 8 Dec 2023 02:06:45 +0300 Subject: [PATCH 11/11] fix tests --- jetbrains-gateway/main.test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/jetbrains-gateway/main.test.ts b/jetbrains-gateway/main.test.ts index 7789bc5d..d1097474 100644 --- a/jetbrains-gateway/main.test.ts +++ b/jetbrains-gateway/main.test.ts @@ -11,7 +11,6 @@ describe("jetbrains-gateway", async () => { await testRequiredVariables(import.meta.dir, { agent_id: "foo", folder: "/baz/", - jetbrains_ides: '["IU", "GO", "PY"]', }); it("default to first ide", async () => {