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

minor unification of two conditionals #1577

Merged

Conversation

wind57
Copy link
Contributor

@wind57 wind57 commented Feb 16, 2024

No description provided.

@wind57 wind57 changed the title fix minor unification of two conditionals Feb 16, 2024
@Documented
@Inherited
@ConditionalOnClass(HealthIndicator.class)
@ConditionalOnCloudPlatform(CloudPlatform.KUBERNETES)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

unify these two conditionals and use them in every client.

@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@ConditionalOnClass(name = "org.springframework.boot.actuate.health.HealthIndicator")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we can't use @ConditionalOnClass(HealthIndicator.class) since the documentation of ConditionalOnClass::value says:

In order to use this annotation as a meta-annotation, only use the name attribute

We have a test will fail otherwise, and this is how I found out about this doc.

@@ -36,7 +36,7 @@
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@ConditionalOnClass({ HealthIndicator.class })
@ConditionalOnClass(name = "org.springframework.boot.actuate.health.HealthIndicator")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

piggy back this change in here, now that I know that in composite annotations we must use name and not value

@wind57 wind57 marked this pull request as ready for review February 16, 2024 15:01
@wind57
Copy link
Contributor Author

wind57 commented Feb 16, 2024

@ryanjbaxter need a bit of an explanation on the protected branch... what has changed? thank you. may be I am not making the PR against the correct branch anymore?

@ryanjbaxter
Copy link
Contributor

Spring Cloud 2022.0.x is out of support so we have blocked all changes against branches of projects for that release train. Only Spring Cloud 2023.0.x is supported so you can only submit PRs to the main branch now.

@wind57 wind57 changed the base branch from 3.0.x to main February 16, 2024 15:28
@wind57
Copy link
Contributor Author

wind57 commented Feb 16, 2024

ok, thank you, this is ready to be looked at. there are 3 changes here:

  • unify two conditionals under one single
  • rename some test classes
  • change an existing annotation to replace value with name

@wind57
Copy link
Contributor Author

wind57 commented Feb 16, 2024

P.S. This change to 2023.0.x still means to breaking change, correct?

@ryanjbaxter
Copy link
Contributor

No we cannot introduce any breaking changes in 2023.0.x

@ryanjbaxter ryanjbaxter added this to the 3.1.1 milestone Feb 16, 2024
@ryanjbaxter ryanjbaxter merged commit 05dbdcf into spring-cloud:main Feb 16, 2024
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants