Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Java 17 as the LTS Version #27938

Merged
merged 36 commits into from
May 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
57f6819
Make Java 17 the Default LTS
alzimmermsft Jan 11, 2022
36294c2
Merge branch 'main' into AzEng_MakeJava17DefaultLts
alzimmermsft Jan 11, 2022
d23031d
Enable Java 17 in pipelines, remove old codesnippet tooling completely
alzimmermsft Jan 12, 2022
a9dff95
Attempt to enable Track 1 libraries to use 1.11 as LTS due to issues …
alzimmermsft Mar 29, 2022
5a4fd7e
Centralize usage of Java 11 for Data SDKs
alzimmermsft Mar 29, 2022
6076eed
Try to fix capture group usages without spaces before 1.11
alzimmermsft Mar 29, 2022
87fc73b
Revert changes to eng/common
alzimmermsft Mar 29, 2022
9deb01a
Slightly change matrix replace
alzimmermsft Mar 29, 2022
554d16f
Really revert the eng/common change
alzimmermsft Mar 29, 2022
6c36430
Change using editor that doesn't implicitly remove whitespaces
alzimmermsft Mar 29, 2022
87f905f
Fix linting and test failures in Java 17, use Java 11 for Identity an…
alzimmermsft Mar 30, 2022
9d72f85
Merge in upstream
alzimmermsft Apr 12, 2022
833a196
Update code for Java 17 CI
alzimmermsft Apr 27, 2022
8031f49
Fix tests
alzimmermsft Apr 27, 2022
dcb1faa
Merge branch 'main' into AzEng_MakeJava17DefaultLts
alzimmermsft Apr 27, 2022
82d7dc1
Continue using Java 11 in Cosmos CI
alzimmermsft Apr 27, 2022
758708a
Fix usage of MatrixReplace where is doesn't exist
alzimmermsft Apr 27, 2022
70e22a3
Merge branch 'main' into AzEng_MakeJava17DefaultLts
alzimmermsft Apr 27, 2022
f497795
Skip tests that don't work in higher JVM versions
alzimmermsft Apr 27, 2022
bb3f386
Fix version check when Java version is 1.x
alzimmermsft Apr 27, 2022
b845132
Fix merge conflict and Scala test
alzimmermsft Apr 29, 2022
2f478d9
Merge in upstream and scope down APIs
alzimmermsft May 4, 2022
57bb300
Add RevApi suppressions for Spring changes
alzimmermsft May 4, 2022
9d1da56
Merge branch 'main' into AzEng_MakeJava17DefaultLts
alzimmermsft May 4, 2022
e1c9699
Some RevApi cleanup
alzimmermsft May 4, 2022
6670d2a
Merge in upstream
alzimmermsft May 5, 2022
843d516
Merge branch 'main' into AzEng_MakeJava17DefaultLts
alzimmermsft May 17, 2022
f56118f
Merge in upstream
alzimmermsft May 23, 2022
d3ddd61
Pin Cosmos to Java 11
alzimmermsft May 23, 2022
a6ea299
Merge branch 'main' into AzEng_MakeJava17DefaultLts
alzimmermsft May 23, 2022
5444823
Merge branch 'main' into AzEng_MakeJava17DefaultLts
alzimmermsft May 24, 2022
a0f7de6
Delete files that have been removed in repo
alzimmermsft May 24, 2022
8144937
Merge branch 'main' into AzEng_MakeJava17DefaultLts
alzimmermsft May 25, 2022
86a9b70
Merge branch 'main' into AzEng_MakeJava17DefaultLts
alzimmermsft May 31, 2022
92b4f6f
Add Java 11 run to matrix
alzimmermsft May 31, 2022
9b1e020
Resolve Cosmos Spark test failing in Java 17
alzimmermsft May 31, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions eng/code-quality-reports/src/main/resources/revapi/revapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,27 +92,15 @@
"class com\\.azure\\.spring\\.cloud\\.config\\.web\\.AppConfigurationEndpoint",
{
"matcher": "java-package",
"match": "/org\\.apache\\.avro(\\..*)?/"
"match": "/org\\.apache\\.(avro|commons|qpid)(\\..*)?/"
},
{
"matcher": "java-package",
"match": "/com\\.azure\\.resourcemanager(\\..+?)?\\.fluent(\\..*)?/"
},
{
"matcher": "java-package",
"match": "/org\\.junit(\\..*)?/"
},
{
"matcher": "java-package",
"match": "/org.apache.commons(..*)?/"
},
{
"matcher": "java-package",
"match": "/org.slf4j(..*)?/"
},
{
"matcher": "java-package",
"match": "/org.springframework(..*)?/"
"match": "/org\\.(junit|slf4j|springframework)(\\..*)?/"
}
]
}
Expand Down Expand Up @@ -249,6 +237,21 @@
"superClass": "com.azure.core.models.MessageContent",
"justification": "To support Schema Registry Avro Serializer's signature, EventData extends from MessageContent."
},
{
"code": "java.method.visibilityReduced",
"new": "method com.azure.spring.cloud.autoconfigure.context.AzureTokenCredentialAutoConfiguration.AzureServiceClientBuilderFactoryPostProcessor com.azure.spring.cloud.autoconfigure.context.AzureTokenCredentialAutoConfiguration::builderFactoryBeanPostProcessor()",
"justification": "Shouldn't have been a public API and was recently released."
},
{
"code": "java.method.visibilityReduced",
"new": "method com.azure.spring.cloud.autoconfigure.jms.AzureServiceBusJmsPropertiesBeanPostProcessor com.azure.spring.cloud.autoconfigure.jms.ServiceBusJmsAutoConfiguration::azureServiceBusJmsPropertiesBeanPostProcessor(org.springframework.beans.factory.ObjectProvider<com.azure.spring.cloud.core.provider.connectionstring.ServiceConnectionStringProvider<com.azure.spring.cloud.core.service.AzureServiceType.ServiceBus>>)",
"justification": "Shouldn't have been a public API and was recently released."
},
{
"code": "java.annotation.added",
"new": "class com.azure.spring.cloud.autoconfigure.context.AzureTokenCredentialAutoConfiguration",
"justification": "Fixes a bug."
},
{
"code": "java.missing.newSuperType",
"old": "class com.azure.messaging.eventhubs.EventData",
Expand Down
13 changes: 9 additions & 4 deletions eng/pipelines/templates/jobs/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ parameters:
- name: TestParallelization
type: string
default: '1C'
- name: JavaBuildVersion
type: string
default: $(JavaBuildVersion)

jobs:
- job: 'Build'
Expand Down Expand Up @@ -172,14 +175,14 @@ jobs:
displayName: 'pip install markdown2 and BeautifulSoup4'

- task: Maven@3
displayName: 'Build and Package, JDK Version: $(JavaBuildVersion)'
displayName: 'Build and Package, JDK Version: ${{ parameters.JavaBuildVersion }}'
inputs:
mavenPomFile: pom.xml
goals: 'deploy'
options: '$(DefaultOptions) -T ${{parameters.BuildParallelization}} ${{parameters.AdditionalBuildOptions}} -DskipTests -Dgenerate-overview -Dspotbugs.skip=true -Dcheckstyle.skip=true -Drevapi.skip=true -pl $(ProjectList) -am -DaltDeploymentRepository=id::default::file://$(System.DefaultWorkingDirectory)/build' # We include template-module so we ensure it always builds in CI
mavenOptions: '$(MemoryOptions) $(LoggingOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: $(JavaBuildVersion)
jdkVersionOption: ${{ parameters.JavaBuildVersion }}
jdkArchitectureOption: 'x64'
publishJUnitResults: false

Expand Down Expand Up @@ -340,6 +343,8 @@ jobs:
# We `install` the code quality reports tooling into our local m2 cache separately from building the Maven project
# reports. This means it is available as part of that, but also so that this is not documented in the project report.
- template: ../steps/install-reporting-tools.yml
parameters:
JdkVersion: ${{ parameters.JavaBuildVersion }}

# maven dependency:tree needs to be able to resolve dependencies, so these should be installed.
- task: Maven@3
Expand All @@ -350,7 +355,7 @@ jobs:
options: '$(DefaultOptions) -T ${{parameters.BuildParallelization}} ${{parameters.AdditionalBuildOptions}} -DskipTests $(DefaultSkipOptions) -pl $(ProjectList) -am'
mavenOptions: '$(MemoryOptions) $(LoggingOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: $(JavaBuildVersion)
jdkVersionOption: ${{ parameters.JavaBuildVersion }}
jdkArchitectureOption: 'x64'
publishJUnitResults: false

Expand All @@ -361,7 +366,7 @@ jobs:
options: '$(DefaultOptions) --no-transfer-progress -DskipTests -Dgpg.skip -Dverify-readme -DskipCompile=true -DskipTestCompile=true ${{ parameters.AdditionalLintingOptions }} -pl $(ProjectList)'
mavenOptions: '$(MemoryOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: $(JavaBuildVersion)
jdkVersionOption: ${{ parameters.JavaBuildVersion }}
jdkArchitectureOption: 'x64'
publishJUnitResults: false
goals: 'verify'
Expand Down
8 changes: 8 additions & 0 deletions eng/pipelines/templates/stages/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ parameters:
- name: EnableBatchRelease
type: boolean
default: false
- name: JavaBuildVersion
type: string
default: $(JavaBuildVersion)

stages:
- stage: Build
Expand Down Expand Up @@ -84,11 +87,16 @@ stages:
- ${{ replacement }}

- AZURE_TEST.*=.*/
- ${{ if eq(parameters.SDKType, 'data') }}:
- JavaTestVersion=(.*1)\.17(.*)/$1.11$2
PreBuildSteps: ${{ parameters.PreBuildSteps }}
AdditionalLintingOptions: ${{ parameters.AdditionalLintingOptions }}
${{ if eq(parameters.SDKType, 'data') }}:
TestGoals: 'verify'
TestOptions: '-am'
JavaBuildVersion: '1.11'
${{ else }}:
JavaBuildVersion: ${{ parameters.JavaBuildVersion }}

- ${{ parameters.AdditionalStagesAfterBuild }}

Expand Down
3 changes: 3 additions & 0 deletions eng/pipelines/templates/stages/archetype-sdk-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ parameters:
- name: AdditionalBuildOptions
type: string
default: $(AdditionalBuildOptions)
- name: LtsVersion
type: string
default: $(JavaTestVersion)

stages:
- ${{ each cloud in parameters.CloudConfig }}:
Expand Down
3 changes: 3 additions & 0 deletions eng/pipelines/templates/stages/cosmos-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ stages:
- TestFromSource=^$|false
MatrixReplace:
- AZURE_TEST.*=.*/
- JavaTestVersion=(.*1)\.17(.*)/$1.11$2
BuildParallelization: 1
AdditionalBuildOptions: '-DsparkShading'
TestOptions: '-Punit'
Expand All @@ -57,6 +58,8 @@ stages:
Path: eng/pipelines/templates/stages/cosmos-emulator-matrix.json
Selection: all
GenerateVMJobs: true
MatrixReplace:
- JavaTestVersion=(.*1)\.17(.*)/$1.11$2
AdditionalParameters:
BuildParallelization: 1
AdditionalBuildOptions: '-DsparkShading'
Expand Down
18 changes: 14 additions & 4 deletions eng/pipelines/templates/stages/platform-matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"windows-2019": { "OSVmImage": "MMS2019", "Pool": "azsdk-pool-mms-win-2019-general" },
"macOS-10.15": { "OSVmImage": "macOS-10.15", "Pool": "Azure Pipelines" }
},
"JavaTestVersion": [ "1.8", "1.11" ],
"JavaTestVersion": [ "1.8", "1.17" ],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd keep one job with 11 or 9 (as long as core compiles partially with 9).

"AZURE_TEST_HTTP_CLIENTS": [ "okhttp", "netty" ],
"TestFromSource": false,
"TestGoals": "surefire:test",
Expand All @@ -17,15 +17,15 @@
"exclude": [
{
"Pool": "azsdk-pool-mms-win-2019-general",
"JavaTestVersion": "1.11"
"JavaTestVersion": "1.17"
}
],
"include": [
{
"Agent": {
"ubuntu-20.04": { "OSVmImage": "MMSUbuntu20.04", "Pool": "azsdk-pool-mms-ubuntu-2004-general" }
},
"JavaTestVersion": "1.11",
"JavaTestVersion": "1.17",
"AZURE_TEST_HTTP_CLIENTS": "netty",
"TestFromSource": true,
"TestGoals": "verify",
Expand All @@ -35,11 +35,21 @@
"Agent": {
"windows-2019": { "OSVmImage": "MMS2019", "Pool": "azsdk-pool-mms-win-2019-general" }
},
"JavaTestVersion": "1.11",
"JavaTestVersion": "1.17",
"AZURE_TEST_HTTP_CLIENTS": "netty",
"TestFromSource": false,
"TestGoals": "verify",
"TestOptions": "-DskipCompile=true -DskipTestCompile=true -DcreateSourcesJar=false"
},
{
"Agent": {
"ubuntu-20.04": { "OSVmImage": "MMSUbuntu20.04", "Pool": "azsdk-pool-mms-ubuntu-2004-general" }
},
"JavaTestVersion": "1.11",
"AZURE_TEST_HTTP_CLIENTS": "netty",
"TestFromSource": false,
"TestGoals": "surefire:test",
"TestOptions": ""
}
]
}
4 changes: 2 additions & 2 deletions eng/pipelines/templates/variables/globals.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
variables:
DocWardenVersion: '0.7.1'
# This is the default Java build version. It's the version used to build the shipping libraries, Spotbugs etc.
JavaBuildVersion: '1.11'
JavaBuildVersion: '1.17'
# This is the default Java test version. It's the version used when running tests.
JavaTestVersion: '1.11'
JavaTestVersion: '1.17'

# True if 'Enable system diagnostics' is checked when running a pipeline manually
IsDebug: $[coalesce(variables['System.Debug'], 'false')]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public final class AppConfigurationWebConstants {
* Json field name for SyncToken value
*/
public static final String SYNC_TOKEN = "syncToken";

/**
* Prefix of the validation code.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import com.azure.core.credential.TokenCredential;

/**
* Interface to be implemented that enables returning of a TokenCredential for authentication with an Azure App Configuration stores.
* Interface to be implemented that enables returning of a TokenCredential for authentication with an Azure App
* Configuration stores.
*/
public interface AppConfigurationCredentialProvider {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public final class AppConfigurationPropertySourceLocator implements PropertySour

private static final AtomicBoolean configloaded = new AtomicBoolean(false);

private static final AtomicBoolean startup = new AtomicBoolean(true);
static final AtomicBoolean startup = new AtomicBoolean(true);

/**
* Loads all Azure App Configuration Property Sources configured.
Expand Down Expand Up @@ -95,7 +95,7 @@ public PropertySource<?> locate(Environment environment) {
List<String> profiles = Arrays.asList(env.getActiveProfiles());

CompositePropertySource composite = new CompositePropertySource(PROPERTY_SOURCE_NAME);
Collections.reverse(configStores); // Last store has highest precedence
Collections.reverse(configStores); // Last store has the highest precedence

Iterator<ConfigStore> configStoreIterator = configStores.iterator();
// Feature Management needs to be set in the last config store.
Expand Down Expand Up @@ -131,9 +131,7 @@ public PropertySource<?> locate(Environment environment) {
*
* @param composite PropertySource being added
* @param store Config Store the PropertySource is being generated from
* @param applicationName Name of the application
* @param profiles Active profiles in the Store
* @param storeContextsMap the Map storing the storeName -> List of contexts map
* @param initFeatures determines if Feature Management is set in the PropertySource. When generating more than one
* it needs to be in the last one.
*/
Expand Down Expand Up @@ -182,11 +180,9 @@ private void addPropertySource(CompositePropertySource composite, ConfigStore st
}

/**
* Creates a new set of AppConfigurationProertySources, 1 per Label.
* Creates a new set of AppConfigurationPropertySources, 1 per Label.
*
* @param context Context of the application, part of uniquely define a PropertySource
* @param store Config Store the PropertySource is being generated from
* @param storeContextsMap the Map storing the storeName -> List of contexts map
* @param initFeatures determines if Feature Management is set in the PropertySource. When generating more than one
* it needs to be in the last one.
* @return a list of AppConfigurationPropertySources
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

/**
* Enables checking of Configuration updates.
*
*/
@Component
public class AppConfigurationRefresh implements ApplicationEventPublisherAware {
Expand All @@ -58,7 +57,7 @@ public class AppConfigurationRefresh implements ApplicationEventPublisherAware {

/**
* Component used for checking for and triggering configuration refreshes.
*
*
* @param properties Client properties to check against.
* @param appProperties Library properties for configuring backoff
* @param clientStore Clients stores used to connect to App Configuration.
Expand Down Expand Up @@ -304,7 +303,7 @@ private boolean refreshFeatureFlags(ConfigStore configStore, State state, String

/**
* Gets latest Health connection info for refresh.
*
*
* @return Map of String, endpoint, and Health information.
*/
public Map<String, AppConfigurationStoreHealth> getAppConfigurationStoresHealth() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public static Instant getNextForcedRefresh() {

/**
* Set after load or refresh is successful.
* @param nextForcedRefresh the nextForcedRefresh to set
* @param refreshPeriod the refreshPeriod to set
*/
public static void setNextForcedRefresh(Duration refreshPeriod) {
nextForcedRefresh = Instant.now().plusSeconds(refreshPeriod.getSeconds());
Expand All @@ -130,7 +130,7 @@ public static void setNextForcedRefresh(Duration refreshPeriod) {
/**
* Sets a minimum value until the next refresh. If a refresh interval has passed or is smaller than the calculated
* backoff time, the refresh interval is set to the backoff time.
* @param refreshInterval period between refreshe checks.
* @param refreshInterval period between refresh checks.
* @param properties Provider properties for min and max backoff periods.
*/
static void updateNextRefreshTime(Duration refreshInterval, AppConfigurationProviderProperties properties) {
Expand All @@ -156,7 +156,7 @@ static void updateNextRefreshTime(Duration refreshInterval, AppConfigurationProv
STATE.put(entry.getKey(), updatedState);
}
}

/**
* Calculates the amount of time to the next refresh, if a refresh fails. Takes current Refresh date into account
* for watch keys. Used for checking client refresh-interval only.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
public final class AppConfigurationProperties {

/**
* Prefix for client configurations for connecting to stores.
* Prefix for client configurations for connecting to configuration stores.
*/
public static final String CONFIG_PREFIX = "spring.cloud.azure.appconfiguration";

Expand Down Expand Up @@ -98,7 +98,7 @@ public String getDefaultContext() {
}

/**
* Overrides the default context of `applicaiton`.
* Overrides the default context of `application`.
* @deprecated Use spring.cloud.azure.appconfiguration[0].selects
* @param defaultContext Key Prefix.
*/
Expand All @@ -121,7 +121,7 @@ public String getName() {
/**
* Used to override the spring.application.name value
* @deprecated Use spring.cloud.azure.appconfiguration[0].selects
* @param name application name in conifg key.
* @param name application name in config key.
*/
@Deprecated
public void setName(@Nullable String name) {
Expand Down
Loading