Skip to content

Add agent name in workspaces rows + Fetch workspaces resources from latestBuild instead of templateversions api #489

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 3 commits into from
Oct 2, 2024
Merged
Changes from 2 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
2 changes: 1 addition & 1 deletion src/main/kotlin/com/coder/gateway/sdk/CoderRestClient.kt
Original file line number Diff line number Diff line change
@@ -182,7 +182,7 @@ open class CoderRestClient(
// It is possible for there to be resources with duplicate names so we
// need to use a set.
return workspaces.flatMap { ws ->
resources(ws).filter { it.agents != null }.flatMap { it.agents!! }.map {
ws.latestBuild.resources.filter { it.agents != null }.flatMap { it.agents!! }.map {
"${ws.name}.${it.name}"
}
}.toSet()
Original file line number Diff line number Diff line change
@@ -176,7 +176,7 @@
if (deploymentError != null) {
Triple(UIUtil.getErrorForeground(), deploymentError, UIUtil.getBalloonErrorIcon())
} else if (workspaceWithAgent != null) {
val inLoadingState = listOf(WorkspaceStatus.STARTING, WorkspaceStatus.CANCELING, WorkspaceStatus.DELETING, WorkspaceStatus.STOPPING).contains(workspaceWithAgent?.workspace?.latestBuild?.status)

Check warning on line 179 in src/main/kotlin/com/coder/gateway/views/CoderGatewayRecentWorkspaceConnectionsView.kt

GitHub Actions / Build

Usage of redundant or deprecated syntax or deprecated symbols

Unnecessary safe call on a non-null receiver of type WorkspaceAgentListModel?

Triple(
workspaceWithAgent.status.statusColor(),
@@ -244,7 +244,7 @@
foreground = Color.GRAY
}
}
label("").resizableColumn().align(AlignX.FILL)
label(workspaceProjectIDE.name.replace(workspaceName+".","")).resizableColumn()

Check notice on line 247 in src/main/kotlin/com/coder/gateway/views/CoderGatewayRecentWorkspaceConnectionsView.kt

GitHub Actions / Build

String concatenation that can be converted to string template

'String' concatenation can be converted to a template
label(workspaceProjectIDE.ideName).applyToComponent {
foreground = JBUI.CurrentTheme.ContextHelp.FOREGROUND
font = ComponentPanelBuilder.getCommentFont(font)

Unchanged files with check annotations Beta

@JvmStatic
fun getBackgroundHostName(
hostname: String,
): String = hostname + "--bg"

Check notice on line 496 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", name)

Check warning on line 42 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() {
}
private class WorkspaceVersionColumnInfo(columnName: String) : ColumnInfo<WorkspaceAgentListModel, String>(columnName) {
override fun valueOf(workspace: WorkspaceAgentListModel?): String? = if (workspace == null) {

Check warning on line 882 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"