Skip to content

Commit 73a5013

Browse files
authored
Redo our deprecation notice, notify about upcoming 202 deprecation (#2706)
1 parent eaf968e commit 73a5013

File tree

10 files changed

+220
-305
lines changed

10 files changed

+220
-305
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "deprecation",
3+
"description" : "An upcoming release will remove support for IDEs based on the 2020.2 platform"
4+
}

jetbrains-core/resources/META-INF/plugin.xml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ with what features/services are supported.
119119
<extensionPoint name="executable" interface="software.aws.toolkits.jetbrains.core.executables.ExecutableType" dynamic="true"/>
120120

121121
<extensionPoint name="clouddebug.debuggerSupport" interface="software.aws.toolkits.jetbrains.services.clouddebug.DebuggerSupport" dynamic="true"/>
122-
<extensionPoint name="notice" interface="software.aws.toolkits.jetbrains.core.notification.NoticeType" dynamic="true"/>
123122

124123
<extensionPoint name="explorer.serviceNode" interface="software.aws.toolkits.jetbrains.core.explorer.nodes.AwsExplorerServiceNode" dynamic="true"/>
125124
<extensionPoint name="explorer.nodeProcessor" interface="software.aws.toolkits.jetbrains.core.explorer.AwsExplorerNodeProcessor" dynamic="true"/>
@@ -161,7 +160,6 @@ with what features/services are supported.
161160
<statusBarWidgetFactory implementation="software.aws.toolkits.jetbrains.core.credentials.AwsSettingsPanelInstaller"/>
162161

163162
<postStartupActivity implementation="software.aws.toolkits.jetbrains.core.AwsTelemetryPrompter"/>
164-
<postStartupActivity implementation="software.aws.toolkits.jetbrains.core.notification.NoticeStartupActivity"/>
165163
<postStartupActivity implementation="software.aws.toolkits.jetbrains.core.executables.ExecutableLoader"/>
166164

167165
<applicationService serviceInterface="software.aws.toolkits.core.clients.SdkClientProvider"
@@ -171,8 +169,6 @@ with what features/services are supported.
171169
testServiceImplementation="software.aws.toolkits.jetbrains.services.telemetry.MockTelemetryService" />
172170
<applicationService serviceInterface="software.aws.toolkits.jetbrains.core.executables.ExecutableManager"
173171
serviceImplementation="software.aws.toolkits.jetbrains.core.executables.DefaultExecutableManager"/>
174-
<applicationService serviceInterface="software.aws.toolkits.jetbrains.core.notification.NoticeManager"
175-
serviceImplementation="software.aws.toolkits.jetbrains.core.notification.DefaultNoticeManager"/>
176172
<applicationService serviceInterface="software.aws.toolkits.core.ToolkitClientManager"
177173
serviceImplementation="software.aws.toolkits.jetbrains.core.AwsClientManager"
178174
testServiceImplementation="software.aws.toolkits.jetbrains.core.MockClientManager"/>
@@ -207,6 +203,10 @@ with what features/services are supported.
207203
<runConfigurationProducer implementation="software.aws.toolkits.jetbrains.services.lambda.execution.local.LocalLambdaRunConfigurationProducer"/>
208204
<runConfigurationProducer implementation="software.aws.toolkits.jetbrains.services.lambda.execution.remote.RemoteLambdaRunConfigurationProducer"/>
209205

206+
<!-- Min Version Notice -->
207+
<postStartupActivity implementation="software.aws.toolkits.jetbrains.core.notification.MinimumVersionChange"/>
208+
<!-- TODO: Migrate to this FIX_WHEN_MIN_IS_203 <notificationGroup id="aws.toolkit_deprecation" displayType="STICKY_BALLOON" key="aws.toolkit_deprecation.title"/> -->
209+
210210
<!-- ECS -->
211211
<configurationType implementation="software.aws.toolkits.jetbrains.services.ecs.execution.EcsCloudDebugRunConfigurationType"/>
212212
<programRunner implementation="software.aws.toolkits.jetbrains.services.clouddebug.execution.CloudDebuggingRunner"/>
@@ -248,8 +248,6 @@ with what features/services are supported.
248248
<explorer.nodeProcessor implementation="software.aws.toolkits.jetbrains.services.clouddebug.CloudDebuggingExplorerProcessor" />
249249
<explorer.treeStructure implementation="software.aws.toolkits.jetbrains.services.clouddebug.CloudDebuggingExplorerTreeStructureProvider"/>
250250

