Skip to content

Commit 7335f81

Browse files
authored
feat(amazonq): limit remote to amzn-internal compute (#5993)
Per internal discussion, feature deemed not ready for external users due to https://youtrack.jetbrains.com/issue/IJPL-203169
1 parent 90c7327 commit 7335f81

File tree

1 file changed

+21
-1
lines changed
  • plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/utils

1 file changed

+21
-1
lines changed

plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/utils/RemoteEnvUtils.kt

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ package software.aws.toolkits.jetbrains.utils
55

66
import com.intellij.idea.AppMode
77
import com.intellij.ui.jcef.JBCefApp
8+
import software.aws.toolkits.core.utils.exists
9+
import software.aws.toolkits.core.utils.tryOrNull
10+
import software.aws.toolkits.jetbrains.isDeveloperMode
11+
import java.nio.file.Paths
812

913
/**
1014
* @return true if running in any type of remote environment
@@ -16,4 +20,20 @@ fun isRunningOnRemoteBackend() = AppMode.isRemoteDevHost()
1620
*/
1721
fun isCodeCatalystDevEnv() = System.getenv("__DEV_ENVIRONMENT_ID") != null
1822

19-
fun isQWebviewsAvailable() = JBCefApp.isSupported()
23+
/**
24+
* @return low fidelity "is internal compute". is not exact and may fail at any time
25+
*/
26+
private val isInternalAmznLinuxCompute by lazy {
27+
tryOrNull {
28+
Paths.get("/apollo").exists()
29+
} ?: false
30+
}
31+
32+
/**
33+
* On remote, only enabled experimentally and for internal
34+
*/
35+
fun isQWebviewsAvailable() = JBCefApp.isSupported() && if (!isRunningOnRemoteBackend()) {
36+
true
37+
} else {
38+
isDeveloperMode() || isInternalAmznLinuxCompute
39+
}

0 commit comments

Comments
 (0)