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

fix(spring): add AutoConfigureAfter annotation #1208

Merged
merged 5 commits into from
Jan 6, 2023

Conversation

emmileaf
Copy link
Contributor

@emmileaf emmileaf commented Jan 4, 2023

This PR adds AutoConfigureAfter(GcpContextAutoConfiguration.class) annotation to enforce configuration order. It also makes two related changes to enable this annotation:

@sonarcloud
Copy link

sonarcloud bot commented Jan 4, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@emmileaf emmileaf added the spring pr that's related to spring code gen, intend to merge into autoconfig-gen-draft2 branch. label Jan 4, 2023
@emmileaf emmileaf marked this pull request as ready for review January 4, 2023 15:15
@emmileaf emmileaf requested a review from a team as a code owner January 4, 2023 15:15
Copy link
Contributor

@zhumin8 zhumin8 left a comment

Choose a reason for hiding this comment

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

LGTM.

@@ -166,6 +166,9 @@ public void visit(ScopeNode scope) {
@Override
public void visit(AnnotationNode annotation) {
annotation.type().accept(this);
if (annotation.descriptionExprs() != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, Good catch! I guess we missed this and just got lucky with

@ConditionalOnClass(EchoClient.class)
@EnableConfigurationProperties(EchoSpringProperties.class)

emmileaf added a commit to GoogleCloudPlatform/spring-cloud-gcp that referenced this pull request Jan 6, 2023
This goes together with googleapis/sdk-platform-java#1208 in switching generator dependency from spring-cloud-gcp-core to spring-cloud-gcp-autoconfigure.
@emmileaf emmileaf merged commit 9b7336d into autoconfig-gen-draft2 Jan 6, 2023
@emmileaf emmileaf deleted the spring-add-annotation branch January 6, 2023 14:45
diegomarquezp pushed a commit to GoogleCloudPlatform/spring-cloud-gcp that referenced this pull request Jan 20, 2023
This goes together with googleapis/sdk-platform-java#1208 in switching generator dependency from spring-cloud-gcp-core to spring-cloud-gcp-autoconfigure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spring pr that's related to spring code gen, intend to merge into autoconfig-gen-draft2 branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants