Add regression for parent-managed property override upgrade - #8441
Conversation
|
I think I may have missed slightly on the original reproducer as it doesn't actually hit the guard mentioned in the issue. When I dug back into it, I realised my mistake in that BOM-defined versions can't be overridden locally with your own properties, only parent ones. Given the original reproducer was wrong, this doesn't really cover the scenario initially described by it, but is nonetheless a small increase in coverage |
|
@kalayciburak I would ask that you please rephrase the PR title and description if possible, given this, as the tests don't relate to BOM-defined versions, only parent-defined versions, and would not close the other issue, but simply add further coverage. |
When a child POM redeclares a parent-managed version property below the managed value, UpgradeDependencyVersion with overrideManagedVersion should bump that local property. Signed-off-by: Burak KALAYCI <kalayciburak1996@gmail.com>
61386d1 to
a4abb98
Compare
|
yeah makes sense — retitled/described as parent-managed property coverage only (not BOM, not closing #7436). renamed the test method too. |
What's changed?
Adds a regression test for
UpgradeDependencyVersionwhen a child POM redeclares a parent-managed version property below the managed value andoverrideManagedVersionistrue.In that case the recipe should bump the local property (for example
flyway.versionunder a Spring Boot parent) rather than leaving the override orphaned or relying on a redundant explicit<version>thatRemoveRedundantDependencyVersionswould strip.Why?
Extra coverage for the parent-property override path. This does not close #7436 — that issue was about BOM-defined versions, which can't be overridden the same way with local properties.
Test plan
./gradlew :rewrite-maven:test --tests org.openrewrite.maven.UpgradeDependencyVersionTest.upgradesExistingParentOverridePropertyInSamePom