openrewrite / openrewrite/rewrite-spring
Support Dynamic newKey values when using glob in ChangeSpringPropertyKey/Value
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 403
- Forks
- 149
- Avg merge
- 2h 33m
- Merged PRs (30d)
- 10
Description
What problem are you trying to solve?
Basically I have a property that can be given a client name something like
spring:
datasource:
source-a:
url: ...
source-b:
url: ...
This could also be in properties like
spring.datasource.source-a.url: ...
spring.datasource.source-b.url: ...
I would like to change the url key to newurl
However ChangeSpringPropertyKey and ChangeSpringPropertyValue only support globs for the oldKey not the newKey. This becomes a problem as there is 2 sources and the names can be defined by the app developer
Describe the solution you'd like
In a perfect world the newKey/newValue would be able to support globs as well as the old one.
Have you considered any alternatives or workarounds?
Currently we just use the YAML ChangeKey and warn properties users they may need to manually fix the files.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/main/java/org/openrewrite/java/spring/ChangeSpringPropertyKey.java at the linked newKey handling, then inspect the corresponding ChangeSpringPropertyValue implementation. Reproduce the YAML and properties examples from the issue and determine how completion should cover glob patterns in both newKey and newValue; no test file is named in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100