Update microsphere-spring-boot version and enhance feature utilities#138
Open
mercyblitz wants to merge 6 commits into
Open
Update microsphere-spring-boot version and enhance feature utilities#138mercyblitz wants to merge 6 commits into
mercyblitz wants to merge 6 commits into
Conversation
Update microsphere-spring-boot.version in the parent POM from 0.1.22 to 0.1.23 to pick up the latest framework fixes and improvements.
Update microsphere-spring-boot.version in parent POM from 0.1.23 to 0.1.24. This increments the BOM version used across modules to pick up the latest microsphere Spring Boot fixes and improvements.
Add typed configuration binding and helpers for feature registration: FeaturesProperties, FeaturesUtils, NamedFeatureComparator, and FeaturesConstants. Refactor ConfigurationPropertyHasFeaturesAutoConfiguration to use @EnableConfigurationProperties, inject FeaturesProperties, detect bean types, and register HasFeatures via DefaultListableBeanFactory; switch internal collections to Sets and adapt conversion to lists for HasFeatures. Add default features.yaml and unit tests to cover constants, utils, and auto-configuration behavior.
Change the qualified feature name format from "microsphere.{module}.{feature}" to "{module}:{feature}". FeaturesUtils now imports and uses COLON_CHAR and removes the MICROSPHERE_PROPERTY_NAME_PREFIX/DOT_CHAR usage. Updated the unit test expectation in FeaturesUtilsTest to match the new "web:rest-template" format.
Adjust test expectations in ConfigurationPropertyHasFeaturesAutoConfigurationTest to use the new feature naming format. The assertions now expect prefixed short names ("web:WebClient" and "rest:RestTemplate") instead of the previous fully-qualified class names, reflecting a refactor of NamedFeature naming. No functional behavior changed aside from the test assertions.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



This pull request refactors and improves the way Spring Cloud Client Actuator features are registered and configured via properties. The main changes include introducing a new strongly-typed configuration properties class, extracting utility methods, and updating the property structure for clarity and maintainability.
Key improvements:
FeaturesPropertiesclass.FeaturesUtilsclass.Configuration property and structure improvements
FeaturesPropertiesclass annotated with@ConfigurationProperties, providing explicit, type-safe access toabstractandnamedfeature definitions in configuration files. This replaces manual parsing of environment properties and supports better validation and IDE support.microsphere.spring.cloud.features.abstract.<module>, and named features usemicrosphere.spring.cloud.features.named.<module>.<feature>, replacing the previous flat structure.Codebase simplification and maintainability
getAbstractFeaturePropertyName,getNamedFeaturePropertyName, etc.) into a newFeaturesUtilsutility class, improving code reuse and clarity.ConfigurationPropertyHasFeaturesAutoConfigurationto use the newFeaturesPropertiesclass and utility methods, removed legacy property parsing logic, and improved feature registration logic for better maintainability and correctness. [1] [2] [3]Internal data structure improvements
ListtoSet(specifically,LinkedHashSetandTreeSet) to avoid duplicates and ensure predictable ordering when registering features.