Skip to content

Commit 5bc550c

Browse files
saraglunastliujialigitMoary ChanRujun Chen
authored
Merge the Spring Cloud Azure 4.0 back to main branch (Azure#27951)
* Spring Cloud Azure 4.0 Co-authored-by: Strong Liu(刘少壮) <shaozliu@microsoft.com> Co-authored-by: Gary Liu <jialicrazy@163.com> Co-authored-by: Moary Chan <v-moaryc@microsoft.com> Co-authored-by: Rujun Chen <Rujun.Chen@microsoft.com> Co-authored-by: Yi Liu <yiliu6@microsoft.com> Co-authored-by: Rujun Chen <rujche@microsoft.com> Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: zhihaoguo <zhihaoguo@microsoft.com> Co-authored-by: Yonghui Ye <58474919+hui1110@users.noreply.github.com> Co-authored-by: Moary Chan <moary@126.com> Co-authored-by: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> Co-authored-by: Muyao Feng <v-muyaofeng@microsoft.com>
1 parent acbd5c6 commit 5bc550c

File tree

1,921 files changed

+82214
-60680
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,921 files changed

+82214
-60680
lines changed

eng/.docsettings.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ omitted_paths:
66
- sdk/authorization/microsoft-azure-authentication-msi-token-provider/*
77
- sdk/*/azure-monitor-opentelemetry-exporter/*/samples/*
88
- sdk/applicationinsights/microsoft-azure-applicationinsights-query/samples/*
9-
- sdk/spring/azure-spring-boot-samples/*
9+
- sdk/boms/spring-cloud-azure-dependencies/*
10+
- sdk/spring/*
11+
- "sdk/spring/*/*"
1012
- sdk/loganalytics/microsoft-azure-loganalytics/samples/*
1113
- "*/resource-manager/*"
1214
- "sdk/*/mgmt-*/*"

eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@
3838
<suppress checks="com.azure.tools.checkstyle.checks.EnforceFinalFieldsCheck" files=".*DeviceCodeCredentialBuilder.java"/>
3939
<suppress checks="com.azure.tools.checkstyle.checks.EnforceFinalFieldsCheck" files=".*InteractiveBrowserCredentialBuilder.java"/>
4040

41+
<!-- Fields tenantId, clientId and clientSecret are not set in all constructors. -->
42+
<suppress checks="com.azure.tools.checkstyle.checks.EnforceFinalFieldsCheck" files="com.azure.security.keyvault.jca.implementation.KeyVaultClient"/>
43+
44+
<!-- Fields defaultTrustManager and keyStore might be set more than once. -->
45+
<suppress checks="com.azure.tools.checkstyle.checks.EnforceFinalFieldsCheck" files="com.azure.security.keyvault.jca.KeyVaultTrustManager"/>
46+
4147
<!-- Remove this after fixing: https://github.com/Azure/azure-sdk-for-java/issues/5021 -->
4248
<suppress checks="com.azure.tools.checkstyle.checks.EnforceFinalFieldsCheck" files="com.azure.storage.blob.specialized.BlobOutputStream.java"/>
4349

@@ -355,62 +361,56 @@ the main ServiceBusClientBuilder. -->
355361
<suppress checks="com.azure.tools.checkstyle.checks.UseCaughtExceptionCauseCheck" files="com.azure.messaging.eventhubs.EventDataBatch.java"/>
356362

357363
<!-- ### begin: Spring related suppression -->
364+
365+
<!-- The constant name is public static. -->
366+
<suppress checks="ConstantName" files="com.azure.spring.cloud.config.properties.AppConfigurationProviderProperties"/>
367+
368+
<suppress checks="com.azure.tools.checkstyle.checks.NoImplInPublicAPI" files="com.azure.spring.messaging.eventhubs.core.properties.*"/>
369+
<suppress checks="com.azure.tools.checkstyle.checks.NoImplInPublicAPI" files="com.azure.spring.messaging.servicebus.core.properties.*"/>
370+
<suppress checks="com.azure.tools.checkstyle.checks.NoImplInPublicAPI" files="com.azure.spring.messaging.storage.queue.core.properties.*"/>
371+
358372
<!-- TODO: (https://github.com/Azure/azure-sdk-for-java/issues/18291) -->
359373
<!-- GoodLoggingCheck: Spring as a framework, will not directly use ClientLogger-->
360374
<suppress checks="com.azure.tools.checkstyle.checks.(GoodLoggingCheck|ThrowFromClientLoggerCheck|UseCaughtExceptionCauseCheck)" files=".*[/\\]com[/\\]azure[/\\]spring[/\\].*"/>
361375

362376
<!-- ExternalDependencyExposedCheck: Spring will directly use classes from spring dependencies in methods-->
363377
<suppress checks="com.azure.tools.checkstyle.checks.ExternalDependencyExposedCheck" files=".*[/\\]com[/\\]azure[/\\]spring[/\\].*"/>
364378

365-
<!-- Package Name: B2C is the product name -->
366-
<suppress checks="PackageName" files="com.azure.spring.b2c.*|com.azure.spring.autoconfigure.b2c.*"/>
367-
368-
<!-- MissingJavadocMethod: Temporarily skip -->
369-
<suppress checks="MissingJavadocMethod" files=".*[/\\]com[/\\]azure[/\\]spring[/\\].*"/>
370-
<!-- MissingJavadocMethod: gremlin is not shipping now -->
371-
<suppress checks="MissingJavadocType" files=".*[/\\]com[/\\]azure[/\\]spring[/\\]data[/\\]gremlin.*"/>
372-
<!-- MissingJavadocMethod: internal packages -->
373-
<suppress checks="MissingJavadocType|JavadocThrowsChecks|EnforceFinalFields" files=".*[/\\]com[/\\]azure[/\\]spring[/\\]integration[/\\]test.*"/>
379+
<suppress files="com.azure.spring[\\/].*Properties\.java" checks="MissingJavadocMethod" />
380+
<suppress files="com.azure.spring[\\/].*AutoConfiguration\.java" checks="MissingJavadocMethod|JavadocThrowsChecks" />
381+
<suppress files="com.azure.spring[\\/].*Configuration\.java" checks="MissingJavadocMethod" />
382+
<suppress files="com.azure.spring[\\/].*Metadata\.java" checks="MissingJavadocMethod" />
383+
384+
<!-- Suppress package name warning: b2c is the product name. -->
385+
<suppress checks="PackageName" files="com.azure.spring.cloud.autoconfigure.aadb2c.*" />
386+
<!-- Suppress package name warning: oauth2 is the protocol name. -->
387+
<suppress checks="PackageName" files="com.azure.spring.cloud.autoconfigure.aad.implementation.oauth2" />
388+
<!-- The package name length limit -->
389+
<suppress checks="PackageName" files="com.azure.spring.cloud.autoconfigure.implementation.keyvault.certificates.properties.AzureKeyVaultCertificateProperties"/>
390+
<suppress checks="PackageName" files="com.azure.spring.cloud.autoconfigure.implementation.keyvault.certificates.properties.package-info.java"/>
391+
<suppress checks="PackageName" files="com.azure.spring.cloud.autoconfigure.implementation.properties.core.authentication.TokenCredentialConfigurationProperties"/>
392+
<suppress checks="PackageName" files="com.azure.spring.cloud.autoconfigure.implementation.properties.core.authentication.package-info.java"/>
374393

375394
<!--BlacklistedWordsCheck: URL is the name -->
376-
<suppress checks="com.azure.tools.checkstyle.checks.BlacklistedWordsCheck" files="com.azure.spring.autoconfigure.storage.resource.(BlobStorageResource|FileStorageResource).java"/>
377-
378-
<!--BlacklistedWordsCheck: B2C is the product name -->
379-
<suppress checks="com.azure.tools.checkstyle.checks.BlacklistedWordsCheck" files="com.azure.spring.autoconfigure.b2c.AADB2CURL"/>
395+
<suppress checks="com.azure.tools.checkstyle.checks.BlacklistedWordsCheck" files="com.azure.spring.cloud.core.resource.StorageBlobResource.java"/>
396+
<suppress checks="com.azure.tools.checkstyle.checks.BlacklistedWordsCheck" files="com.azure.spring.cloud.core.resource.StorageFileResource.java"/>
380397

381398
<!-- EnforceFinalFieldsCheck: The property will be filled by Spring framework -->
382-
<suppress checks="com.azure.tools.checkstyle.checks.EnforceFinalFieldsCheck" files="com.azure.spring.autoconfigure.aad.(ServiceEndpointsProperties|UserGroups)"/>
383-
<suppress checks="com.azure.tools.checkstyle.checks.EnforceFinalFieldsCheck" files="com.azure.spring.autoconfigure.jms.ConnectionStringResolver"/>
384399
<suppress checks="com.azure.tools.checkstyle.checks.EnforceFinalFieldsCheck" files="com.azure.spring.data.cosmos.config.AbstractCosmosConfiguration.java"/>
385-
<suppress checks="com.azure.tools.checkstyle.checks.EnforceFinalFieldsCheck" files="com.azure.spring.data.cosmos.core.query.CosmosPageRequest.java"/>
386-
<suppress checks="com.azure.tools.checkstyle.checks.EnforceFinalFieldsCheck" files="com.azure.spring.cloud.autoconfigure.context.AzureEnvironmentAutoConfiguration.java"/>
387-
<suppress checks="com.azure.tools.checkstyle.checks.EnforceFinalFieldsCheck" files="com.azure.spring.cloud.autoconfigure.storage.(AzureStorageQueueAutoConfiguration|AzureStorageAutoConfiguration).java"/>
388-
<suppress checks="com.azure.tools.checkstyle.checks.EnforceFinalFieldsCheck" files="com.azure.spring.cloud.autoconfigure.servicebus.(AzureServiceBusTopicAutoConfiguration|AzureServiceBusQueueAutoConfiguration).java"/>
389-
<suppress checks="com.azure.tools.checkstyle.checks.EnforceFinalFieldsCheck" files="com.azure.spring.cloud.autoconfigure.eventhub.AzureEventHubAutoConfiguration.java"/>
390400
<suppress checks="com.azure.tools.checkstyle.checks.EnforceFinalFieldsCheck" files="com.azure.spring.messaging.container.AbstractListenerContainer.java"/>
391-
<suppress checks="com.azure.tools.checkstyle.checks.EnforceFinalFieldsCheck" files="com.azure.spring.servicebus.stream.binder.config.(ServiceBusTopicBinderConfiguration|ServiceBusQueueBinderConfiguration).java"/>
392-
<suppress checks="com.azure.tools.checkstyle.checks.EnforceFinalFieldsCheck" files="com.azure.spring.eventhub.stream.binder.config.EventHubBinderConfiguration.java"/>
393-
394-
<suppress checks="com.azure.tools.checkstyle.checks.EnforceFinalFieldsCheck" files="com.azure.spring.data.gremlin.conversion.source.AbstractGremlinSource.java"/>
395-
<suppress checks="com.azure.tools.checkstyle.checks.EnforceFinalFieldsCheck" files="com.azure.spring.keyvault.KeyVaultOperation.java"/>
401+
<suppress checks="com.azure.tools.checkstyle.checks.EnforceFinalFieldsCheck" files="com.azure.spring.cloud.autoconfigure.keyvault.environment.KeyVaultOperation.java"/>
396402

397-
<suppress checks="MethodName" files="com.azure.spring.data.gremlin.common.GremlinConfig.java"/>
398-
399-
<suppress checks="MethodName" files="com.azure.spring.integration.core.api.(CheckpointConfig|BatchConsumerConfig).java"/>
400-
<suppress checks="MethodName" files="com.azure.spring.integration.servicebus.ServiceBusClientConfig.java"/>
403+
<suppress checks="EnforceFinalFields" files="com.azure.spring.data.cosmos.core.query.CosmosPageRequest"/>
401404

402405
<!-- Checkstyle suppressions for azure.spring.data.cosmos package -->
403406
<suppress checks="MethodName|MemberName|ParameterName" files="src[/\\]test[/\\]java[/\\]com[/\\]azure[/\\]spring[/\\]data[/\\]cosmos[/\\]domain|repository.*.java"/>
404407
<suppress checks="MethodName" files="com.azure.spring.data.cosmos.config.CosmosConfig.java"/>
405-
<suppress checks="PackageName" files="com.azure.spring.data.cosmos.multidatasource.*\.java"/>
406408
<suppress checks="MemberName" files="com.azure.spring.data.cosmos.MyItem.java"/>
407-
408-
<!-- Checkstyle suppressions for com.microsoft.azure.spring package,
409-
if you change the package name to com.azure.spring, please remove the configuration here. -->
410-
<suppress checks="ConstantName|VisibilityModifier" files="src[/\\]test[/\\]java[/\\]com[/\\]microsoft[/\\]azure[/\\]spring[/\\]cloud[/\\]config|properties.*.java"/>
411-
412409
<!-- ### end: Spring related suppression -->
413410

411+
<!-- Checkstyle suppressions for azure.spring.cloud.autoconfigure.compatibility package -->
412+
<suppress checks="MethodName" files="com.azure.spring.cloud.autoconfigure.implementation.compatibility.AzureSpringBootVersionVerifier.java"/>
413+
414414
<!-- TODO: (https://github.com/Azure/azure-sdk-for-java/issues/18279) -->
415415
<!-- Suppress DigitalTwins for now -->
416416
<suppress checks="com.azure.tools.checkstyle.checks.ServiceClient" files="[/\\]azure-digitaltwins-core[/\\]src[/\\]main[/\\]java[/\\]com[/\\]azure[/\\]digitaltwins[/\\]core[/\\](DigitalTwinsClient|DigitalTwinsAsyncClient).java"/>

eng/code-quality-reports/src/main/resources/revapi/revapi.json

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,18 @@
101101
{
102102
"matcher": "java-package",
103103
"match": "/org\\.junit(\\..*)?/"
104+
},
105+
{
106+
"matcher": "java-package",
107+
"match": "/org.apache.commons(..*)?/"
108+
},
109+
{
110+
"matcher": "java-package",
111+
"match": "/org.slf4j(..*)?/"
112+
},
113+
{
114+
"matcher": "java-package",
115+
"match": "/org.springframework(..*)?/"
104116
}
105117
]
106118
}
@@ -111,12 +123,6 @@
111123
"configuration": {
112124
"ignore": true,
113125
"differences": [
114-
{
115-
"regex": true,
116-
"code": "java.class.defaultSerializationChanged",
117-
"new": "class org.springframework.beans.factory.support.DefaultListableBeanFactory",
118-
"justification": "We allow this in org.springframework.beans.factory.support.DefaultListableBeanFactory"
119-
},
120126
{
121127
"regex": true,
122128
"code": "java.class.nonPublicPartOfAPI",
@@ -125,21 +131,9 @@
125131
},
126132
{
127133
"regex": true,
128-
"code": "java.method.addedToInterface",
129-
"new": "method <A extends java.lang.annotation.Annotation> A org.springframework.beans.factory.ListableBeanFactory..*",
130-
"justification": "springframework are allowed to add methods.."
131-
},
132-
{
133-
"regex": true,
134-
"code": "java.class.nonPublicPartOfAPI",
135-
"new": "(class|interface) org.springframework..*",
136-
"justification": "We allow this in springframework"
137-
},
138-
{
139-
"code": "java.method.numberOfParametersChanged",
140-
"old": "method com.azure.spring.messaging.container.ListenerContainerFactory<? extends com.azure.spring.messaging.container.MessageListenerContainer> com.azure.spring.messaging.config.AzureMessagingConfiguration::azureListenerContainerFactory(com.azure.spring.integration.core.api.SubscribeByGroupOperation)",
141-
"new": "method com.azure.spring.messaging.container.ListenerContainerFactory<? extends com.azure.spring.messaging.container.MessageListenerContainer> com.azure.spring.messaging.config.AzureMessagingConfiguration::azureListenerContainerFactory(com.azure.spring.integration.core.api.SubscribeByGroupOperation, org.springframework.beans.factory.ObjectProvider<org.springframework.util.ErrorHandler>)",
142-
"justification": "In order to support configuration of error handler for message listener container"
134+
"code": "java.class.externalClassExposedInAPI",
135+
"new": "(class|interface|enum) com.azure.spring.(messaging|integration|cloud.(core|service|autoconfigure|stream.binder.(servicebus|eventhubs)|actuator|resourcemanager))..*",
136+
"justification": "azure.spring classes are allowed to be exposed."
143137
},
144138
{
145139
"regex": true,

eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2328,41 +2328,47 @@
23282328

23292329
<!-- Exclude from spring related classes -->
23302330
<Match>
2331-
<Or>
2332-
<Class name="com.azure.spring.utils.PropertyLoader"/> <!-- false positive -->
2333-
</Or>
2334-
<Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE,
2335-
NP_LOAD_OF_KNOWN_NULL_VALUE,
2336-
RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE,
2337-
RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"/>
2331+
<And>
2332+
<Or>
2333+
<Class name="com.azure.spring.cloud.core.implementation.credential.resolver.AzureKeyCredentialResolver"/>
2334+
<Class name="com.azure.spring.cloud.core.implementation.credential.resolver.AzureNamedKeyCredentialResolver"/>
2335+
<Class name="com.azure.spring.cloud.core.implementation.credential.resolver.AzureSasCredentialResolver"/>
2336+
<Class name="com.azure.spring.cloud.service.implementation.storage.credential.StorageSharedKeyCredentialResolver" />
2337+
</Or>
2338+
<Method name="resolve"/>
2339+
</And>
2340+
<Bug pattern="BC_UNCONFIRMED_CAST"/>
23382341
</Match>
23392342

2343+
<!-- This match should be removed after fixing https://github.com/Azure/azure-sdk-for-java/issues/26356 -->
23402344
<Match>
2341-
<Or>
2342-
<Class name="com.azure.spring.integration.servicebus.queue.ServiceBusQueueTemplate$QueueMessageHandler"/> <!-- false positive -->
2343-
<Class name="com.azure.spring.integration.servicebus.topic.ServiceBusTopicTemplate$TopicMessageHandler"/> <!-- false positive -->
2344-
</Or>
2345-
<Method name="OnCloseSessionAsync"/>
2346-
<Bug pattern="NM_METHOD_NAMING_CONVENTION"/>
2345+
<Class name="com.azure.spring.cloud.autoconfigure.keyvault.environment.KeyVaultOperation" />
2346+
<Field name="timer" />
2347+
<Bug pattern="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD"/>
23472348
</Match>
23482349

23492350
<Match>
2350-
<Bug pattern="UWF_NULL_FIELD"/>
2351-
<Class name="com.azure.spring.integration.core.AbstractInboundChannelAdapter"/>
2352-
<Or>
2353-
<Field name="subscribeByGroupOperation"/>
2354-
<Field name="subscribeOperation"/>
2355-
</Or>
2351+
<Class name="com.azure.spring.cloud.autoconfigure.context.AzureTokenCredentialAutoConfiguration$AzureServiceClientBuilderFactoryPostProcessor"/>
2352+
<Field name="beanFactory"/>
2353+
<Bug pattern="UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"/>
23562354
</Match>
23572355

23582356
<Match>
23592357
<Class name="com.azure.spring.messaging.config.AzureListenerEndpointRegistrar"/>
23602358
<Bug pattern="NP_NULL_ON_SOME_PATH"/>
23612359
</Match>
23622360

2361+
<!-- Suppressing error for using anonymous inner classes. -->
23632362
<Match>
2364-
<Class name="com.azure.spring.integration.servicebus.converter.ServiceBusMessageConverter"/>
2365-
<Bug pattern="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE"/>
2363+
<Class name="com.azure.spring.cloud.autoconfigure.implementation.compatibility.AzureSpringBootVersionVerifier"/>
2364+
<Method name="is2_6"/>
2365+
<Bug pattern="SIC_INNER_SHOULD_BE_STATIC_ANON"/>
2366+
</Match>
2367+
2368+
<Match>
2369+
<Class name="com.azure.spring.cloud.autoconfigure.implementation.compatibility.AzureSpringBootVersionVerifier"/>
2370+
<Method name="is2_5"/>
2371+
<Bug pattern="SIC_INNER_SHOULD_BE_STATIC_ANON"/>
23662372
</Match>
23672373

23682374
<!-- The transient fields are not used if deserialization happens. -->

0 commit comments

Comments
 (0)