251-
<notice implementation="software.aws.toolkits.jetbrains.core.notification.JetBrainsMinimumVersionChange"/>
252-
253251
<!-- Explorer nodes -->
254252
<explorer.serviceNode implementation="software.aws.toolkits.jetbrains.core.explorer.nodes.AppRunnerExplorerRootNode"/>
255253
<explorer.serviceNode implementation="software.aws.toolkits.jetbrains.core.explorer.nodes.CloudFormationExplorerRootNode"/>

jetbrains-core/src/software/aws/toolkits/jetbrains/core/notification/JetBrainsMinimumVersionChange.kt

Lines changed: 0 additions & 44 deletions
This file was deleted.
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
// Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package software.aws.toolkits.jetbrains.core.notification
5+
6+
import com.intellij.ide.util.PropertiesComponent
7+
import com.intellij.notification.NotificationAction
8+
import com.intellij.notification.NotificationDisplayType
9+
import com.intellij.notification.NotificationGroup
10+
import com.intellij.notification.NotificationType
11+
import com.intellij.openapi.application.ApplicationInfo
12+
import com.intellij.openapi.application.ApplicationManager
13+
import com.intellij.openapi.application.ApplicationNamesInfo
14+
import com.intellij.openapi.extensions.ExtensionNotApplicableException
15+
import com.intellij.openapi.project.Project
16+
import com.intellij.openapi.startup.StartupActivity
17+
import software.aws.toolkits.resources.message
18+
19+
class MinimumVersionChange @JvmOverloads constructor(isUnderTest: Boolean = false) : StartupActivity.DumbAware {
20+
init {
21+
if (ApplicationManager.getApplication().isUnitTestMode && !isUnderTest) {
22+
throw ExtensionNotApplicableException.INSTANCE
23+
}
24+
}
25+
26+
override fun runActivity(project: Project) {
27+
if (System.getProperty(SKIP_PROMPT)?.toBoolean() == true) {
28+
return
29+
}
30+
31+
// Setting is stored application wide
32+
if (PropertiesComponent.getInstance().getBoolean(IGNORE_PROMPT)) {
33+
return
34+
}
35+
36+
if (ApplicationInfo.getInstance().build.baselineVersion >= MIN_VERSION) {
37+
return
38+
}
39+
40+
val title = message("aws.toolkit_deprecation.title")
41+
val message = message(
42+
"aws.toolkit_deprecation.message",
43+
ApplicationNamesInfo.getInstance().fullProductName,
44+
ApplicationInfo.getInstance().fullVersion,
45+
MIN_VERSION_HUMAN
46+
)
47+
48+
// TODO: Migrate to this FIX_WHEN_MIN_IS_203
49+
// val notificationGroup = NotificationGroupManager.getInstance().getNotificationGroup("aws.toolkit_deprecation")
50+
NOTIFICATION_GROUP.createNotification(title, message, NotificationType.WARNING)
51+
.addAction(
52+
NotificationAction.createSimpleExpiring(message("general.notification.action.hide_forever")) {
53+
PropertiesComponent.getInstance().setValue(IGNORE_PROMPT, true)
54+
}
55+
)
56+
.notify(project)
57+
}
58+
59+
companion object {
60+
const val MIN_VERSION = 203
61+
const val MIN_VERSION_HUMAN = "2020.3"
62+
63+
// Used by tests to make sure the prompt never shows up
64+
const val SKIP_PROMPT = "aws.suppress_deprecation_prompt"
65+
const val IGNORE_PROMPT = "aws.ignore_deprecation_prompt"
66+
67+
private val NOTIFICATION_GROUP = NotificationGroup(
68+
"aws.toolkit_deprecation",
69+
NotificationDisplayType.STICKY_BALLOON,
70+
true,
71+
null,
72+
null,
73+
message("aws.toolkit_deprecation.title"),
74+
)
75+
}
76+
}

jetbrains-core/src/software/aws/toolkits/jetbrains/core/notification/NoticeManager.kt

Lines changed: 0 additions & 94 deletions
This file was deleted.

jetbrains-core/src/software/aws/toolkits/jetbrains/core/notification/NoticeStartupActivity.kt

Lines changed: 0 additions & 18 deletions
This file was deleted.

jetbrains-core/src/software/aws/toolkits/jetbrains/core/notification/NoticeType.kt

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)