Skip to content

Commit 7217be7

Browse files
Merge pull request #6352 from microsoft/endgame-202201
Endgame 202201
2 parents 7eede27 + 25e441f commit 7217be7

File tree

8 files changed

+24
-49
lines changed

8 files changed

+24
-49
lines changed

CHANGELOG.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,8 @@ All notable changes to "Azure Toolkit for IntelliJ IDEA" will be documented in t
9494
- No default Offer/Sku/Image are selected in "Select VM Image" dialog.
9595
- Validation passed in Create VM dialog even Maximum price per hour is empty.
9696
- Some modified values will be changed to default when switch back to "More settings" in "Create App Service" dialog.
97-
- Can't create new security group from "Create VM" dialog.
9897
- Validation message is not right when selected subscription has no spring cloud service.
9998
- Tooltips on nodes in azure explorer are not correct.
100-
- Error occurs when Docker Run.
10199
- Error occurs when run or deploy after docker support is added.
102100
- Icon of action "Open by Database Tools" for PostgreSQL is missing.
103101

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-lib/src/main/resources/whatsnew.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@
1616
- No default Offer/Sku/Image are selected in "Select VM Image" dialog.
1717
- Validation passed in Create VM dialog even Maximum price per hour is empty.
1818
- Some modified values will be changed to default when switch back to "More settings" in "Create App Service" dialog
19-
- Can't create new security group from "Create VM" dialog
2019
- Validation message is not right when selected subscription has no spring cloud service
2120
- Tooltips on nodes in azure explorer are not correct.
22-
- Error occurs when Docker Run.
2321
- Error occurs when run or deploy after docker support is added.
2422
- Icon of action "Open by Database Tools" for PostgreSQL is missing.
2523

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-springcloud/src/main/java/com/microsoft/azure/toolkit/intellij/springcloud/component/SpringCloudAppConfigPanel.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,6 @@ public synchronized void updateForm(@Nonnull SpringCloudApp app) {
151151
this.numInstance.setMinorTickSpacing(basic ? 1 : 10);
152152
this.numInstance.setMinimum(0);
153153
this.numInstance.updateLabels();
154-
AzureTaskManager.getInstance().runOnPooledThread(() -> {
155-
final int size = Optional.ofNullable(app.getActiveDeployment())
156-
.or(() -> Optional.ofNullable(app.deployments().get("default", app.getResourceGroupName())))
157-
.map(d -> d.getInstances().size()).orElse(0);
158-
final Runnable task = () -> this.numInstance.setRealMin(Math.min(size, app.getFormalStatus().isStopped() ? 0 : 1));
159-
AzureTaskManager.getInstance().runLater(task, AzureTask.Modality.ANY);
160-
});
161154
}
162155

163156
@Contract("_->_")

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-springcloud/src/main/java/com/microsoft/azure/toolkit/intellij/springcloud/deplolyment/SpringCloudDeploymentConfigurationPanel.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,18 +102,23 @@ private void onClusterChanger(final ItemEvent e) {
102102
}
103103

104104
@Override
105-
public synchronized void setValue(SpringCloudAppConfig appConfig) {
105+
public synchronized void setValue(@Nonnull SpringCloudAppConfig appConfig) {
106+
final String clusterName = appConfig.getClusterName();
107+
final String appName = appConfig.getAppName();
108+
final String resourceGroup = appConfig.getResourceGroup();
109+
if (StringUtils.isAnyBlank(clusterName, appName)) {
110+
return;
111+
}
106112
AzureTaskManager.getInstance().runOnPooledThread(() -> {
107-
final String resourceGroup = appConfig.getResourceGroup();
108113
final SpringCloudCluster cluster = Optional.of(Azure.az(AzureSpringCloud.class))
109114
.map(az -> az.clusters(appConfig.getSubscriptionId()))
110-
.map(cs -> cs.get(appConfig.getClusterName(), appConfig.getResourceGroup()))
115+
.map(cs -> cs.get(clusterName, resourceGroup))
111116
.orElse(null);
112117
final SpringCloudApp app = Optional.ofNullable(cluster)
113-
.map(c -> c.apps().get(appConfig.getAppName(), resourceGroup))
118+
.map(c -> c.apps().get(appName, resourceGroup))
114119
.orElse(null);
115120
if (Objects.nonNull(cluster) && Objects.isNull(app)) {
116-
final SpringCloudAppDraft draft = cluster.apps().create(appConfig.getAppName(), appConfig.getResourceGroup());
121+
final SpringCloudAppDraft draft = cluster.apps().create(appName, resourceGroup);
117122
draft.setConfig(appConfig);
118123
this.selectorApp.addLocalItem(draft);
119124
}
@@ -124,7 +129,7 @@ public synchronized void setValue(SpringCloudAppConfig appConfig) {
124129
.ifPresent((a -> this.selectorArtifact.setArtifact(a.getArtifact())));
125130
Optional.ofNullable(appConfig.getSubscriptionId())
126131
.ifPresent((id -> this.selectorSubscription.setValue(new ItemReference<>(id, Subscription::getId))));
127-
Optional.ofNullable(appConfig.getClusterName())
132+
Optional.ofNullable(clusterName)
128133
.ifPresent((id -> this.selectorCluster.setValue(new ItemReference<>(id, SpringCloudCluster::name))));
129134
Optional.ofNullable(appConfig.getAppName())
130135
.ifPresent((id -> this.selectorApp.setValue(new ItemReference<>(id, SpringCloudApp::name))));

PluginsAndFeatures/azure-toolkit-for-intellij/src/main/resources/META-INF/plugin.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<change-notes>
2626
<![CDATA[
2727
<html>
28-
<h3>3.60.0</h3>
28+
<h3>3.61.0</h3>
2929
<h4>Added</h4>
3030
<ul>
3131
<li>Add a placeholder tree node in Azure Explorer for resource that is being created.</li>
@@ -45,10 +45,8 @@
4545
<li>No default Offer/Sku/Image are selected in "Select VM Image" dialog.</li>
4646
<li>Validation passed in Create VM dialog even Maximum price per hour is empty.</li>
4747
<li>Some modified values will be changed to default when switch back to "More settings" in "Create App Service" dialog.</li>
48-
<li>Can't create new security group from "Create VM" dialog.</li>
4948
<li>Validation message is not right when selected subscription has no spring cloud service.</li>
5049
<li>Tooltips on nodes in azure explorer are not correct.</li>
51-
<li>Error occurs when Docker Run.</li>
5250
<li>Error occurs when run or deploy after docker support is added.</li>
5351
<li>Icon of action "Open by Database Tools" for PostgreSQL is missing.</li>
5452
<ul>

Utils/azure-toolkit-ide-libs/azure-toolkit-ide-appservice-lib/src/main/java/com/microsoft/azure/toolkit/ide/appservice/webapp/WebAppExplorerContributor.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
import com.microsoft.azure.toolkit.lib.appservice.model.OperatingSystem;
2020
import com.microsoft.azure.toolkit.lib.appservice.service.IAppService;
2121
import com.microsoft.azure.toolkit.lib.appservice.service.impl.WebApp;
22-
import com.microsoft.azure.toolkit.lib.common.event.AzureEventBus;
23-
import com.microsoft.azure.toolkit.lib.common.task.AzureTaskManager;
2422

2523
import java.util.Arrays;
2624
import java.util.Collections;
@@ -52,13 +50,8 @@ public Node<?> getModuleNode() {
5250
}
5351

5452
private static AzureIcon.Modifier getOperatingSystemModifier(IAppService<?> resource) {
55-
if (resource.getRawEntity() == null) {
56-
// do not add os modifier in loading status as runtime request may have high cost
57-
AzureTaskManager.getInstance().runOnPooledThreadAsObservable(resource::getRuntime)
58-
.subscribe(ignore -> AzureEventBus.emit("resource.status_changed.resource", resource));
59-
return null;
60-
}
61-
return resource.getRuntime().getOperatingSystem() != OperatingSystem.WINDOWS ? AzureIcon.Modifier.LINUX : null;
53+
return resource.getFormalStatus().isWaiting() ? null :
54+
resource.getRuntime().getOperatingSystem() != OperatingSystem.WINDOWS ? AzureIcon.Modifier.LINUX : null;
6255
}
6356

6457
private static List<WebApp> listWebApps(AzureWebApp webAppModule) {

Utils/azure-toolkit-ide-libs/azure-toolkit-ide-appservice-lib/src/main/java/com/microsoft/azuretools/core/mvp/model/webapp/AzureWebAppMvpModel.java

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import java.io.File;
3232
import java.util.Map;
3333
import java.util.Objects;
34+
import java.util.Optional;
3435

3536
// todo: Refactor to tasks in app service library
3637
@Deprecated
@@ -223,8 +224,8 @@ public void deployArtifactsToWebApp(@Nonnull final IWebAppBase deployTarget, @No
223224
String stopMessage = deployTarget instanceof WebApp ? STOP_WEB_APP : STOP_DEPLOYMENT_SLOT;
224225
progressIndicator.setText(stopMessage);
225226
deployTarget.stop();
226-
227-
final DeployType deployType = getDeployTypeByWebContainer(deployTarget.getRuntime().getWebContainer());
227+
// todo: @hanli migrate to use WebAppDeployTask
228+
final DeployType deployType = Optional.ofNullable(DeployType.fromString(FilenameUtils.getExtension(file.getName()))).orElse(DeployType.ZIP);
228229
// java se runtime will always deploy to root
229230
if (isDeployToRoot ||
230231
Objects.equals(deployTarget.getRuntime().getWebContainer(), WebContainer.JAVA_SE)) {
@@ -239,17 +240,6 @@ public void deployArtifactsToWebApp(@Nonnull final IWebAppBase deployTarget, @No
239240
deployTarget.start();
240241
}
241242

242-
// todo: get deploy type with runtime&artifact
243-
private static DeployType getDeployTypeByWebContainer(WebContainer webContainer) {
244-
if (Objects.equals(webContainer, WebContainer.JAVA_SE)) {
245-
return DeployType.JAR;
246-
}
247-
if (Objects.equals(webContainer, WebContainer.JBOSS_7)) {
248-
return DeployType.EAR;
249-
}
250-
return DeployType.WAR;
251-
}
252-
253243
/**
254244
* Update app settings of deployment slot.
255245
* todo: move to app service library

Utils/azure-toolkit-ide-libs/azure-toolkit-ide-common-lib/src/main/resources/bundles/com/microsoft/azure/toolkit/operation.properties

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ springcloud.remove_app.app=remove Spring Cloud app({0})
4949
springcloud.create_update_app=create or update Spring Cloud app from config in Mojo
5050
springcloud.create_update_app.app=create or update Spring Cloud app({0}) from config
5151
springcloud.load_deployment.deployment|app=load deployment({0}) of Spring Cloud app({1}) from Azure
52-
springcloud.start_deployment.deployment=start deployment({0}) of Spring Cloud app({1})
53-
springcloud.stop_deployment.deployment=stop deployment({0}) of Spring Cloud app({1})
54-
springcloud.restart_deployment.deployment=restart deployment({0}) of Spring Cloud app({1})
55-
springcloud.scale_deployment.deployment=scale deployment({0}) of Spring Cloud app({1})
56-
springcloud.update_deployment.deployment=update deployment({0}) of Spring Cloud app({1})
57-
springcloud.create_deployment.deployment=create deployment({0}) of Spring Cloud app({1})
58-
springcloud.get_deployment.deployment=get deployment({0}) of Spring Cloud app({1}) from Azure
52+
springcloud.start_deployment.deployment=start deployment({0})
53+
springcloud.stop_deployment.deployment=stop deployment({0})
54+
springcloud.restart_deployment.deployment=restart deployment({0})
55+
springcloud.scale_deployment.deployment=scale deployment({0})
56+
springcloud.update_deployment.deployment=update deployment({0})
57+
springcloud.create_deployment.deployment=create deployment({0})
58+
springcloud.get_deployment.deployment=get deployment({0}) from Azure
5959
springcloud.list_deployments.app=list deployments of Spring Cloud app({0})
6060
springcloud.wait_until_deployment_ready.deployment|app=wait deployment({0}) of Spring Cloud app({1}) to be ready
6161
springcloud.get_client.subscription=get Spring Cloud rest client of subscription({0})

0 commit comments

Comments
 (0)