Skip to content

Commit 3d198f6

Browse files
committed
Merge branch 'main' into eap
- include all bugfixes and enhancements released with `2.1.3`
2 parents c7efb60 + 2a7f518 commit 3d198f6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+925
-180
lines changed
32.6 KB
Loading

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ jobs:
105105

106106
# Run Qodana inspections
107107
- name: Qodana - Code Inspection
108-
uses: JetBrains/[email protected].3
108+
uses: JetBrains/[email protected].4
109109

110110
# Prepare plugin archive content for creating artifact
111111
- name: Prepare Plugin Artifact

CHANGELOG.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,46 @@
44

55
## Unreleased
66

7+
Bug fixes and enhancements included in `2.1.3` release:
8+
9+
### Added
10+
- warning system when plugin might not be compatible with Coder REST API
11+
- a `Create workspace` button which links to Coder's templates page
12+
- workspace icons
13+
- quick toolbar action to open Coder Dashboard in the browser
14+
- custom user agent for the HTTP client
15+
16+
### Changed
17+
- redesigned the information&warning banner. Messages can now include hyperlinks
18+
19+
### Removed
20+
- connection handle window is no longer displayed
21+
22+
### Fixed
23+
- outdated Coder CLI binaries are cleaned up
24+
- workspace status color style: running workspaces are green, failed ones should be red, everything else is gray
25+
- typos in plugin description
26+
27+
## 2.1.3 - 2022-12-09
28+
29+
### Added
30+
- warning system when plugin might not be compatible with Coder REST API
31+
- a `Create workspace` button which links to Coder's templates page
32+
- workspace icons
33+
- quick toolbar action to open Coder Dashboard in the browser
34+
- custom user agent for the HTTP client
35+
36+
### Changed
37+
- redesigned the information&warning banner. Messages can now include hyperlinks
38+
39+
### Removed
40+
- connection handle window is no longer displayed
41+
42+
### Fixed
43+
- outdated Coder CLI binaries are cleaned up
44+
- workspace status color style: running workspaces are green, failed ones should be red, everything else is gray
45+
- typos in plugin description
46+
747
## 2.1.2-eap.0 - 2022-11-29
848

