Repository navigation
Properties migrator does not migrate some additional properties renamed in 4.0 - #52810
Open
zhoubiao188 wants to merge 1 commit into
Open
zhoubiao188 wants to merge 1 commit into
zhoubiao188 wants to merge 1 commit into
Conversation
The properties migrator only copies a deprecated property when the type of
its metadata entry matches the type of the replacement. Several entries for
properties that are no longer bound in 4.0 have no type, so the migrator
reported an incompatible target type and left the replacement unset. For
example, `spring.liquibase.labels=a,b` was reported as
Key: spring.liquibase.labels
Reason: Replacement key 'spring.liquibase.label-filter' uses an
incompatible target type
and Liquibase then ran without the configured labels.
Record the replacement's type on the entries that are missing it. Entries
whose replacement is not a type compatible property, such as Jetty's access
log properties that are all replaced by `custom-format`, are left unchanged,
as are entries whose replacement no longer exists.
See spring-projectsgh-52801
Signed-off-by: zhoubiao188 <32508238+zhoubiao188@users.noreply.github.com>
This branch has not been deployed
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.
gh-52801 made the properties migrator copy properties such as
spring.data.mongodb.uriagain by recording the replacement's type on the deprecated metadata entry. A number of entries that were missed still have no type, so the migrator still refuses to migrate them.Impact
The migrator only copies a renamed property when the type of its metadata entry matches the type of the replacement. When the deprecated entry has no type,
PropertyMigration#determineCompatibleTypereturnsfalseand the value is discarded:Reproduced against the 4.0.9 artifacts, driving
PropertiesMigrationReporterwith the published metadata and aspring.liquibase.labels=a,bproperty source:spring.liquibase.label-filternulla,bThe same happens for the other entries in this commit, all of which have
level: errorexcept the Groovy template ones (level: warning):spring.data.cassandra.*(10) —contact-points,compression, the timeouts,request.page-size,request.throttler.typespring.groovy.template.configuration.*(12)management.trace.http.enabled,management.trace.http.include,management.trace.includespring.liquibase.labelsspring.activemq.pool.maximum-active-session-per-connection,spring.artemis.pool.maximum-active-session-per-connectionserver.max-http-header-sizeVerification
The recorded type is in every case the type that the annotation processor generates for the replacement in the same branch:
Reverting only these metadata changes brings the "incompatible target type" error back for every property I checked (
spring.groovy.template.configuration.auto-escape,spring.data.cassandra.contact-points,spring.activemq.pool.maximum-active-session-per-connection,server.max-http-header-size,management.trace.http.include,spring.liquibase.labels).Deliberately not changed
server.jetty.accesslog.date-format,log-cookies,locale, ...) all point atserver.jetty.accesslog.custom-format, whose value is a request log format. Copying a boolean or a date pattern into it would be wrong, so those entries stay without a type.spring.reactor.stacktrace-mode.enabled—spring.reactor.debug-agent.enabledno longer exists in 4.0, so there is no type to record.No test is added for the same reason as gh-52801: the entries are checked by reading
META-INF/spring-configuration-metadata.jsonfrom the built module, which no unit test in those modules currently does.