Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/endgame-202202' into endgame-202…
Browse files Browse the repository at this point in the history
…202.next
  • Loading branch information
wangmingliang-ms committed Mar 3, 2022
2 parents ba407c2 + 590c9b1 commit d6d8c97
Show file tree
Hide file tree
Showing 22 changed files with 31 additions and 111 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ Export-Package: com.microsoft.azuretools.appservice,
com.microsoft.azuretools.appservice.handlers,
com.microsoft.azuretools.appservice.ui
Bundle-ClassPath: .,
target/lib/azure-toolkit-ide-appservice-lib-0.17.0.jar
target/lib/azure-toolkit-ide-appservice-lib-0.17.1.jar
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-toolkit-ide-appservice-lib</artifactId>
<version>0.17.0</version>
<version>0.17.1</version>
</dependency>
</dependencies>
<repositories>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Require-Bundle: org.eclipse.ui,
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .,
target/lib/azure-toolkit-ide-springcloud-lib-0.17.0.jar
target/lib/azure-toolkit-ide-springcloud-lib-0.17.1.jar
Import-Package: com.microsoft.azuretools.core.actions,
org.eclipse.core.expressions,
org.eclipse.jface.text.hyperlink,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-toolkit-ide-springcloud-lib</artifactId>
<version>0.17.0</version>
<version>0.17.1</version>
</dependency>
</dependencies>
<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
import com.intellij.openapi.util.InvalidDataException;
import com.intellij.openapi.util.WriteExternalException;
import com.intellij.util.xmlb.XmlSerializer;
import com.microsoft.azure.toolkit.ide.appservice.function.FunctionAppConfig;
import com.microsoft.azure.toolkit.intellij.legacy.common.AzureRunConfigurationBase;
import com.microsoft.azure.toolkit.intellij.legacy.function.runner.core.FunctionUtils;
import com.microsoft.azure.toolkit.lib.appservice.model.JavaVersion;
import com.microsoft.azure.toolkit.lib.appservice.model.OperatingSystem;
import com.microsoft.azure.toolkit.lib.appservice.model.Runtime;
import com.microsoft.azure.toolkit.lib.common.model.Subscription;
import com.microsoft.azure.toolkit.ide.appservice.function.FunctionAppConfig;
import org.apache.commons.lang3.StringUtils;
import org.jdom.Element;
import org.jetbrains.annotations.NotNull;
Expand Down Expand Up @@ -168,10 +168,7 @@ public void setFunctionId(String id) {
public void readExternal(Element element) throws InvalidDataException {
this.functionDeployModel = Optional.ofNullable(element.getChild("FunctionDeployModel"))
.map(e -> XmlSerializer.deserialize(e, FunctionDeployModel.class))
.orElseGet(() -> Optional.of(element)
.map(e -> XmlSerializer.deserialize(e, FunctionDeployModel.DeprecatedDeployModel.class))
.map(FunctionDeployModel::new)
.orElse(new FunctionDeployModel()));
.orElseGet(FunctionDeployModel::new);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,13 @@

package com.microsoft.azure.toolkit.intellij.legacy.function.runner.deploy;

import com.microsoft.azure.toolkit.ide.appservice.model.ApplicationInsightsConfig;
import com.microsoft.azure.toolkit.ide.appservice.model.MonitorConfig;
import com.microsoft.azure.toolkit.intellij.legacy.function.runner.core.FunctionUtils;
import com.microsoft.azure.toolkit.lib.appservice.entity.AppServicePlanEntity;
import com.microsoft.azure.toolkit.lib.appservice.model.DiagnosticConfig;
import com.microsoft.azure.toolkit.lib.appservice.model.JavaVersion;
import com.microsoft.azure.toolkit.lib.appservice.model.LogLevel;
import com.microsoft.azure.toolkit.lib.appservice.model.OperatingSystem;
import com.microsoft.azure.toolkit.lib.appservice.model.PricingTier;
import com.microsoft.azure.toolkit.lib.appservice.model.Runtime;
import com.microsoft.azure.toolkit.lib.appservice.model.WebContainer;
import com.microsoft.azure.toolkit.lib.common.model.ResourceGroup;
import com.microsoft.azure.toolkit.lib.common.model.Subscription;
import com.microsoft.azure.toolkit.ide.appservice.function.FunctionAppConfig;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;

Expand All @@ -40,70 +26,7 @@ public class FunctionDeployModel {

private FunctionAppConfig functionAppConfig = FunctionAppConfig.builder().build();

public FunctionDeployModel(DeprecatedDeployModel deprecatedDeployModel) {
this.moduleName = deprecatedDeployModel.moduleName;
this.appSettingsKey = deprecatedDeployModel.appSettingsKey;
this.deploymentStagingDirectoryPath = deprecatedDeployModel.deploymentStagingDirectoryPath;
final Subscription subscription = Subscription.builder().id(deprecatedDeployModel.subscription).build();
final PricingTier pricingTier = PricingTier.fromString(deprecatedDeployModel.pricingTier);
final OperatingSystem operatingSystem = OperatingSystem.fromString(deprecatedDeployModel.os);
final JavaVersion javaVersion = JavaVersion.fromString(deprecatedDeployModel.javaVersion);
final Runtime runtime = Runtime.getRuntime(operatingSystem, WebContainer.JAVA_OFF, javaVersion);
final ApplicationInsightsConfig insightsConfig = ApplicationInsightsConfig.builder()
.name(deprecatedDeployModel.insightsName)
.instrumentationKey(deprecatedDeployModel.instrumentationKey).build();
final DiagnosticConfig diagnosticConfig = DiagnosticConfig.builder()
.enableApplicationLog(deprecatedDeployModel.enableApplicationLog)
.applicationLogLevel(deprecatedDeployModel.applicationLogLevel).build();
final MonitorConfig monitorConfig = MonitorConfig.builder().applicationInsightsConfig(insightsConfig).diagnosticConfig(diagnosticConfig).build();
final ResourceGroup resourceGroup = ResourceGroup.builder().name(deprecatedDeployModel.resourceGroup).region(deprecatedDeployModel.region).build();
final AppServicePlanEntity appServicePlan = AppServicePlanEntity.builder()
.name(deprecatedDeployModel.appServicePlanName)
.resourceGroup(deprecatedDeployModel.resourceGroup)
.region(deprecatedDeployModel.region)
.pricingTier(pricingTier).build();
this.functionAppConfig = FunctionAppConfig.builder()
.resourceId(deprecatedDeployModel.functionId)
.subscription(subscription)
.resourceGroup(resourceGroup)
.name(deprecatedDeployModel.appName)
.servicePlan(appServicePlan)
.pricingTier(pricingTier)
.runtime(runtime)
.monitorConfig(monitorConfig)
.appSettings(FunctionUtils.loadAppSettingsFromSecurityStorage(appSettingsKey))
.build();
}

public Map<String, String> getTelemetryProperties() {
return Optional.ofNullable(functionAppConfig).map(FunctionAppConfig::getTelemetryProperties).orElse(Collections.emptyMap());
}

// for migrate old configuration to new resource config
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
static class DeprecatedDeployModel {
private boolean isNewResource;
private String functionId;
private boolean enableApplicationLog;
private LogLevel applicationLogLevel;
private String subscription;
private String resourceGroup;
private String appName;
private String region;
private String pricingTier;
private String appServicePlanResourceGroup;
private String appServicePlanName;
private String deploymentStagingDirectoryPath;
private String deployment;
private Map<String, String> appSettings = new HashMap<>();
private String appSettingsKey;
private String moduleName;
private String insightsName;
private String instrumentationKey;
private String os;
private String javaVersion;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ intellij {

dependencies {
compile project(':azure-intellij-plugin-lib')
compile 'com.microsoft.azure:azure-toolkit-resource-lib:0.17.0'
compile 'com.microsoft.azure:azure-toolkit-ide-common-lib:0.17.0'
compile 'com.microsoft.azure:azure-toolkit-ide-arm-lib:0.17.0'
compile 'com.microsoft.azure:azure-toolkit-resource-lib:0.17.1'
compile 'com.microsoft.azure:azure-toolkit-ide-common-lib:0.17.1'
compile 'com.microsoft.azure:azure-toolkit-ide-arm-lib:0.17.1'
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
id "io.freefair.aspectj.post-compile-weaving" version "6.0.0-m2"
}
ext {
azureToolkitVersion = "0.17.0"
azureToolkitVersion = "0.17.1"
}
group 'com.microsoft.azure.toolkit'
apply plugin: 'java'
Expand Down Expand Up @@ -75,7 +75,7 @@ subprojects {
apply plugin: 'java'
apply plugin: 'io.freefair.aspectj.post-compile-weaving'
ext {
azureToolkitVersion = "0.17.0"
azureToolkitVersion = "0.17.1"
}

sourceCompatibility = javaVersion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ intellij {
dependencies {
compile project(':azure-intellij-plugin-lib')
compile project(':azure-intellij-resource-connector-lib')
compile 'com.microsoft.azure:azure-toolkit-resource-lib:0.17.0'
compile 'com.microsoft.azure:azure-toolkit-redis-lib:0.17.0'
compile 'com.microsoft.azure:azure-toolkit-ide-common-lib:0.17.0'
compile 'com.microsoft.azure:azure-toolkit-ide-redis-lib:0.17.0'
compile 'com.microsoft.azure:azure-toolkit-resource-lib:0.17.1'
compile 'com.microsoft.azure:azure-toolkit-redis-lib:0.17.1'
compile 'com.microsoft.azure:azure-toolkit-ide-common-lib:0.17.1'
compile 'com.microsoft.azure:azure-toolkit-ide-redis-lib:0.17.1'
compile 'redis.clients:jedis:3.6.3'
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ dependencies {
implementation project(":azure-intellij-plugin-lib")

implementation 'com.microsoft.graph:microsoft-graph:3.7.0'
implementation "com.microsoft.azure:azure-toolkit-auth-lib:0.17.0"
implementation "com.microsoft.azure:azure-toolkit-auth-lib:0.17.1"
implementation "com.azure.resourcemanager:azure-resourcemanager-authorization:2.5.0"
}
4 changes: 2 additions & 2 deletions PluginsAndFeatures/azure-toolkit-for-intellij/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {
}

ext {
azureToolkitVersion = "0.17.0"
azureToolkitVersion = "0.17.1"
}

compileKotlin {
Expand Down Expand Up @@ -82,7 +82,7 @@ subprojects {
apply plugin: 'java'
apply plugin: 'io.freefair.aspectj.post-compile-weaving'
ext {
azureToolkitVersion = "0.17.0"
azureToolkitVersion = "0.17.1"
}

sourceCompatibility = javaVersion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>azure-toolkit-ide-libs</artifactId>
<groupId>com.microsoft.azure</groupId>
<version>0.17.0</version>
<version>0.17.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>azure-toolkit-ide-libs</artifactId>
<groupId>com.microsoft.azure</groupId>
<version>0.17.0</version>
<version>0.17.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>azure-toolkit-ide-libs</artifactId>
<groupId>com.microsoft.azure</groupId>
<version>0.17.0</version>
<version>0.17.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>azure-toolkit-ide-libs</artifactId>
<groupId>com.microsoft.azure</groupId>
<version>0.17.0</version>
<version>0.17.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>azure-toolkit-ide-libs</artifactId>
<groupId>com.microsoft.azure</groupId>
<version>0.17.0</version>
<version>0.17.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>azure-toolkit-ide-libs</artifactId>
<groupId>com.microsoft.azure</groupId>
<version>0.17.0</version>
<version>0.17.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>azure-toolkit-ide-libs</artifactId>
<groupId>com.microsoft.azure</groupId>
<version>0.17.0</version>
<version>0.17.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>azure-toolkit-ide-libs</artifactId>
<groupId>com.microsoft.azure</groupId>
<version>0.17.0</version>
<version>0.17.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
4 changes: 2 additions & 2 deletions Utils/azure-toolkit-ide-libs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-toolkit-ide-libs</artifactId>
<version>0.17.0</version>
<version>0.17.1</version>
<packaging>pom</packaging>
<name>Libs for Azure Toolkit for IDEs</name>
<description>Wrapped libs of Microsoft Azure Toolkits for IDEs</description>
Expand Down Expand Up @@ -48,7 +48,7 @@
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<azure.toolkit-lib.version>0.17.0</azure.toolkit-lib.version>
<azure.toolkit-lib.version>0.17.1</azure.toolkit-lib.version>
</properties>
<dependencyManagement>
<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion Utils/azuretools-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<properties>
<artifact.name>${project.artifactId}-${project.version}.jar</artifact.name>
<checkstyle.skip>true</checkstyle.skip>
<azure-toolkit-ide-common-lib.version>0.17.0</azure-toolkit-ide-common-lib.version>
<azure-toolkit-ide-common-lib.version>0.17.1</azure-toolkit-ide-common-lib.version>
</properties>
<profiles>
<profile>
Expand Down
4 changes: 2 additions & 2 deletions Utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
<mockito.version>2.22.0</mockito.version>
<powermock.version>1.7.0RC4</powermock.version>
<rx.version>1.3.8</rx.version>
<azure.toolkit-lib.version>0.17.0</azure.toolkit-lib.version>
<azure.toolkit-ide-lib.version>0.17.0</azure.toolkit-ide-lib.version>
<azure.toolkit-lib.version>0.17.1</azure.toolkit-lib.version>
<azure.toolkit-ide-lib.version>0.17.1</azure.toolkit-ide-lib.version>
<powermock.version>2.0.9</powermock.version>
<jetty.version>9.4.40.v20210413</jetty.version>
</properties>
Expand Down

0 comments on commit d6d8c97

Please sign in to comment.