Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

impl: add the option to disable ssh wildcard configuration#584

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fioan89 merged 9 commits intomainfromimpl-support-for-disabling-wildcard-config
Oct 1, 2025
Merged
Show file tree
Hide file tree
Changes from1 commit
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
PrevPrevious commit
NextNext commit
impl: ability to start a recent workspace connection after ssh wildca…
…rd config was changedCurrently, if a user starts a connection with wildcard enabled and then later on it disablesthe wildcard config then the recent connections becomes unusable because the hostnames are invalid.The issue can reproduce the other way around as well (start with wildcard ssh config disabled,start an IDE and then later on enable wildcard config)This commit addresses the issue by resolving the hostname on demand when the user wants toopen the remote IDE from the recent connections panel.
  • Loading branch information
@fioan89
fioan89 committedSep 30, 2025
commitdac5c717e3899b13c7b314dbf1948b5d5288d047
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,7 +18,7 @@ private val NON_STABLE_RELEASE_TYPES = setOf("EAP", "RC", "NIGHTLY", "PREVIEW")
* Validated parameters for downloading and opening a project using an IDE on a
* workspace.
*/
class WorkspaceProjectIDE(
dataclass WorkspaceProjectIDE(
// Either `workspace.agent` for old connections or `user/workspace.agent`
// for new connections.
val name: String,
Expand Down
16 changes: 16 additions & 0 deletionssrc/main/kotlin/com/coder/gateway/util/Without.kt
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -14,6 +14,22 @@ fun <A, Z> withoutNull(
return block(a)
}

/**
* Run block with provided arguments after checking they are all non-null. This
* is to enforce non-null values and should be used to signify developer error.
*/
fun <A, B, C, Z> withoutNull(
a: A?,
b: B?,
c: C?,
block: (a: A, b: B, c: C) -> Z,
): Z {
if (a == null || b == null || c == null) {
throw Exception("Unexpected null value")
}
return block(a, b, c)
}

/**
* Run block with provided arguments after checking they are all non-null. This
* is to enforce non-null values and should be used to signify developer error.
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,7 @@ package com.coder.gateway.views
import com.coder.gateway.CoderGatewayBundle
import com.coder.gateway.CoderGatewayConstants
import com.coder.gateway.CoderRemoteConnectionHandle
import com.coder.gateway.cli.CoderCLIManager
import com.coder.gateway.cli.ensureCLI
import com.coder.gateway.icons.CoderIcons
import com.coder.gateway.models.WorkspaceAgentListModel
Expand DownExpand Up@@ -177,6 +178,7 @@ class CoderGatewayRecentWorkspaceConnectionsView(private val setContentCallback:
it.workspace.ownerName + "/" + it.workspace.name == workspaceName ||
(it.workspace.ownerName == me && it.workspace.name == workspaceName)
}

val status =
if (deploymentError != null) {
Triple(UIUtil.getErrorForeground(), deploymentError, UIUtil.getBalloonErrorIcon())
Expand DownExpand Up@@ -250,10 +252,11 @@ class CoderGatewayRecentWorkspaceConnectionsView(private val setContentCallback:
ActionLink(workspaceProjectIDE.projectPathDisplay) {
withoutNull(
deployment?.client,
workspaceWithAgent?.workspace
) { client, workspace ->
workspaceWithAgent?.workspace,
workspaceWithAgent?.agent
) { client, workspace, agent ->
CoderRemoteConnectionHandle().connect {
if (listOf(
val cli =if (listOf(
WorkspaceStatus.STOPPED,
WorkspaceStatus.CANCELED,
WorkspaceStatus.FAILED
Expand All@@ -272,8 +275,21 @@ class CoderGatewayRecentWorkspaceConnectionsView(private val setContentCallback:
}

cli.startWorkspace(workspace.ownerName, workspace.name)
cli
} else {
CoderCLIManager(deploymentURL.toURL(), settings)
}
workspaceProjectIDE
// the ssh config could have changed in the meantime
// so we want to make sure we use a proper hostname
// depending on whether the ssh wildcard config
// is enabled, otherwise the connection will fail.
workspaceProjectIDE.copy(
hostname = cli.getHostName(
workspace,
client.me(),
agent
)
)
}
GatewayUI.getInstance().reset()
}
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp