Skip to content

Add "Check for IDE updates" setting #525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -4,6 +4,9 @@

## Unreleased

- Added setting "Check for IDE updates" which controls whether the plugin
checks and prompts for available IDE backend updates.

## 2.16.0 - 2025-01-17

### Added
Original file line number Diff line number Diff line change
@@ -93,7 +93,7 @@ class CoderRemoteConnectionHandle {
},
true,
)
if (attempt == 1) {
if (settings.checkIDEUpdate && attempt == 1) {
// See if there is a newer (non-EAP) version of the IDE available.
checkUpdate(accessor, parameters, indicator)?.let { update ->
// Store the old IDE to delete later.
Original file line number Diff line number Diff line change
@@ -157,6 +157,13 @@ class CoderSettingsConfigurable : BoundConfigurable("Coder") {
"Example format: CL 2023.3.6 233.15619.8",
)
}
row(CoderGatewayBundle.message("gateway.connector.settings.check-ide-updates.heading")) {
checkBox(CoderGatewayBundle.message("gateway.connector.settings.check-ide-updates.title"))
.bindSelected(state::checkIDEUpdates)
.comment(
CoderGatewayBundle.message("gateway.connector.settings.check-ide-updates.comment"),
)
}.layout(RowLayout.PARENT_GRID)
}
}

8 changes: 8 additions & 0 deletions src/main/kotlin/com/coder/gateway/settings/CoderSettings.kt
Original file line number Diff line number Diff line change
@@ -102,6 +102,8 @@ open class CoderSettingsState(
open var workspaceFilter: String = "owner:me",
// Default version of IDE to display in IDE selection dropdown
open var defaultIde: String = "",
// Whether to check for IDE updates.
open var checkIDEUpdates: Boolean = true,
)

/**
@@ -182,6 +184,12 @@ open class CoderSettings(
val defaultIde: String
get() = state.defaultIde

/**
* Whether to check for IDE updates.
*/
val checkIDEUpdate: Boolean
get() = state.checkIDEUpdates

/**
* Whether to ignore a failed setup command.
*/
6 changes: 6 additions & 0 deletions src/main/resources/messages/CoderGatewayBundle.properties
Original file line number Diff line number Diff line change
@@ -139,3 +139,9 @@ gateway.connector.settings.workspace-filter.comment=The filter to apply when \
which can be slow with many workspaces, and it adds every agent to the SSH \
config, which can result in a large SSH config with many workspaces.
gateway.connector.settings.default-ide=Default IDE Selection
gateway.connector.settings.check-ide-updates.heading=IDE version check
gateway.connector.settings.check-ide-updates.title=Check for IDE updates
gateway.connector.settings.check-ide-updates.comment=Checking this box will \
cause the plugin to check for available IDE backend updates and prompt \
with an option to upgrade if a newer version is available.


Unchanged files with check annotations Beta

coderConfigPath.toString(),
"start",
"--yes",
workspaceOwner+"/"+workspaceName,

Check notice on line 465 in src/main/kotlin/com/coder/gateway/cli/CoderCLIManager.kt

GitHub Actions / Build

String concatenation that can be converted to string template

'String' concatenation can be converted to a template
)
}
@JvmStatic
fun getBackgroundHostName(
hostname: String,
): String = hostname + "--bg"

Check notice on line 539 in src/main/kotlin/com/coder/gateway/cli/CoderCLIManager.kt

GitHub Actions / Build

String concatenation that can be converted to string template

'String' concatenation can be converted to a template
}
}
init {
init()
title = CoderGatewayBundle.message("gateway.connector.view.coder.remoteproject.choose.text", CoderCLIManager.getWorkspaceParts(state.workspace, state.agent))

Check warning on line 41 in src/main/kotlin/com/coder/gateway/util/Dialogs.kt

GitHub Actions / Build

Incorrect string capitalization

String 'Choose IDE and project for workspace {0}' is not properly capitalized. It should have title capitalization
}
override fun show() {
)
// Check the provided setting to see if there's a default IDE to set.
val defaultIde = ides.find { it ->

Check notice on line 272 in src/main/kotlin/com/coder/gateway/views/steps/CoderWorkspaceProjectIDEStepView.kt

GitHub Actions / Build

Redundant lambda arrow

Redundant lambda arrow
// Using contains on the displayable version of the ide means they can be as specific or as vague as they want
// CL 2023.3.6 233.15619.8 -> a specific Clion build
// CL 2023.3.6 -> a specific Clion version
}
private class WorkspaceVersionColumnInfo(columnName: String) : ColumnInfo<WorkspaceAgentListModel, String>(columnName) {
override fun valueOf(workspace: WorkspaceAgentListModel?): String? = if (workspace == null) {

Check warning on line 913 in src/main/kotlin/com/coder/gateway/views/steps/CoderWorkspacesStepView.kt

GitHub Actions / Build

Redundant nullable return type

'valueOf' always returns non-null type
"Unknown"
} else if (workspace.workspace.outdated) {
"Outdated"