949
### Added

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Follow](https://img.shields.io/twitter/follow/CoderHQ?label=%40CoderHQ&style=soc
77
[![Coder Gateway Plugin Build](https://github.com/coder/coder-jetbrains/actions/workflows/build.yml/badge.svg)](https://github.com/coder/coder-jetbrains/actions/workflows/build.yml)
88

99
<!-- Plugin description -->
10-
**Coder Gateway** connects your Jetbrains IDE to your [Coder Workspaces](https://coder.com/docs/coder-oss/latest/workspaces) so that you can develop from anywhere.
10+
**Coder Gateway** connects your JetBrains IDE to your [Coder Workspaces](https://coder.com/docs/coder-oss/latest/workspaces) so that you can develop from anywhere.
1111

1212
**Manage less**
1313

@@ -226,6 +226,16 @@ versions of Gateway we've decided:
226226
different release channels (ex: `eap` or `beta`), but all of them except the stable channel have to be
227227
manually configured by users in Gateway - which is super inconvenient.
228228

229+
## Supported Coder versions
230+
231+
`Coder Gateway` includes checks for compatibility with a specified version range. A warning is raised when
232+
the Coder deployment build version is outside of compatibility range:
233+
![Compatibility Check with Coder deployment](.github/readme/compatibility_check.png)
234+
235+
The range needs to be manually updated as often as possible. The lowest bound is specified by `minCompatibleCoderVersion`
236+
property in the [CoderSupportedVersions.properties](src/main/resources/version/CoderSupportedVersions.properties)
237+
while `maxCompatibleCoderVersion` specifies the upper bound.
238+
229239
[docs:qodana-github-action]: https://www.jetbrains.com/help/qodana/qodana-intellij-github-action.html
230240

231241
[docs:plugin-signing]: https://plugins.jetbrains.com/docs/intellij/plugin-signing.html?from=IJPluginTemplate

build.gradle.kts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ fun properties(key: String) = project.findProperty(key).toString()
66
plugins {
77
// Java support
88
id("java")
9+
// Groovy support
10+
id("groovy")
911
// Kotlin support
10-
id("org.jetbrains.kotlin.jvm") version "1.7.21"
12+
id("org.jetbrains.kotlin.jvm") version "1.7.22"
1113
// Gradle IntelliJ Plugin
1214
id("org.jetbrains.intellij") version "1.10.0"
1315
// Gradle Changelog Plugin
@@ -19,7 +21,6 @@ plugins {
1921
group = properties("pluginGroup")
2022
version = properties("pluginVersion")
2123

22-
val ktorVersion = properties("ktorVersion")
2324
dependencies {
2425
implementation("com.squareup.retrofit2:retrofit:2.9.0")
2526
// define a BOM and its version
@@ -31,6 +32,11 @@ dependencies {
3132
implementation("org.zeroturnaround:zt-exec:1.12") {
3233
exclude("org.slf4j")
3334
}
35+
36+
testImplementation(platform("org.apache.groovy:groovy-bom:4.0.6"))
37+
testImplementation("org.apache.groovy:groovy")
38+
testImplementation(platform("org.spockframework:spock-bom:2.3-groovy-4.0"))
39+
testImplementation("org.spockframework:spock-core")
3440
}
3541

3642
// Configure project's dependencies
@@ -91,7 +97,8 @@ tasks {
9197
compilerVersion.set(properties("instrumentationCompiler"))
9298
}
9399

94-
// TODO - this fails with linkage error, remove when it works
100+
// TODO - this fails with linkage error, but we don't need it now
101+
// because the plugin does not provide anything to search for in Preferences
95102
buildSearchableOptions {
96103
isEnabled = false
97104
}
@@ -122,6 +129,10 @@ tasks {
122129
})
123130
}
124131

132+
runIde {
133+
autoReloadPlugins.set(true)
134+
}
135+
125136
// Configure UI tests plugin
126137
// Read more: https://github.com/JetBrains/intellij-ui-test-robot
127138
runIdeForUiTests {
@@ -135,4 +146,8 @@ tasks {
135146
dependsOn("patchChangelog")
136147
token.set(System.getenv("PUBLISH_TOKEN"))
137148
}
149+
150+
test {
151+
useJUnitPlatform()
152+
}
138153
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
pluginGroup=com.coder.gateway
44
pluginName=coder-gateway
55
# SemVer format -> https://semver.org
6-
pluginVersion=2.1.2-eap.0
6+
pluginVersion=2.1.3-eap.0
77
# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
88
# for insight into build numbers and IntelliJ Platform versions.
99
pluginSinceBuild=223.7571.70

src/main/kotlin/com/coder/gateway/CoderGatewayConnectionProvider.kt

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ package com.coder.gateway
55
import com.coder.gateway.models.RecentWorkspaceConnection
66
import com.coder.gateway.services.CoderRecentWorkspaceConnectionsService
77
import com.intellij.openapi.components.service
8-
import com.intellij.openapi.diagnostic.Logger
98
import com.intellij.openapi.rd.util.launchUnderBackgroundProgress
109
import com.intellij.remote.AuthType
1110
import com.intellij.remote.RemoteCredentialsHolder
1211
import com.intellij.ssh.config.unified.SshConfig
1312
import com.jetbrains.gateway.api.ConnectionRequestor
1413
import com.jetbrains.gateway.api.GatewayConnectionHandle
1514
import com.jetbrains.gateway.api.GatewayConnectionProvider
15+
import com.jetbrains.gateway.api.GatewayUI
1616
import com.jetbrains.gateway.ssh.HighLevelHostAccessor
1717
import com.jetbrains.gateway.ssh.HostDeployInputs
1818
import com.jetbrains.gateway.ssh.IdeInfo
@@ -30,7 +30,6 @@ import java.time.format.DateTimeFormatter
3030
class CoderGatewayConnectionProvider : GatewayConnectionProvider {
3131
private val recentConnectionsService = service<CoderRecentWorkspaceConnectionsService>()
3232

33-
private val connections = mutableSetOf<CoderConnectionMetadata>()
3433
private val localTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MMM-dd HH:mm")
3534

3635
override suspend fun connect(parameters: Map<String, String>, requestor: ConnectionRequestor): GatewayConnectionHandle? {
@@ -42,11 +41,6 @@ class CoderGatewayConnectionProvider : GatewayConnectionProvider {
4241
val webTerminalLink = parameters["web_terminal_link"]!!
4342

4443
if (coderWorkspaceHostname != null && projectPath != null) {
45-
val connection = CoderConnectionMetadata(coderWorkspaceHostname)
46-
if (connection in connections) {
47-
logger.warn("There is already a connection started on ${connection.workspaceHostname}")
48-
return null
49-
}
5044
val sshConfiguration = SshConfig(true).apply {
5145
setHost(coderWorkspaceHostname)
5246
setUsername("coder")
@@ -89,27 +83,12 @@ class CoderGatewayConnectionProvider : GatewayConnectionProvider {
8983
}
9084

9185
recentConnectionsService.addRecentConnection(RecentWorkspaceConnection(coderWorkspaceHostname, projectPath, localTimeFormatter.format(LocalDateTime.now()), ideProductCode, ideBuildNumber, ideDownloadLink, webTerminalLink))
92-
93-
return object : GatewayConnectionHandle(clientLifetime) {
94-
override fun getTitle(): String {
95-
return "Connection to Coder Workspaces"
96-
}
97-
98-
override fun hideToTrayOnStart(): Boolean {
99-
return false
100-
}
101-
}
86+
GatewayUI.getInstance().reset()
10287
}
10388
return null
10489
}
10590

10691
override fun isApplicable(parameters: Map<String, String>): Boolean {
10792
return parameters["type"] == "coder"
10893
}
109-
110-
companion object {
111-
val logger = Logger.getInstance(CoderGatewayConnectionProvider::class.java.simpleName)
112-
}
113-
}
114-
115-
internal data class CoderConnectionMetadata(val workspaceHostname: String)
94+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.coder.gateway
2+
3+
import com.coder.gateway.sdk.CoderSemVer
4+
import com.intellij.DynamicBundle
5+
import org.jetbrains.annotations.NonNls
6+
import org.jetbrains.annotations.PropertyKey
7+
8+
@NonNls
9+
private const val BUNDLE = "version.CoderSupportedVersions"
10+
11+
object CoderSupportedVersions : DynamicBundle(BUNDLE) {
12+
val minCompatibleCoderVersion = CoderSemVer.parse(message("minCompatibleCoderVersion"))
13+
val maxCompatibleCoderVersion = CoderSemVer.parse(message("maxCompatibleCoderVersion"))
14+
15+
@JvmStatic
16+
@Suppress("SpreadOperator")
17+
private fun message(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any) = getMessage(key, *params)
18+
}

src/main/kotlin/com/coder/gateway/icons/CoderIcons.kt

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,54 @@ import com.intellij.openapi.util.IconLoader
55
object CoderIcons {
66
val LOGO = IconLoader.getIcon("coder_logo.svg", javaClass)
77
val LOGO_16 = IconLoader.getIcon("coder_logo_16.svg", javaClass)
8-
val LOGO_52 = IconLoader.getIcon("coder_logo_52.svg", javaClass)
98

109
val OPEN_TERMINAL = IconLoader.getIcon("open_terminal.svg", javaClass)
1110

11+
val HOME = IconLoader.getIcon("homeFolder.svg", javaClass)
12+
val CREATE = IconLoader.getIcon("create.svg", javaClass)
1213
val RUN = IconLoader.getIcon("run.svg", javaClass)
1314
val STOP = IconLoader.getIcon("stop.svg", javaClass)
1415
val UPDATE = IconLoader.getIcon("update.svg", javaClass)
16+
val DELETE = IconLoader.getIcon("delete.svg", javaClass)
1517

16-
val WINDOWS = IconLoader.getIcon("windows.svg", javaClass)
17-
val MACOS = IconLoader.getIcon("macOS.svg", javaClass)
18-
val LINUX = IconLoader.getIcon("linux.svg", javaClass)
1918
val UNKNOWN = IconLoader.getIcon("unknown.svg", javaClass)
2019

21-
val GREEN_CIRCLE = IconLoader.getIcon("green_circle.svg", javaClass)
22-
val GRAY_CIRCLE = IconLoader.getIcon("gray_circle.svg", javaClass)
23-
val RED_CIRCLE = IconLoader.getIcon("red_circle.svg", javaClass)
20+
val ZERO = IconLoader.getIcon("0.svg", javaClass)
21+
val ONE = IconLoader.getIcon("1.svg", javaClass)
22+
val TWO = IconLoader.getIcon("2.svg", javaClass)
23+
val THREE = IconLoader.getIcon("3.svg", javaClass)
24+
val FOUR = IconLoader.getIcon("4.svg", javaClass)
25+
val FIVE = IconLoader.getIcon("5.svg", javaClass)
26+
val SIX = IconLoader.getIcon("6.svg", javaClass)
27+
val SEVEN = IconLoader.getIcon("7.svg", javaClass)
28+
val EIGHT = IconLoader.getIcon("8.svg", javaClass)
29+
val NINE = IconLoader.getIcon("9.svg", javaClass)
30+
31+
val A = IconLoader.getIcon("a.svg", javaClass)
32+
val B = IconLoader.getIcon("b.svg", javaClass)
33+
val C = IconLoader.getIcon("c.svg", javaClass)
34+
val D = IconLoader.getIcon("d.svg", javaClass)
35+
val E = IconLoader.getIcon("e.svg", javaClass)
36+
val F = IconLoader.getIcon("f.svg", javaClass)
37+
val G = IconLoader.getIcon("g.svg", javaClass)
38+
val H = IconLoader.getIcon("h.svg", javaClass)
39+
val I = IconLoader.getIcon("i.svg", javaClass)
40+
val J = IconLoader.getIcon("j.svg", javaClass)
41+
val K = IconLoader.getIcon("k.svg", javaClass)
42+
val L = IconLoader.getIcon("l.svg", javaClass)
43+
val M = IconLoader.getIcon("m.svg", javaClass)
44+
val N = IconLoader.getIcon("n.svg", javaClass)
45+
val O = IconLoader.getIcon("o.svg", javaClass)
46+
val P = IconLoader.getIcon("p.svg", javaClass)
47+
val Q = IconLoader.getIcon("q.svg", javaClass)
48+
val R = IconLoader.getIcon("r.svg", javaClass)
49+
val S = IconLoader.getIcon("s.svg", javaClass)
50+
val T = IconLoader.getIcon("t.svg", javaClass)
51+
val U = IconLoader.getIcon("u.svg", javaClass)
52+
val V = IconLoader.getIcon("v.svg", javaClass)
53+
val W = IconLoader.getIcon("w.svg", javaClass)
54+
val X = IconLoader.getIcon("x.svg", javaClass)
55+
val Y = IconLoader.getIcon("y.svg", javaClass)
56+
val Z = IconLoader.getIcon("z.svg", javaClass)
2457

25-
val DELETE = IconLoader.getIcon("delete.svg", javaClass)
2658
}

src/main/kotlin/com/coder/gateway/models/WorkspaceAgentModel.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ import com.coder.gateway.sdk.Arch
44
import com.coder.gateway.sdk.OS
55
import com.coder.gateway.sdk.v2.models.WorkspaceTransition
66
import java.util.UUID
7+
import javax.swing.Icon
78

89
data class WorkspaceAgentModel(
910
val workspaceID: UUID,
1011
val workspaceName: String,
1112
val name: String,
1213
val templateID: UUID,
1314
val templateName: String,
15+
val templateIcon: Icon,
1416
val status: WorkspaceVersionStatus,
1517
val agentStatus: WorkspaceAgentStatus,
1618
val lastBuildTransition: WorkspaceTransition,

src/main/kotlin/com/coder/gateway/sdk/CoderCLIDownloader.kt

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)