Skip to content

Commit 950c3b1

Browse files
authored
Merge pull request #442 from coder/f0ssel/usage-app
chore: pass usage app name to coder ssh
2 parents dceb578 + 329ee12 commit 950c3b1

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pluginUntilBuild=241.*
1515
# verifier should be used after bumping versions to ensure compatibility in the
1616
# range.
1717
platformType=GW
18-
platformVersion=233.14808-EAP-CANDIDATE-SNAPSHOT
18+
platformVersion=233.15325-EAP-CANDIDATE-SNAPSHOT
1919
instrumentationCompiler=241.10840-EAP-CANDIDATE-SNAPSHOT
2020
platformDownloadSources=true
2121
verifyVersions=2023.3,2024.1

src/main/kotlin/com/coder/gateway/cli/CoderCLIManager.kt

+3
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ fun ensureCLI(
111111
*/
112112
data class Features(
113113
val disableAutostart: Boolean = false,
114+
val reportWorkspaceUsage: Boolean = false,
114115
)
115116

116117
/**
@@ -264,6 +265,7 @@ class CoderCLIManager(
264265
"ssh",
265266
"--stdio",
266267
if (settings.disableAutostart && feats.disableAutostart) "--disable-autostart" else null,
268+
if (feats.reportWorkspaceUsage) "--usage-app=jetbrains" else null,
267269
)
268270
val extraConfig =
269271
if (settings.sshConfigOptions.isNotBlank()) {
@@ -446,6 +448,7 @@ class CoderCLIManager(
446448
Features(
447449
// Autostart with SSH was added in 2.5.0.
448450
disableAutostart = version >= SemVer(2, 5, 0),
451+
reportWorkspaceUsage = version >= SemVer(2, 13, 0),
449452
)
450453
}
451454
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# --- START CODER JETBRAINS test.coder.invalid
2+
Host coder-jetbrains--foo--test.coder.invalid
3+
ProxyCommand /tmp/coder-gateway/test.coder.invalid/coder-linux-amd64 --global-config /tmp/coder-gateway/test.coder.invalid/config ssh --stdio --usage-app=jetbrains foo
4+
ConnectTimeout 0
5+
StrictHostKeyChecking no
6+
UserKnownHostsFile /dev/null
7+
LogLevel ERROR
8+
SetEnv CODER_SSH_SESSION_TYPE=JetBrains
9+
# --- END CODER JETBRAINS test.coder.invalid

src/test/kotlin/com/coder/gateway/cli/CoderCLIManagerTest.kt

+3-1
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ internal class CoderCLIManagerTest {
345345
},
346346
SSHTest(listOf("foo"), null, "disable-autostart", "blank", "", true, Features(true)),
347347
SSHTest(listOf("foo"), null, "no-disable-autostart", "blank", "", true, Features(false)),
348+
SSHTest(listOf("foo"), null, "report-usage", "blank", "", true, Features(false, true)),
348349
SSHTest(
349350
listOf("extra"),
350351
null,
@@ -721,7 +722,8 @@ internal class CoderCLIManagerTest {
721722
val tests =
722723
listOf(
723724
Pair("2.5.0", Features(true)),
724-
Pair("4.9.0", Features(true)),
725+
Pair("2.13.0", Features(true, true)),
726+
Pair("4.9.0", Features(true, true)),
725727
Pair("2.4.9", Features(false)),
726728
Pair("1.0.1", Features(false)),
727729
)

0 commit comments

Comments
 (0)