Skip to content

Add regression for parent-managed property override upgrade - #8441

Merged
steve-aom-elliott merged 1 commit into
openrewrite:mainfrom
kalayciburak:fix/upgrade-dep-bom-property-override
Aug 10, 2026
Merged

Add regression for parent-managed property override upgrade#8441
steve-aom-elliott merged 1 commit into
openrewrite:mainfrom
kalayciburak:fix/upgrade-dep-bom-property-override

Conversation

@kalayciburak

@kalayciburak kalayciburak commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

What's changed?

Adds a regression test for UpgradeDependencyVersion when a child POM redeclares a parent-managed version property below the managed value and overrideManagedVersion is true.

In that case the recipe should bump the local property (for example flyway.version under a Spring Boot parent) rather than leaving the override orphaned or relying on a redundant explicit <version> that RemoveRedundantDependencyVersions would 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

@steve-aom-elliott

Copy link
Copy Markdown
Contributor

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

@steve-aom-elliott

steve-aom-elliott commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

@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>
@kalayciburak
kalayciburak force-pushed the fix/upgrade-dep-bom-property-override branch from 61386d1 to a4abb98 Compare August 10, 2026 17:52
@kalayciburak kalayciburak changed the title Add regression for BOM override property upgrade Add regression for parent-managed property override upgrade Aug 10, 2026
@kalayciburak

Copy link
Copy Markdown
Contributor Author

yeah makes sense — retitled/described as parent-managed property coverage only (not BOM, not closing #7436). renamed the test method too.

@github-project-automation github-project-automation Bot moved this from In Progress to Ready to Review in OpenRewrite Aug 10, 2026
@steve-aom-elliott
steve-aom-elliott merged commit 3e76ed6 into openrewrite:main Aug 10, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from Ready to Review to Done in OpenRewrite Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

UpgradeDependencyVersion does not update an override property when the dependency is BOM-managed

2 participants