Skip to content

Commit 4db7195

Browse files
authored
Fix issues founded in end game (#4800)
* Bump azure version in config files, fixes #1797902 * Clear combo box when fill items, fixes #1797587 * Always get latest app service status, fixes #1797916 * Exclude unused dependency from dom4j, fixes #1797591, #1797900,#1797913,#1797914 * Wrapper web app deployment within AzureTaskManager and add empty check in AzureOperationsContext, fixes #1797882
1 parent ebfb25c commit 4db7195

File tree

9 files changed

+34
-19
lines changed

9 files changed

+34
-19
lines changed

PluginsAndFeatures/AddLibrary/AppInsights/com.microsoft.applicationinsights.ui/src/main/java/com/microsoft/applicationinsights/ui/config/messages.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ depLocation=dependencies/
1414
excp=Exception in getClasspathEntries
1515
azureSDKcontainerID=com.microsoft.azuretools.SDK_CONTAINER
1616
sdkID=com.microsoft.azuretools.sdk
17-
sdkJar=dependencies/azure-1.36.3.jar
17+
sdkJar=dependencies/azure-1.38.0.jar
1818
jstDep=org.eclipse.jst.component.dependency
1919
aiCheckBoxTxt=Enable telemetry with Application Insights
2020
webxmlPath=WebContent/WEB-INF/web.xml

PluginsAndFeatures/AddLibrary/AzureLibraries/com.microsoft.azuretools.wasdkjava.ui/src/main/java/com/microsoft/azuretools/wasdkjava/ui/classpath/messages.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ lblVersion=Version :
77
libNotAvail=Library is not available.
88
notFound=Not found
99
sdkID=com.microsoft.azuretools.sdk
10-
sdkJar=dependencies/azure-1.36.3.jar
10+
sdkJar=dependencies/azure-1.38.0.jar
1111
title=Microsoft Azure Libraries for Java
1212
verNotAvail=The selected version is not available.
1313
version1=Microsoft Azure Libraries for Java, version %s.%s.%s

PluginsAndFeatures/azure-toolkit-for-eclipse/com.microsoft.azuretools.core/src/com/microsoft/azuretools/core/utils/messages.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ err=Error
5656
prefFileName=WAEclipsePlugin
5757
bundleName=org.eclipse.core.runtime
5858
sdkLibBundleName=com.microsoftopentechnologies.windowsazure.tools.sdk
59-
sdkLibBaseJar=dependencies/azure-1.36.3.jar
59+
sdkLibBaseJar=dependencies/azure-1.38.0.jar
6060
SDKLocErrMsg=Error occurred while retrieving path of Azure libraries
6161
resCLExWkspRfrsh=Exception while refresh of workspace.
6262
cmhLblStrgAcc=Storage Accounts

PluginsAndFeatures/azure-toolkit-for-intellij/build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,12 @@ dependencies {
122122
compile group: 'com.microsoft.azure', name: 'azure-auth-helper', version: '0.6.0'
123123
compile 'com.microsoft.azure:azure-tools-common:0.10.0'
124124
compile group: 'com.microsoft.azure.appplatform.v2019_05_01_preview', name: 'azure-mgmt-appplatform', version: '1.0.0-beta-2'
125-
compile group: 'org.dom4j', name: 'dom4j', version: '2.1.3'
125+
compile group: 'org.dom4j', name: 'dom4j', version: '2.1.3', {
126+
exclude group: "javax.xml.stream", module: "stax-api"
127+
exclude group: "xpp3", module: "xpp3"
128+
exclude group: "pull-parser", module: "pull-parser"
129+
exclude group: "net.java.dev.msv", module: "xsdlib"
130+
}
126131
compile group: 'jaxen', name: 'jaxen', version: '1.2.0'
127132
compile group: 'commons-beanutils', name: 'commons-beanutils', version: '1.9.4'
128133

PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/azure/toolkit/intellij/appservice/AppServiceComboBox.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,12 @@ public synchronized void refreshItemsWithDefaultValue(@NotNull T defaultValue) {
5959
this.addItem(defaultValue);
6060
subscription = this.loadItemsAsync()
6161
.subscribe(items -> DefaultLoader.getIdeHelper().invokeLater(() -> {
62-
items.forEach(this::addItem);
63-
this.resetDefaultValue(defaultValue);
64-
this.setLoading(false);
62+
synchronized (AppServiceComboBox.this) {
63+
AppServiceComboBox.this.removeAllItems();
64+
items.forEach(this::addItem);
65+
this.resetDefaultValue(defaultValue);
66+
this.setLoading(false);
67+
}
6568
}), (e) -> {
6669
this.handleLoadingError(e);
6770
});

PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/azure/toolkit/intellij/webapp/action/CreateWebAppAction.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public CreateWebAppAction(WebAppModule webappModule) {
6363
}
6464

6565
@Override
66-
@AzureOperation(value = "start to create a new web app", type = AzureOperation.Type.ACTION)
66+
@AzureOperation(value = "create web app", type = AzureOperation.Type.ACTION)
6767
public void actionPerformed(NodeActionEvent e) {
6868
final Project project = (Project) webappModule.getProject();
6969
if (!AzureSignInAction.doSignIn(AuthMethodManager.getInstance(), project) ||
@@ -75,7 +75,6 @@ public void actionPerformed(NodeActionEvent e) {
7575
dialog.show();
7676
}
7777

78-
@AzureOperation(value = "create new web app", type = AzureOperation.Type.ACTION)
7978
private void createWebApp(final WebAppConfig config, Runnable callback, final Project project) {
8079
final AzureTask task = new AzureTask(null, message("webapp.create.task.title"), true, () -> {
8180
ProgressManager.getInstance().getProgressIndicator().setIndeterminate(true);
@@ -84,13 +83,13 @@ private void createWebApp(final WebAppConfig config, Runnable callback, final Pr
8483
refreshAzureExplorer();
8584
final Path application = config.getApplication();
8685
if (Objects.nonNull(application) && application.toFile().exists()) {
87-
DefaultLoader.getIdeHelper().invokeLater(() -> deploy(webapp, application, project));
86+
AzureTaskManager.getInstance().runLater(() -> deploy(webapp, application, project));
8887
}
8988
});
9089
AzureTaskManager.getInstance().runInModal(task);
9190
}
9291

93-
@AzureOperation(value = "deploy artifact to web app", type = AzureOperation.Type.ACTION)
92+
@AzureOperation(value = "deploy artifact to web app", type = AzureOperation.Type.SERVICE)
9493
private void deploy(final WebApp webapp, final Path application, final Project project) {
9594
final AzureTask task = new AzureTask(null, message("webapp.deploy.task.title"), true, () -> {
9695
ProgressManager.getInstance().getProgressIndicator().setIndeterminate(true);

PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/intellij/serviceexplorer/azure/appservice/ProfileFlightRecordAction.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
import com.microsoft.azure.toolkit.lib.appservice.jfr.FlightRecorderStarterBase;
3636
import com.microsoft.azure.toolkit.lib.common.task.AzureTask;
3737
import com.microsoft.azure.toolkit.lib.common.task.AzureTaskManager;
38+
import com.microsoft.azuretools.core.mvp.model.AzureMvpModel;
39+
import com.microsoft.azuretools.core.mvp.model.webapp.AzureWebAppMvpModel;
3840
import com.microsoft.azuretools.telemetry.TelemetryConstants;
3941
import com.microsoft.azuretools.telemetrywrapper.EventUtil;
4042
import com.microsoft.intellij.util.PluginUtil;
@@ -60,7 +62,7 @@ public class ProfileFlightRecordAction extends NodeActionListener {
6062
private static final int ONE_SECOND = 1000;
6163
private static final int TWO_SECONDS = 2000;
6264
private final Project project;
63-
private final WebAppBase appService;
65+
private WebAppBase appService;
6466

6567
public ProfileFlightRecordAction(WebAppNode webAppNode) {
6668
super();
@@ -77,11 +79,6 @@ protected void actionPerformed(NodeActionEvent nodeActionEvent) {
7779
String.format(message("webapp.flightRecord.error.notSupport.message"), appService.name()));
7880
return;
7981
}
80-
if (!StringUtils.equalsIgnoreCase(appService.state(), "running")) {
81-
notifyUserWithErrorMessage(message("webapp.flightRecord.error.notRunning.title"),
82-
String.format(message("webapp.flightRecord.error.notRunning.message"), appService.name()));
83-
return;
84-
}
8582
EventUtil.executeWithLog(appService instanceof WebApp ? TelemetryConstants.WEBAPP : TelemetryConstants.FUNCTION,
8683
"start-flight-recorder", op -> {
8784
final AzureTask task = new AzureTask(project, PROFILE_FLIGHT_RECORDER, true, this::doProfileFlightRecorderAll, AzureTask.Modality.ANY);
@@ -91,6 +88,14 @@ protected void actionPerformed(NodeActionEvent nodeActionEvent) {
9188

9289
private void doProfileFlightRecorderAll() {
9390
try {
91+
final String subscriptionId = AzureMvpModel.getSegment(appService.id(), "subscriptions");
92+
// Always get latest app service status, workaround for https://dev.azure.com/mseng/VSJava/_workitems/edit/1797916
93+
appService = AzureWebAppMvpModel.getInstance().getWebAppById(subscriptionId, appService.id());
94+
if (!StringUtils.equalsIgnoreCase(appService.state(), "running")) {
95+
notifyUserWithErrorMessage(message("webapp.flightRecord.error.notRunning.title"),
96+
String.format(message("webapp.flightRecord.error.notRunning.message"), appService.name()));
97+
return;
98+
}
9499
ProgressIndicator progressIndicator = ProgressManager.getInstance().getProgressIndicator();
95100
progressIndicator.setText(String.format(message("webapp.flightRecord.task.startProfileWebApp.title"), appService.name()));
96101
CountDownLatch finishLatch = new CountDownLatch(1);

PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/intellij/util/PluginHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
public class PluginHelper {
3131

32-
private static final String AZURE_ARTIFACT = "azure-1.36.3.jar";
32+
private static final String AZURE_ARTIFACT = "azure-1.38.0.jar";
3333

3434
/**
3535
* @return resource filename in plugin's directory

Utils/azuretools-core/src/com/microsoft/azure/toolkit/lib/common/operation/AzureOperationsContext.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
package com.microsoft.azure.toolkit.lib.common.operation;
2424

2525
import com.microsoft.azure.toolkit.lib.common.handler.AzureExceptionHandler;
26+
import org.apache.commons.collections4.CollectionUtils;
2627
import rx.Completable;
2728
import rx.Observable;
2829
import rx.Single;
@@ -58,7 +59,9 @@ public static Object execute(final AzureOperationRef operation, final OperationP
5859
try {
5960
return proceedable.proceed();
6061
} finally {
61-
AzureOperationsContext.pop();
62+
if (CollectionUtils.isNotEmpty(operations.get())) {
63+
AzureOperationsContext.pop();
64+
}
6265
}
6366
}
6467

0 commit comments

Comments
 (0)