convert Spring Boot application-*.properties to application-*.yaml - #1066
barbulescu wants to merge 26 commits into
Conversation
da918c7 to
cd93d59
Compare
cd93d59 to
6386121
Compare
|
@timtebeek I tried to cleanup a bit the initial version and I did a rebase to fix merge conflicts - please update |
|
This test started failing randomly but it does look to be related to my changes: |
|
@timtebeek when you have time, please take a look and let me know if it is anything I can improve here |
- Skip files split by `#---`/`!---` separators with a message, as the documents would otherwise merge into one mapping and later duplicate keys silently win - Quote mapping keys as well as values, so keys such as `no` or `on` are not re-typed by YAML - Do not delete the `.properties` file when the generated YAML fails to parse - Anchor the Java reference pattern so `custom-application.properties` no longer blocks `application.properties`
| trackExistingYaml(acc, source); | ||
| trackCandidate(acc, source, ctx); | ||
| collectJavaReferences(acc, source); |
There was a problem hiding this comment.
I like how you're naming the different use cases here, and split out their implementation. Thanks!
|
Thanks again @barbulescu ; still slowly trying to work my way through a massive backlog of reviews. I've applied some initial fixes already, but also want to explore a way to reduce the complexity here by creating a flattened yaml structure first, and then apply existing recipe to (un)fold as needed for the nested structure. Might be a little while longer, not least because I have some PTO coming up. 🙏🏻 |
|
I spent some time exploring whether the conversion could emit a flat YAML document ( It does work. Pipeline: flatten (comment-free) → parse → The one non-obvious trick: comments have to be withheld until after the merge. Why I'd still keep the current renderer:
So the current deterministic renderer looks like the right call to me. The reusable takeaway is the two upstream issues worth filing against rewrite-yaml (comment-aware section merging — the |
What's changed?
Created a recipe for migrating pplication-.properties to application-.yaml.
What's your motivation?
Anything in particular you'd like reviewers to focus on?
Did I miss any test cases? Can it be done simpler?
Anyone you would like to review specifically?
@timtebeek
Checklist