Skip to content

Commit

Permalink
Fix End Game Issues (#4681)
Browse files Browse the repository at this point in the history
* Remove unsupported Windows JBoss 7.2 runtime

* Fix whats new manager issue and reduce document size

* Fix VM module will always list all subscription

* Fix artifact combobox sync before run tasks issue

* Add missing filter condition
  • Loading branch information
Flanker32 authored Oct 26, 2020
1 parent c581da5 commit 0ac10ba
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 115 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,63 +79,6 @@ For all the updates and fixes in this release, please refer the release notes be
### Changed
- Show non-anonymous HTTP trigger urls after function deployment

## 3.39.0

[Azure CLI](https://docs.microsoft.com/cli/azure/) is supported as a sign in option. You can now sign in with single click if you have already signed in with Azure CLI.

![azure-cli-auth](https://user-images.githubusercontent.com/12445236/86110888-b1734a00-baf8-11ea-9d12-6bffef0d6823.gif)

Besides, Azure toolkit add new support on [Azure Synapse](https://docs.microsoft.com/en-us/azure/synapse-analytics/spark/intellij-tool-synapse) now! The following features are waiting to be discovered.
- Monitor Spark batch job on Spark history server UI and Spark job details UI

![monitor-spark-batch-job](https://user-images.githubusercontent.com/32627233/86082318-0ba8e680-baca-11ea-97db-bfdb21c33310.gif)

- Run Apache Spark Livy interactive console on Azure Synapse

![spark-interactive-console](https://user-images.githubusercontent.com/32627233/84374160-319c4300-ac10-11ea-902a-f98dec9d6f99.gif)

### Added
- Support Azure Functions with Java 11 runtime(Preview)
- Support authentication with Azure CLI credentials

### Changed
- Show Apache Spark on Cosmos node by default no matter whether there are SoC clusters under user's subscription or not
- Remove Docker Host in Azure Explorer

### Fixed
- Fix Spark history server link broken for Azure Synapse issue
- [#3712](https://github.com/microsoft/azure-tools-for-java/issues/3712) Fixes NPE while refreshing Azure node
- [#4449](https://github.com/microsoft/azure-tools-for-java/issues/4449) Fixes NPE while parsing Function bindings
- [#2226](https://github.com/microsoft/azure-tools-for-java/issues/2226) Fixes AuthException for no subscrition account
- [#4102](https://github.com/microsoft/azure-tools-for-java/issues/4102) Fixes Exception when app service run process is terminated
- [#4389](https://github.com/microsoft/azure-tools-for-java/issues/4389) Fixes check box UI issue when create function project
- [#4307](https://github.com/microsoft/azure-tools-for-java/issues/4307) Selecting wrong module automatically when adding function run configuration for gradle function project


## 3.38.0
We are proud to announce the support for [Azure Synapse](https://docs.microsoft.com/en-us/azure/synapse-analytics/spark/intellij-tool-synapse) in Azure toolkit! The following features are waiting to be discovered.
- List Azure Synapse workspaces and Apache Spark pools

![list-workspaces-pools-blur](https://user-images.githubusercontent.com/32627233/84378742-3dd7ce80-ac17-11ea-871f-d85e9bedf99f.gif)

- Submit Apache Spark batch jobs to Apache Spark pools

![synapse-submit-middle-quick](https://user-images.githubusercontent.com/32627233/84487331-2f4ded80-acd1-11ea-8fe1-b6cc15b9371b.gif)

### Added
- Support create application insights connection while creating new function app

### Changed
- Deprecate Docker Host(will be removed in v3.39.0)

### Fixed
- [#4423](https://github.com/microsoft/azure-tools-for-java/issues/4423) Spark local run mockfs issue with Hive support enabled
- [#4410](https://github.com/microsoft/azure-tools-for-java/issues/4410) The context menu <code>Submit Spark Application</code> action regression issue at IDEA 2020.1
- [#4419](https://github.com/microsoft/azure-tools-for-java/issues/4419) The run configuration Spark config table changes didn't take effects regression
- [#4413](https://github.com/microsoft/azure-tools-for-java/issues/4413) The regression issue of Spark local console with Scala plugin 2020.1.36
- [#4422](https://github.com/microsoft/azure-tools-for-java/issues/4422) Fixes <code>ConcurrentModificationException</code> while refreshing spring cloud clusters
- [#4438](https://github.com/microsoft/azure-tools-for-java/issues/4438) Fixes modality state issue when open what's new document

## Summary

The plugin allows Java developers to easily develop, configure, test, and deploy highly available and scalable Java web apps. It also supports Azure Synapse data engineers, Azure HDInsight developers and Apache Spark on SQL Server users to create, test and submit Apache Spark/Hadoop jobs to Azure from IntelliJ on all supported platforms.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public class PlatformComboBox extends AzureComboBox<Platform> {
Platform.Linux.JAVA11,
Platform.Windows.JAVA8_TOMCAT9,
Platform.Windows.JAVA8_TOMCAT85,
Platform.Windows.JAVA8_JBOSS72,
Platform.Windows.JAVA8,
Platform.Windows.JAVA11_TOMCAT9,
Platform.Windows.JAVA11_TOMCAT85,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ public void setFileFilter(final Condition<? super VirtualFile> filter) {
this.fileFilter = filter;
}

public synchronized void refreshItems(AzureArtifactType defaultArtifactType, String artifactIdentifier) {
public synchronized void refreshItems(AzureArtifact defaultArtifact) {
unsubscribeSubscription(subscription);
this.setLoading(true);
subscription = this.loadItemsAsync()
.subscribe(items -> DefaultLoader.getIdeHelper().invokeLater(() -> {
this.setItems(items);
this.setLoading(false);
this.resetDefaultValue(defaultArtifactType, artifactIdentifier);
this.resetDefaultValue(defaultArtifact);
}), this::handleLoadingError);
}

Expand Down Expand Up @@ -149,17 +149,16 @@ private void addOrSelectExistingVirtualFile(VirtualFile virtualFile) {
}
}

private void resetDefaultValue(final AzureArtifactType defaultArtifactType, final String artifactIdentifier) {
private void resetDefaultValue(final AzureArtifact defaultArtifact) {
final List<AzureArtifact> artifacts = this.getItems();
final AzureArtifactManager manager = AzureArtifactManager.getInstance(project);
final Predicate<AzureArtifact> predicate = artifact -> StringUtils.equals(artifactIdentifier, manager.getArtifactIdentifier(artifact));
final AzureArtifact defaultArtifact = artifacts.stream().filter(predicate).findFirst().orElse(null);
if (defaultArtifact != null) {
final Predicate<AzureArtifact> predicate = artifact -> manager.equalsAzureArtifactIdentifier(defaultArtifact, artifact);
final AzureArtifact toSelect = artifacts.stream().filter(predicate).findFirst().orElse(null);
if (toSelect != null) {
this.setSelectedItem(toSelect);
} else if (defaultArtifact.getType() == AzureArtifactType.File) {
this.addItem(defaultArtifact);
this.setSelectedItem(defaultArtifact);
} else if (defaultArtifactType == AzureArtifactType.File) {
final AzureArtifact userArtifact = AzureArtifact.createFromFile(artifactIdentifier);
this.addItem(userArtifact);
this.setSelectedItem(userArtifact);
} else {
this.setSelectedItem(null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ public String toString() {
enum Windows implements Platform {
JAVA8("java 8", "1.8"),
JAVA11("java 11", "11"),
JAVA8_JBOSS72("jboss 7.2", "1.8"),
JAVA8_TOMCAT9("tomcat 9.0", "1.8"),
JAVA8_TOMCAT85("tomcat 8.5", "1.8"),
JAVA11_TOMCAT9("tomcat 9.0", "11"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.testFramework.LightVirtualFile;
import com.microsoft.azure.hdinsight.common.StreamUtil;
import com.microsoft.tooling.msservices.components.DefaultLoader;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
Expand Down Expand Up @@ -84,7 +83,7 @@ private void createAndShowWhatsNew(Project project, FileEditorManager fileEditor
virtualFile.setContent(null, content, true);
virtualFile.putUserData(WHAT_S_NEW_ID, WHAT_S_NEW_CONSTANT);
virtualFile.setWritable(false);
DefaultLoader.getIdeHelper().invokeAndWait(() -> {
ApplicationManager.getApplication().invokeAndWait(() -> {
final FileEditor[] fileEditors = fileEditorManager.openFile(virtualFile, true, true);
for (FileEditor fileEditor : fileEditors) {
if (fileEditor instanceof MarkdownSplitEditor) {
Expand All @@ -93,7 +92,7 @@ private void createAndShowWhatsNew(Project project, FileEditorManager fileEditor
true);
}
}
});
}, ModalityState.defaultModalityState());
}

private String getWhatsNewContent() throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public abstract class AzureSettingPanel<T extends AzureRunConfigurationBase> {
private boolean isArtifact;
private boolean telemetrySent;
private Artifact lastSelectedArtifact;
private AzureArtifact lastSelectedAzureArtifact;
protected AzureArtifact lastSelectedAzureArtifact;
protected SecureStore secureStore;

public AzureSettingPanel(@NotNull Project project) {
Expand Down Expand Up @@ -275,15 +275,6 @@ public void customize(JList list,
}
});

getCbAzureArtifact().addActionListener(e -> {
AzureArtifact artifact = (AzureArtifact) getCbAzureArtifact().getSelectedItem();
syncBeforeRunTasks(artifact, configuration);
});

if (getCbAzureArtifact().getSelectedItem() != null) {
syncBeforeRunTasks((AzureArtifact) getCbAzureArtifact().getSelectedItem(), configuration);
}

isCbArtifactInited = true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ protected void apply(@NotNull SpringCloudDeployConfiguration configuration) {
} else {
configuration.setArtifactIdentifier("");
}

syncBeforeRunTasks(artifact, configuration);
}

private static <T, Q> T getValueFromComboBox(JComboBox comboBox, Function<Q, T> selectFunc, @NotNull Class<Q> clz) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import com.microsoft.intellij.ui.components.AzureArtifact;
import com.microsoft.intellij.ui.components.AzureArtifactManager;
import com.microsoft.intellij.ui.util.UIUtils;
import com.microsoft.intellij.util.BeforeRunTaskUtils;
import com.microsoft.tooling.msservices.components.DefaultLoader;
import org.apache.commons.compress.utils.FileNameUtils;
import org.apache.commons.lang.ArrayUtils;
Expand All @@ -62,8 +61,6 @@ public class WebAppSlimSettingPanel extends AzureSettingPanel<WebAppConfiguratio
private static final String[] FILE_NAME_EXT = {"war", "jar", "ear"};
private static final String DEPLOYMENT_SLOT = "Deployment Slot";
private static final String DEFAULT_SLOT_NAME = "slot-%s";
private static final String CREATE_NEW_WEBAPP = "Create New WebApp";
private static final String REFRESHING_WEBAPP = "Refreshing...";
private static final String DEPLOYMENT_SLOT_HOVER = "Deployment slots are live apps with their own hostnames. App" +
" content and configurations elements can be swapped between two deployment slots, including the production " +
"slot.";
Expand Down Expand Up @@ -94,14 +91,10 @@ public class WebAppSlimSettingPanel extends AzureSettingPanel<WebAppConfiguratio
private WebAppComboBox comboBoxWebApp;
private HideableDecorator slotDecorator;

private AzureArtifact previousArtifact;
private WebAppConfiguration webAppConfiguration;

public WebAppSlimSettingPanel(@NotNull Project project, @NotNull WebAppConfiguration webAppConfiguration) {
super(project, false);
this.presenter = new WebAppDeployViewPresenterSlim();
this.presenter.onAttachView(this);
this.webAppConfiguration = webAppConfiguration;

final ButtonGroup slotButtonGroup = new ButtonGroup();
slotButtonGroup.add(rbtNewSlot);
Expand Down Expand Up @@ -218,8 +211,9 @@ protected void resetFromConfig(@NotNull WebAppConfiguration configuration) {
comboBoxWebApp.refreshItemsWithDefaultValue(configurationModel, WebAppComboBoxModel::isSameWebApp);
}
if (configuration.getAzureArtifactType() != null) {
previousArtifact = AzureArtifactManager.getInstance(project).getAzureArtifactById(configuration.getArtifactIdentifier());
comboBoxArtifact.refreshItems(configuration.getAzureArtifactType(), configuration.getArtifactIdentifier());
lastSelectedAzureArtifact =
AzureArtifactManager.getInstance(project).getAzureArtifactById(configuration.getArtifactIdentifier());
comboBoxArtifact.refreshItems(lastSelectedAzureArtifact);
} else {
comboBoxArtifact.refreshItems();
}
Expand Down Expand Up @@ -277,6 +271,7 @@ protected void apply(@NotNull WebAppConfiguration configuration) {
}
configuration.setDeployToRoot(chkToRoot.isVisible() && chkToRoot.isSelected());
configuration.setOpenBrowserAfterDeployment(chkOpenBrowser.isSelected());
syncBeforeRunTasks(comboBoxArtifact.getValue(), configuration);
}

private boolean isAbleToDeployToRoot(final AzureArtifact azureArtifact) {
Expand Down Expand Up @@ -323,28 +318,6 @@ private void createUIComponents() {
final String ext = FileNameUtils.getExtension(virtualFile.getPath());
return ArrayUtils.contains(FILE_NAME_EXT, ext);
});
comboBoxArtifact.addItemListener(event -> {
if (!(event.getItem() instanceof AzureArtifact)) {
return;
} else {
syncBeforeRunTasks((AzureArtifact) event.getItem());
}
});
}

private synchronized void syncBeforeRunTasks(AzureArtifact azureArtifact) {
try {
if (AzureArtifactManager.getInstance(project).equalsAzureArtifactIdentifier(previousArtifact, azureArtifact)) {
return;
}
if (previousArtifact != null) {
BeforeRunTaskUtils.addOrRemoveBeforeRunTask(this.getMainPanel(), previousArtifact, webAppConfiguration, false);
}
previousArtifact = azureArtifact;
BeforeRunTaskUtils.addOrRemoveBeforeRunTask(this.getMainPanel(), azureArtifact, webAppConfiguration, true);
} catch (IllegalAccessException e) {
// swallow before run task errors
}
}

private void loadDeploymentSlot(WebAppComboBoxModel selectedWebApp) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;

public class VMArmModule extends AzureRefreshableNode {
private static final String VM_SERVICE_MODULE_ID = com.microsoft.tooling.msservices.serviceexplorer.azure.vmarm.VMArmModule.class.getName();
Expand All @@ -58,7 +60,11 @@ protected void refreshItems() throws AzureCmdException {
}

SubscriptionManager subscriptionManager = azureManager.getSubscriptionManager();
Set<String> sidList = subscriptionManager.getAccountSidList();
Set<String> sidList = subscriptionManager.getSelectedSubscriptionDetails()
.stream()
.filter(subscriptionDetail -> Objects.nonNull(subscriptionDetail) && subscriptionDetail.isSelected())
.map(subscriptionDetail -> subscriptionDetail.getSubscriptionId())
.collect(Collectors.toSet());
for (String sid : sidList) {
try {
Azure azure = azureManager.getAzure(sid);
Expand Down

0 comments on commit 0ac10ba

Please sign in to comment.