Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 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
Prev Previous commit
chore: improve logging when user hits next/back buttons
  • Loading branch information
fioan89 committed Jan 27, 2023
commit 3ec4e105b964f0d95caff4f7e45af510d602c340
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package com.coder.gateway

import com.coder.gateway.services.CoderRecentWorkspaceConnectionsService
import com.intellij.openapi.components.service
import com.intellij.openapi.diagnostic.Logger
import com.intellij.openapi.rd.util.launchUnderBackgroundProgress
import com.jetbrains.gateway.api.ConnectionRequestor
import com.jetbrains.gateway.api.GatewayConnectionHandle
Expand All @@ -22,6 +23,7 @@ class CoderGatewayConnectionProvider : GatewayConnectionProvider {
val clientLifetime = LifetimeDefinition()
clientLifetime.launchUnderBackgroundProgress(CoderGatewayBundle.message("gateway.connector.coder.connection.provider.title"), canBeCancelled = true, isIndeterminate = true, project = null) {
val context = SshMultistagePanelContext(parameters.toHostDeployInputs())
logger.info("Deploying and starting IDE with $context")
launch {
@Suppress("UnstableApiUsage") SshDeployFlowUtil.fullDeployCycle(
clientLifetime, context, Duration.ofMinutes(10)
Expand All @@ -37,4 +39,8 @@ class CoderGatewayConnectionProvider : GatewayConnectionProvider {
override fun isApplicable(parameters: Map<String, String>): Boolean {
return parameters.areCoderType()
}

companion object {
val logger = Logger.getInstance(CoderGatewayConnectionProvider::class.java.simpleName)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ class CoderLocateRemoteProjectStepView(private val disableNextAction: () -> Unit

override fun onNext(wizardModel: CoderWorkspacesWizardModel): Boolean {
val selectedIDE = cbIDE.selectedItem ?: return false
logger.info("Going to launch the IDE")
cs.launch {
GatewayUI.getInstance().connect(
selectedIDE
Expand All @@ -234,6 +235,7 @@ class CoderLocateRemoteProjectStepView(private val disableNextAction: () -> Unit

override fun onPrevious() {
super.onPrevious()
logger.info("Going back to Workspace view")
cs.launch {
ideResolvingJob.cancelAndJoin()
}
Expand All @@ -243,10 +245,6 @@ class CoderLocateRemoteProjectStepView(private val disableNextAction: () -> Unit
cs.cancel()
}

companion object {
val logger = Logger.getInstance(CoderLocateRemoteProjectStepView::class.java.simpleName)
}

private class IDEComboBox(model: ComboBoxModel<IdeWithStatus>) : ComboBox<IdeWithStatus>(model) {

init {
Expand Down Expand Up @@ -284,4 +282,8 @@ class CoderLocateRemoteProjectStepView(private val disableNextAction: () -> Unit
}
}
}

companion object {
val logger = Logger.getInstance(CoderLocateRemoteProjectStepView::class.java.simpleName)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@ class CoderWorkspacesStepView(val enableNextButtonCallback: (Boolean) -> Unit) :

override fun onPrevious() {
super.onPrevious()
logger.info("Going back to the main view")
poller?.cancel()
}

Expand Down Expand Up @@ -621,6 +622,7 @@ class CoderWorkspacesStepView(val enableNextButtonCallback: (Boolean) -> Unit) :
if (workspace != null) {
wizardModel.selectedWorkspace = workspace
poller?.cancel()
logger.info("Opening IDE and Project Location window for ${workspace.name}")
return true
}
return false
Expand Down