Skip to content

Commit

Permalink
Merge pull request #6361 from microsoft/endgame-202201
Browse files Browse the repository at this point in the history
Done endgame 202201
  • Loading branch information
wangmingliang-ms authored Jan 25, 2022
2 parents 407f72f + 241539b commit 9e48261
Show file tree
Hide file tree
Showing 153 changed files with 948 additions and 444 deletions.
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
All notable changes to "Azure Toolkit for IntelliJ IDEA" will be documented in this file.

- [Change Log](#change-log)
- [3.61.0](#3610)
- [3.60.2](#3602)
- [3.60.1](#3601)
- [3.60.0](#3600)
- [3.59.0](#3590)
- [3.58.0](#3580)
Expand Down Expand Up @@ -76,6 +79,35 @@ All notable changes to "Azure Toolkit for IntelliJ IDEA" will be documented in t
- [3.0.7](#307)
- [3.0.6](#306)

## 3.61.0
### Added
- Add a placeholder tree node in Azure Explorer for resource that is being created.
- Show the status of resources explicitly on Azure Explorer node(right after the name).

### Changed
- Details of items in combo box are now loaded lazily, so that user needn't to wait too long.
for the items to be ready to be selected when deploy a WebApp/Function App.
- Nodes in Azure Explorer are now ordered alphabetically.

### Fixed
- NPE when connecting storage account/redis cache if there is no such resources in the selected subscription.
- No default Offer/Sku/Image are selected in "Select VM Image" dialog.
- Validation passed in Create VM dialog even Maximum price per hour is empty.
- Some modified values will be changed to default when switch back to "More settings" in "Create App Service" dialog.
- Validation message is not right when selected subscription has no spring cloud service.
- Tooltips on nodes in azure explorer are not correct.
- Error occurs when run or deploy after docker support is added.
- Icon of action "Open by Database Tools" for PostgreSQL is missing.

## 3.60.2
### Changed
- upgrade log4j to the latest v2.17.1

## 3.60.1
### Fixed
- [#6294](https://github.com/microsoft/azure-tools-for-java/issues/6294): Uncaught Exception cannot create configurable component java.lang.NullPointerException
- Signin status will not keep after restarting if user signed in with Service Principal

## 3.60.0
### Added
- Add dependency support for Azure Functions related libs, so that our plugin can be recommended.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public T getValue() {

@Override
public void setValue(final T config) {
this.config = config;
this.textName.setValue(config.getName());
this.selectorRuntime.setValue(config.getRuntime());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public Flux<String> getStreamingLogContent() throws IOException {
// Refers https://github.com/microsoft/vscode-azurefunctions/blob/v0.22.0/src/
// commands/logstream/startStreamingLogs.ts#L53
private void openLiveMetricsStream() throws IOException {
final String aiKey = functionApp.entity().getAppSettings().get(APPINSIGHTS_INSTRUMENTATIONKEY);
final String aiKey = functionApp.getAppSettings().get(APPINSIGHTS_INSTRUMENTATIONKEY);
if (StringUtils.isEmpty(aiKey)) {
throw new IOException(MUST_CONFIGURE_APPLICATION_INSIGHTS);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
package com.microsoft.azure.toolkit.intellij.legacy.appservice.action;

import com.intellij.openapi.project.Project;
import com.microsoft.azure.toolkit.lib.appservice.model.OperatingSystem;
import com.microsoft.azure.toolkit.lib.appservice.service.impl.WebApp;
import com.microsoft.azure.toolkit.lib.common.action.Action;
import com.microsoft.azure.toolkit.lib.common.bundle.AzureString;
import com.microsoft.azure.toolkit.lib.common.exception.AzureToolkitRuntimeException;
import com.microsoft.azure.toolkit.lib.common.messager.AzureMessager;
import com.microsoft.azure.toolkit.lib.common.task.AzureTask;
import com.microsoft.azure.toolkit.lib.common.task.AzureTaskManager;
import com.microsoft.azure.toolkit.lib.legacy.appservice.TunnelProxy;
Expand Down Expand Up @@ -57,6 +59,10 @@ public void execute() {
final AzureString title = title("webapp.connect_ssh.app", webAppName);
AzureTaskManager.getInstance().runInBackground(new AzureTask(project, title, false,
() -> {
if (webApp.getRuntime().getOperatingSystem() == OperatingSystem.WINDOWS) {
AzureMessager.getMessager().warning(message("webapp.ssh.windowsNotSupport"));
return;
}
final TunnelProxy proxy = new TunnelProxy(webApp);

int localPort;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@
package com.microsoft.azure.toolkit.intellij.legacy.function;

import com.intellij.openapi.project.Project;
import com.microsoft.azure.toolkit.ide.appservice.model.ApplicationInsightsConfig;
import com.microsoft.azure.toolkit.ide.appservice.function.FunctionAppConfig;
import com.microsoft.azure.toolkit.ide.appservice.model.MonitorConfig;
import com.microsoft.azure.toolkit.intellij.legacy.appservice.AppServiceInfoBasicPanel;
import com.microsoft.azure.toolkit.intellij.common.AzureFormPanel;
import com.microsoft.azure.toolkit.intellij.common.ConfigDialog;
import com.microsoft.azure.toolkit.intellij.legacy.appservice.AppServiceInfoBasicPanel;
import com.microsoft.azure.toolkit.lib.appservice.model.Runtime;
import com.microsoft.azure.toolkit.ide.appservice.function.FunctionAppConfig;
import org.apache.commons.lang3.StringUtils;

import javax.annotation.Nullable;
import javax.swing.*;
import java.util.Optional;

import static com.microsoft.azure.toolkit.intellij.common.AzureBundle.message;

Expand Down Expand Up @@ -54,14 +55,16 @@ protected JComponent createCenterPanel() {

private void createUIComponents() {
// TODO: place custom component creation code here
basicPanel = new AppServiceInfoBasicPanel<FunctionAppConfig>(project, () -> FunctionAppConfig.getFunctionAppDefaultConfig(project.getName())) {
basicPanel = new AppServiceInfoBasicPanel<>(project, () -> FunctionAppConfig.getFunctionAppDefaultConfig(project.getName())) {
@Override
public FunctionAppConfig getValue() {
// Create AI instance with same name by default
final FunctionAppConfig config = super.getValue();
final MonitorConfig monitorConfig = MonitorConfig.builder().build();
monitorConfig.setApplicationInsightsConfig(ApplicationInsightsConfig.builder().name(config.getName()).newCreate(true).build());
config.setMonitorConfig(monitorConfig);
Optional.ofNullable(config.getMonitorConfig()).map(MonitorConfig::getApplicationInsightsConfig).ifPresent(insightConfig -> {
if (insightConfig.isNewCreate() && !StringUtils.equals(insightConfig.getName(), config.getName())) {
insightConfig.setName(config.getName());
}
});
return config;
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void onLoadFunctionApps() {
public void onLoadFunctionAppSettings(FunctionApp functionApp) {
Observable.fromCallable(() -> {
getMvpView().beforeFillAppSettings();
return functionApp.entity().getAppSettings();
return functionApp.getAppSettings();
}).subscribeOn(getSchedulerProvider().io())
.subscribe(appSettings -> AzureTaskManager.getInstance().runLater(() -> {
if (isViewDetached()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void loadAppSettings(FunctionApp functionApp) {
}
RxJavaUtils.unsubscribeSubscription(loadAppSettingsSubscription);
loadAppSettingsSubscription =
Observable.fromCallable(() -> functionApp.entity().getAppSettings()).subscribeOn(getSchedulerProvider().io())
Observable.fromCallable(() -> functionApp.getAppSettings()).subscribeOn(getSchedulerProvider().io())
.subscribe(appSettings -> AzureTaskManager.getInstance().runLater(() -> {
if (isViewDetached()) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.intellij.ui.HyperlinkLabel;
import com.intellij.ui.ListCellRendererWrapper;
import com.microsoft.azure.toolkit.ide.appservice.function.FunctionAppConfig;
import com.microsoft.azure.toolkit.intellij.common.AzureComboBox;
import com.microsoft.azure.toolkit.intellij.legacy.common.AzureSettingPanel;
import com.microsoft.azure.toolkit.intellij.legacy.function.FunctionAppComboBox;
import com.microsoft.azure.toolkit.intellij.legacy.function.runner.component.table.AppSettingsTable;
Expand Down Expand Up @@ -136,6 +137,7 @@ protected void resetFromConfig(@NotNull FunctionDeployConfiguration configuratio
}
if (!StringUtils.isAllEmpty(configuration.getFunctionId(), configuration.getAppName())) {
appSettingsFunctionApp = configuration.getConfig();
functionAppComboBox.setValue(new AzureComboBox.ItemReference<>(item -> FunctionAppConfig.isSameApp(item, configuration.getConfig())));
functionAppComboBox.setConfigModel(configuration.getConfig());
}
final Module previousModule = configuration.getModule();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,56 +5,53 @@

package com.microsoft.azure.toolkit.intellij.legacy.function.runner.library.logging;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import lombok.extern.log4j.Log4j2;

import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;


@Log4j2
public final class Log {
private static Logger logger = LoggerFactory.getLogger(com.microsoft.azure.toolkit.lib.common.logging.Log.class);

public static void error(String message) {
logger.error(message);
log.error(message);
}

public static void error(Exception error) {
logger.error(getErrorDetail(error));
log.error(getErrorDetail(error));
}

public static void info(String message) {
logger.info(message);
log.info(message);
}

public static void info(Exception error) {
logger.info(getErrorDetail(error));
log.info(getErrorDetail(error));
}

public static void debug(String message) {
logger.debug(message);
log.debug(message);
}

public static void debug(Exception error) {
logger.debug(getErrorDetail(error));
log.debug(getErrorDetail(error));
}

public static void warn(String message) {
logger.warn(message);
log.warn(message);
}

public static void warn(Exception error) {
logger.warn(getErrorDetail(error));
log.warn(getErrorDetail(error));
}

public static boolean isDebugEnabled() {
return logger.isDebugEnabled();
return log.isDebugEnabled();
}

public static void prompt(String message) {
if (logger.isInfoEnabled()) {
logger.info(message);
if (log.isInfoEnabled()) {
log.info(message);
System.out.println(message);
} else {
System.out.println(message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,16 @@
import com.intellij.util.ui.FormBuilder;
import com.microsoft.intellij.util.ValidationUtils;
import com.microsoft.azure.toolkit.intellij.legacy.function.wizard.AzureFunctionsConstants;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.swing.*;
import java.awt.*;
import java.util.Arrays;
import java.util.function.Predicate;

@Log4j2
public class FunctionsModuleInfoStep extends ModuleWizardStep implements Disposable {
private static final Logger LOGGER = LoggerFactory.getLogger(FunctionsModuleInfoStep.class);
private static final String MAVEN_TOOL = "Maven";
private static final String GRADLE_TOOL = "Gradle";

Expand Down Expand Up @@ -93,7 +92,7 @@ public void _init() {

panel.add(ScrollPaneFactory.createScrollPane(formBuilder.getPanel(), true), "North");
} catch (final RuntimeException e) {
LOGGER.error(e.getLocalizedMessage(), e);
log.error(e.getLocalizedMessage(), e);
throw e;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ public FunctionAppConfig getFunctionAppConfigFromExistingFunction(@Nonnull final
return FunctionAppConfig.builder()
.resourceId(functionApp.id())
.name(functionApp.name())
.region(functionApp.entity().getRegion())
.region(functionApp.getRegion())
.resourceGroup(ResourceGroup.builder().name(functionApp.resourceGroup()).build())
.subscription(Subscription.builder().id(functionApp.subscriptionId()).build())
.servicePlan(AppServicePlanEntity.builder().id(functionApp.entity().getAppServicePlanId()).build()).build();
.servicePlan(AppServicePlanEntity.builder().id(functionApp.getAppServicePlan().id()).build()).build();
}

public FunctionApp createFunctionApp(final FunctionAppConfig config) {
Expand Down Expand Up @@ -217,7 +217,7 @@ private FunctionDeployType getDeployType(final FunctionApp functionApp) {
if (functionApp.getRuntime().getOperatingSystem() == OperatingSystem.WINDOWS) {
return FunctionDeployType.RUN_FROM_ZIP;
}
final PricingTier pricingTier = functionApp.plan().entity().getPricingTier();
final PricingTier pricingTier = functionApp.plan().getPricingTier();
return StringUtils.equalsAnyIgnoreCase(pricingTier.getTier(), "Dynamic", "ElasticPremium") ?
FunctionDeployType.RUN_FROM_BLOB : FunctionDeployType.RUN_FROM_ZIP;
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 9e48261

Please sign in to comment.