Skip to content

Commit

Permalink
Additional Spring Boot properties migrations for 3.0 & 3.2 (#440)
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek authored Nov 2, 2023
1 parent 426ec6c commit 9fb6514
Show file tree
Hide file tree
Showing 3 changed files with 196 additions and 2 deletions.
163 changes: 161 additions & 2 deletions src/main/resources/META-INF/rewrite/spring-boot-30.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2022 the original author or authors.
# Copyright 2023 the original author or authors.
# <p>
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -743,6 +743,9 @@ recipeList:
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: management.metrics.export.signalfx.num-threads
newPropertyKey: management.signalfx.metrics.export.num-threads
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: management.metrics.export.signalfx.published-histogram-type
newPropertyKey: management.signalfx.metrics.export.published-histogram-type
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: management.metrics.export.signalfx.read-timeout
newPropertyKey: management.signalfx.metrics.export.read-timeout
Expand Down Expand Up @@ -817,7 +820,7 @@ recipeList:
newPropertyKey: management.statsd.metrics.export.publish-unchanged-meters
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: management.metrics.export.wavefront.api-token
newPropertyKey: management.wavefront.metrics.export.api-token
newPropertyKey: management.wavefront.api-token
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: management.metrics.export.wavefront.batch-size
newPropertyKey: management.wavefront.sender.batch-size
Expand Down Expand Up @@ -863,6 +866,162 @@ recipeList:
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: management.trace.include
newPropertyKey: management.httpexchanges.recording.include
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.data.cassandra.compression
newPropertyKey: spring.cassandra.compression
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.data.cassandra.config
newPropertyKey: spring.cassandra.config
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.data.cassandra.connection.connect-timeout
newPropertyKey: spring.cassandra.connection.connect-timeout
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.data.cassandra.connection.init-query-timeout
newPropertyKey: spring.cassandra.connection.init-query-timeout
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.data.cassandra.contact-points
newPropertyKey: spring.cassandra.contact-points
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.data.cassandra.controlconnection.timeout
newPropertyKey: spring.cassandra.controlconnection.timeout
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.data.cassandra.keyspace-name
newPropertyKey: spring.cassandra.keyspace-name
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.data.cassandra.local-datacenter
newPropertyKey: spring.cassandra.local-datacenter
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.data.cassandra.password
newPropertyKey: spring.cassandra.password
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.data.cassandra.pool.heartbeat-interval
newPropertyKey: spring.cassandra.pool.heartbeat-interval
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.data.cassandra.pool.idle-timeout
newPropertyKey: spring.cassandra.pool.idle-timeout
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.data.cassandra.port
newPropertyKey: spring.cassandra.port
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.data.cassandra.request.consistency
newPropertyKey: spring.cassandra.request.consistency
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.data.cassandra.request.page-size
newPropertyKey: spring.cassandra.request.page-size
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.data.cassandra.request.serial-consistency
newPropertyKey: spring.cassandra.request.serial-consistency
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.data.cassandra.request.throttler.drain-interval
newPropertyKey: spring.cassandra.request.throttler.drain-interval
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.data.cassandra.request.throttler.max-concurrent-requests
newPropertyKey: spring.cassandra.request.throttler.max-concurrent-requests
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.data.cassandra.request.throttler.max-queue-size
newPropertyKey: spring.cassandra.request.throttler.max-queue-size
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.data.cassandra.request.throttler.max-requests-per-second
newPropertyKey: spring.cassandra.request.throttler.max-requests-per-second
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.data.cassandra.request.throttler.type
newPropertyKey: spring.cassandra.request.throttler.type
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.data.cassandra.request.timeout
newPropertyKey: spring.cassandra.request.timeout
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.data.cassandra.schema-action
newPropertyKey: spring.cassandra.schema-action
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.data.cassandra.session-name
newPropertyKey: spring.cassandra.session-name
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.data.cassandra.ssl
newPropertyKey: spring.cassandra.ssl
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.data.cassandra.username
newPropertyKey: spring.cassandra.username
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.flyway.ignore-future-migrations
newPropertyKey: spring.flyway.ignore-migration-patterns
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.flyway.ignore-ignored-migrations
newPropertyKey: spring.flyway.ignore-migration-patterns
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.flyway.ignore-missing-migrations
newPropertyKey: spring.flyway.ignore-migration-patterns
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.flyway.ignore-pending-migrations
newPropertyKey: spring.flyway.ignore-migration-patterns
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.flyway.oracle-kerberos-config-file
newPropertyKey: spring.flyway.kerberos-config-file
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.redis.client-name
newPropertyKey: spring.data.redis.client-name
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.redis.client-type
newPropertyKey: spring.data.redis.client-type
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.redis.cluster.max-redirects
newPropertyKey: spring.data.redis.cluster.max-redirects
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.redis.cluster.nodes
newPropertyKey: spring.data.redis.cluster.nodes
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.redis.connect-timeout
newPropertyKey: spring.data.redis.connect-timeout
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.redis.database
newPropertyKey: spring.data.redis.database
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.redis.host
newPropertyKey: spring.data.redis.host
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.redis.lettuce.cluster.refresh.adaptive
newPropertyKey: spring.data.redis.lettuce.cluster.refresh.adaptive
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.redis.lettuce.cluster.refresh.dynamic-refresh-sources
newPropertyKey: spring.data.redis.lettuce.cluster.refresh.dynamic-refresh-sources
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.redis.lettuce.cluster.refresh.period
newPropertyKey: spring.data.redis.lettuce.cluster.refresh.period
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.redis.lettuce.shutdown-timeout
newPropertyKey: spring.data.redis.lettuce.shutdown-timeout
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.redis.password
newPropertyKey: spring.data.redis.password
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.redis.port
newPropertyKey: spring.data.redis.port
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.redis.sentinel.master
newPropertyKey: spring.data.redis.sentinel.master
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.redis.sentinel.nodes
newPropertyKey: spring.data.redis.sentinel.nodes
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.redis.sentinel.password
newPropertyKey: spring.data.redis.sentinel.password
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.redis.sentinel.username
newPropertyKey: spring.data.redis.sentinel.username
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.redis.ssl
newPropertyKey: spring.data.redis.ssl
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.redis.timeout
newPropertyKey: spring.data.redis.timeout
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.redis.url
newPropertyKey: spring.data.redis.url
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.redis.username
newPropertyKey: spring.data.redis.username
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.security.oauth2.resourceserver.jwt.jws-algorithm
newPropertyKey: spring.security.oauth2.resourceserver.jwt.jws-algorithms
---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.java.spring.boot3.UpgradeSpringDoc_2
Expand Down
34 changes: 34 additions & 0 deletions src/main/resources/META-INF/rewrite/spring-boot-32.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#
# Copyright 2023 the original author or authors.
# <p>
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# <p>
# https://www.apache.org/licenses/LICENSE-2.0
# <p>
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.java.spring.boot3.SpringBootProperties_3_2
displayName: Migrate Spring Boot properties to 3.2
description: Migrate properties found in `application.properties` and `application.yml`.
recipeList:
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: management.metrics.web.client.request.metric-name
newPropertyKey: management.observations.http.client.requests.name
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: management.metrics.web.server.request.metric-name
newPropertyKey: management.observations.http.server.requests.name
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: server.max-http-header-size
newPropertyKey: server.max-http-request-header-size
- org.openrewrite.java.spring.ChangeSpringPropertyKey:
oldPropertyKey: spring.liquibase.labels
newPropertyKey: spring.liquibase.label-filter

Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public static void main(String[] args) throws IOException {

var alreadyDefined = new HashSet<>();
for (String version : latestPatchReleases) {
// Should retain 2.0+, such that we do not end up with duplicate property migrations in 2.7
if (!version.startsWith("2") && !version.startsWith("3")) {
continue;
}
Expand Down

0 comments on commit 9fb6514

Please sign in to comment.