Skip to content

Update parent POM and add discovery availability annotations#134

Open
mercyblitz wants to merge 6 commits into
microsphere-projects:release-1.xfrom
mercyblitz:dev-1.x
Open

Update parent POM and add discovery availability annotations#134
mercyblitz wants to merge 6 commits into
microsphere-projects:release-1.xfrom
mercyblitz:dev-1.x

Conversation

@mercyblitz

Copy link
Copy Markdown
Contributor

This pull request introduces new composite conditional annotations for Spring Cloud Discovery client auto-configuration, refactoring the way conditional logic is applied for both blocking and reactive discovery clients. It also updates dependencies and constants to support these changes.

Conditional Annotation Refactoring:

  • Introduced ConditionalOnBlockingDiscoveryAvailable annotation, which combines checks for the presence of DiscoveryClient, @ConditionalOnDiscoveryEnabled, and @ConditionalOnBlockingDiscoveryEnabled. This simplifies and centralizes the conditional logic for blocking discovery client auto-configuration. (ConditionalOnBlockingDiscoveryAvailable.java, DiscoveryClientAutoConfiguration.java) [1] [2] [3]
  • Introduced ConditionalOnReactiveDiscoveryAvailable annotation, combining checks for the presence of ReactiveDiscoveryClient, @ConditionalOnDiscoveryEnabled, and @ConditionalOnReactiveDiscoveryEnabled, streamlining the conditional logic for reactive discovery client auto-configuration. (ConditionalOnReactiveDiscoveryAvailable.java, ReactiveDiscoveryClientAutoConfiguration.java) [1] [2] [3]

Constants and Dependency Updates:

  • Added REACTIVE_DISCOVERY_CLIENT_CLASS_NAME constant to DiscoveryClientConstants for improved maintainability and clarity. [1] [2]
  • Updated the parent POM version to 0.3.3 and the microsphere-spring-boot BOM version to 0.1.20 for dependency alignment. (pom.xml, microsphere-spring-cloud-parent/pom.xml) [1] [2]

Cleanup:

  • Removed unused imports and redundant static constants from conditional and auto-configuration classes, resulting in cleaner and more maintainable code. [1] [2] [3]

These changes improve the clarity, maintainability, and extensibility of the conditional auto-configuration logic for both blocking and reactive Spring Cloud Discovery clients.

github-actions Bot and others added 4 commits June 6, 2026 14:45
Update the parent POM reference for io.github.microsphere-projects:microsphere-build from 0.3.1 to 0.3.3 in pom.xml to pick up build configuration updates and fixes in the newer parent release.
Update microsphere-spring-boot.version in microsphere-spring-cloud-parent/pom.xml from 0.1.19 to 0.1.20 to use the latest release and pull in related fixes/updates.
Introduce composed conditional annotations for discovery clients and update auto-configs to use them. Adds ConditionalOnBlockingDiscoveryAvailable and ConditionalOnReactiveDiscoveryAvailable (composing ConditionalOnClass + ConditionalOnDiscoveryEnabled + respective reactive/blocking enablement) and a REACTIVE_DISCOVERY_CLIENT_CLASS_NAME constant. Update DiscoveryClientAutoConfiguration and ReactiveDiscoveryClientAutoConfiguration to use the new annotations and clean up related imports; also remove unused imports from ConditionalOnFeaturesAvailable.
@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ Complexity Δ
...utoconfigure/DiscoveryClientAutoConfiguration.java 100.00% <ø> (ø) 1.00 <0.00> (ø)
...gure/ReactiveDiscoveryClientAutoConfiguration.java 100.00% <ø> (ø) 1.00 <0.00> (ø)
...igure/WebFluxServiceRegistryAutoConfiguration.java 100.00% <ø> (ø) 3.00 <0.00> (ø)
...figure/WebMvcServiceRegistryAutoConfiguration.java 100.00% <ø> (ø) 15.00 <0.00> (ø)
...configure/WebServiceRegistryAutoConfiguration.java 100.00% <ø> (ø) 12.00 <0.00> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Introduce a new ConditionalOnAutoServiceRegistrationAvailable meta-annotation and update web auto-configurations to rely on Microsphere web availability conditions. POM changes add Microsphere webmvc/webflux/actuator modules (reorganize dependency ordering and move aspectj to the bottom) and a small parent POM spacing tweak. WebMvcServiceRegistryAutoConfiguration and WebFluxServiceRegistryAutoConfiguration now use ConditionalOnWebMvcAvailable / ConditionalOnWebFluxAvailable, AutoConfigureAfter against Microsphere web auto-configs and ServiceRegistryAutoConfiguration, and reference the new auto-registration condition. Tests updated to remove explicit EnableWebMvcExtension/EnableWebFluxExtension annotations.
Replace direct class references to WebFluxAutoConfiguration and WebMvcAutoConfiguration in @AutoConfigureAfter with fully-qualified name strings to avoid a hard compile-time dependency and allow those auto-configurations to be optional. Removed the now-unused imports and preserved ordering relative to ServiceRegistryAutoConfiguration.
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant