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

Spring Cloud Azure App Configuration 4.0 #33337

Merged
merged 41 commits into from
Feb 15, 2023
Merged

Spring Cloud Azure App Configuration 4.0 #33337

merged 41 commits into from
Feb 15, 2023

Conversation

mrm9084
Copy link
Member

@mrm9084 mrm9084 commented Feb 6, 2023

Description

This updates the App Configuration Spring Provider to the 4.0 format, adds support for global properties

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@ghost ghost added App Configuration Azure.ApplicationModel.Configuration azure-spring All azure-spring related issues labels Feb 6, 2023
Comment on lines 745 to 749
{
"code": "java.class.externalClassExposedInAPI",
"new": "class com.azure.data.appconfiguration.models.SettingSelector",
"justification": "This is an Azure SDK class that is used in the public API."
},
Copy link
Member

Choose a reason for hiding this comment

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

Can we use one rule as following for them?

  {
          "regex": true,
          "code": "java\\.class\\.externalClassExposedInAPI",
          "new": "(interface|class|enum) com\\.azure\\.(communication\\.common|core|cosmos|data\\.schemaregistry|json|messaging\\.eventgrid|messaging\\.eventhubs|messaging\\.servicebus|resourcemanager|security\\.keyvault|storage).*",
          "justification": "SDK classes are allowed to be exposed by dependencies using them."
        },

Or simply modify that rule?

Copy link
Member Author

Choose a reason for hiding this comment

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

we should avoid regex as it increases the revapi time. See Alan's post about it.

Copy link
Member

@saragluna saragluna Feb 8, 2023

Choose a reason for hiding this comment

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

I don't think this mean we should avoid regex,

When adding many suppressions determine if they can be compacted with existing suppressions for that kind

  • RevApi has regex suppressions
  • Checkstyle uses
  • Spotbugs has regex suppressions

But I checked the PR, he is using code to address the external APIs. See eng/code-quality-reports/src/main/java/com/azure/tools/revapi/transforms/AzureSdkAllowedExternalApis.java in #33130.

Copy link
Member

Choose a reason for hiding this comment

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

We can wait until #33130 gets merged.

eng/versioning/version_client.txt Show resolved Hide resolved
@@ -4,16 +4,12 @@ stages:
- template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml
Copy link
Member

Choose a reason for hiding this comment

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

Can we delete this file now?

Copy link
Member Author

Choose a reason for hiding this comment

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

Doesn't the SDK also use that file?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

@alzimmermsft alzimmermsft Feb 14, 2023

Choose a reason for hiding this comment

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

This should be kept and the Artifacts that were removed should instead be replaced with

Artifacts:
  - name: azure-data-appconfiguration
    groupId: com.azure
    safeName: azuredataappconfiguration

@@ -1,10 +1,10 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.azure.spring.cloud.config.web.pullrefresh;
package com.azure.spring.cloud.config.web.implementation.pullrefresh;
Copy link
Member

Choose a reason for hiding this comment

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

do you think refresh.pull and refresh.push would be better as the package names?

@@ -8,10 +8,10 @@
public interface KeyVaultSecretProvider {
Copy link
Member

Choose a reason for hiding this comment

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

We still need this?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is for resolving key vault references without connecting to key vault. It has no "client", it is instead of.

Copy link
Member

Choose a reason for hiding this comment

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

But internally we will build the KV clients?

Copy link
Member Author

Choose a reason for hiding this comment

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

So the way this works is before we check if a client even exists we pass the KV Reference to the KeyVaultSecretProvider, if it returns any non-Null value than that is returned as the secret. If nothing is returned or this isn't configured only then do we create a client or check if one has already been made.

sdk/spring/spring-cloud-azure-actuator/pom.xml Outdated Show resolved Hide resolved
/**
* Indicator class of App Configuration
*/
public final class AppConfigurationConfigHealthIndicator implements HealthIndicator {
Copy link
Member

Choose a reason for hiding this comment

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

Let's put this into the impl package. I know the other classes were exposed as public API, but we have changed their visibility in Spring Boot 3 branch. So for the new classes added to the actuator module, let's keep them in the impl package.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think we can as then spring-cloud-azure-actuator-autoconfigure would be trying to access a private class of another package.

Copy link
Member

@saragluna saragluna Feb 15, 2023

Choose a reason for hiding this comment

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

How about moving it to the implementation package then?

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought we didn't access implementation code of other packages?

@mrm9084
Copy link
Member Author

mrm9084 commented Feb 15, 2023

/azp run java - spring - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@saragluna
Copy link
Member

/azp run java - spring - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mrm9084
Copy link
Member Author

mrm9084 commented Feb 15, 2023

/azp run java - spring - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mrm9084
Copy link
Member Author

mrm9084 commented Feb 15, 2023

/azp run java - spring - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mrm9084 mrm9084 merged commit 72884d4 into Azure:main Feb 15, 2023
@mrm9084 mrm9084 deleted the 4.0Merge branch April 11, 2023 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
App Configuration Azure.ApplicationModel.Configuration azure-spring All azure-spring related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants