-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
Properties Migrator does not detect properties of Map type that are marked as deprecated #27854
Comments
@wilkinsona @jvillarb Starting work on this issue (see fork here). Currently using the above example as a test case, although it seems incomplete. What is the metadata for Currently, my test case is giving a report of
Is this the report that seen in the original issue? If not, what was the report? Just want to make sure I am truly reproducing the original issue. Thinking desired report looks like:
|
@dominiccroce thanks for looking into this. I had a quick look at your fork and I don't think that address the issue that's reported here. The problem is that we have a metadata entry for the map, but not for the individual entries (as they are potentially infinite). Taking back the example above, This issue is about checking if the prefix of a key matches a deprecated map entry and then add it to the report. There are multiple ways of doing that and I can't say for sure which one is best. Let me know if you want to pursue this! |
Hi @snicoll Thanks for the response. I think makes sense, the map itself is deprecated but individual entries aren't matching since we only look for exact match but not prefix match. I will continue to look at this and adjust my test case accordingly. Just to confirm, this means that the individual map entries are not explicitly defined in the metadata file, just the map itself and the renamed map will be defined? Also to confirm, this means the key will not be changing, only the map itself is? |
Yep, that's right. Thanks for following up and let us know if you have other questions. |
@snicoll I believe I have reproduced the issue in a unit test and now said test is passing. Please see attached PR and we can discuss further there if you have any concerns with the test or implementation. |
@snicoll No rush but just curious on when I can get some feedback on my PR? |
@dominiccroce not sure what kind of answer you expect besides "when time permits". I am working on several projects and we're all pretty busy at the moment. |
@snicoll Thanks for the response. No worries, this is my first contribution to this project so was just unsure on what to expect for timeline on reviews. |
…ot-starter-parent from 2.7.8 to 2.7.9 (patch) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [org.springframework.boot:spring-boot-starter-parent](https://spring.io/projects/spring-boot) ([source](https://github.com/spring-projects/spring-boot)) | parent | patch | `2.7.8` -> `2.7.9` | --- ### Release Notes <details> <summary>spring-projects/spring-boot</summary> ### [`v2.7.9`](https://github.com/spring-projects/spring-boot/releases/tag/v2.7.9) [Compare Source](spring-projects/spring-boot@v2.7.8...v2.7.9) #### 🐞 Bug Fixes - Maven Plugin's PropertiesMergingResourceTransformer closes InputStream when it should not do so [#​34063](spring-projects/spring-boot#34063) - Actuator Health web endpoint broken with Gson and Java 17 [#​34030](spring-projects/spring-boot#34030) - Dependency management for Mongo's Java Driver is incomplete [#​33941](spring-projects/spring-boot#33941) - Using devtools with Reactive application results in slower restarts [#​33855](spring-projects/spring-boot#33855) - Spies are not reset after test execution when using `@SpyBean` [#​33830](spring-projects/spring-boot#33830) - Properties Migrator does not detect properties of Map type that are marked as deprecated [#​27854](spring-projects/spring-boot#27854) #### 📔 Documentation - Updated documentation for `@ConfigurationProperties` bean naming rules [#​34029](spring-projects/spring-boot#34029) - Restore "Use Jedis Instead of Lettuce" how-to documentation [#​33994](spring-projects/spring-boot#33994) - Add Redis application properties example [#​33965](spring-projects/spring-boot#33965) - Use Maven Central for release downloads in CLI installation documentation [#​33962](spring-projects/spring-boot#33962) - Actuator section is missing from documentation overview [#​33932](spring-projects/spring-boot#33932) - Add Javadoc since to OperationParameter.getAnnotation() [#​33914](spring-projects/spring-boot#33914) - Document additional configuration that is required for spring.mvc.throw-exception-if-no-handler-found=true to be effective [#​31660](spring-projects/spring-boot#31660) #### 🔨 Dependency Upgrades - Upgrade to ActiveMQ 5.16.6 [#​34238](spring-projects/spring-boot#34238) - Upgrade to Byte Buddy 1.12.23 [#​34239](spring-projects/spring-boot#34239) - Upgrade to Dropwizard Metrics 4.2.16 [#​34240](spring-projects/spring-boot#34240) - Upgrade to Elasticsearch 7.17.9 [#...
…ot-starter-parent from 2.7.8 to 2.7.9 (patch) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [org.springframework.boot:spring-boot-starter-parent](https://spring.io/projects/spring-boot) ([source](https://github.com/spring-projects/spring-boot)) | parent | patch | `2.7.8` -> `2.7.9` | --- ### Release Notes <details> <summary>spring-projects/spring-boot</summary> ### [`v2.7.9`](https://github.com/spring-projects/spring-boot/releases/tag/v2.7.9) [Compare Source](spring-projects/spring-boot@v2.7.8...v2.7.9) #### 🐞 Bug Fixes - Maven Plugin's PropertiesMergingResourceTransformer closes InputStream when it should not do so [#​34063](spring-projects/spring-boot#34063) - Actuator Health web endpoint broken with Gson and Java 17 [#​34030](spring-projects/spring-boot#34030) - Dependency management for Mongo's Java Driver is incomplete [#​33941](spring-projects/spring-boot#33941) - Using devtools with Reactive application results in slower restarts [#​33855](spring-projects/spring-boot#33855) - Spies are not reset after test execution when using `@SpyBean` [#​33830](spring-projects/spring-boot#33830) - Properties Migrator does not detect properties of Map type that are marked as deprecated [#​27854](spring-projects/spring-boot#27854) #### 📔 Documentation - Updated documentation for `@ConfigurationProperties` bean naming rules [#​34029](spring-projects/spring-boot#34029) - Restore "Use Jedis Instead of Lettuce" how-to documentation [#​33994](spring-projects/spring-boot#33994) - Add Redis application properties example [#​33965](spring-projects/spring-boot#33965) - Use Maven Central for release downloads in CLI installation documentation [#​33962](spring-projects/spring-boot#33962) - Actuator section is missing from documentation overview [#​33932](spring-projects/spring-boot#33932) - Add Javadoc since to OperationParameter.getAnnotation() [#​33914](spring-projects/spring-boot#33914) - Document additional configuration that is required for spring.mvc.throw-exception-if-no-handler-found=true to be effective [#​31660](spring-projects/spring-boot#31660) #### 🔨 Dependency Upgrades - Upgrade to ActiveMQ 5.16.6 [#​34238](spring-projects/spring-boot#34238) - Upgrade to Byte Buddy 1.12.23 [#​34239](spring-projects/spring-boot#34239) - Upgrade to Dropwizard Metrics 4.2.16 [#​34240](spring-projects/spring-boot#34240) - Upgrade to Elasticsearch 7.17.9 [#...
If we set a Map property as deprecated, because it is replaced or removed, the Spring Boot Properties Migrator module, when scanning the application environment and printing diagnostics, does not detect these types of properties.
For example, if we have the custom.logging.log-level property of type java.util.Map defined in the the metadata file as follows:
and set in the application.yml:
When the spring-boot-properties-migrator module is included and the application is run, the generated report does not show that this property has been replaced by "logging.level".
The same problem can also be encountered with the management.health.status.http-mapping property of the spring-boot-actuator-autoconfigure library:
The displayed result does not show the deprecated property management.health.status.http-mapping.
The text was updated successfully, but these errors were encountered: