Skip to content

Add Kotlin DSL variable downgrade tests for UpgradePluginVersion#6704

Closed
MBoegers wants to merge 4 commits intomainfrom
mboegers/fix-upgrade-plugin-version-downgrade
Closed

Add Kotlin DSL variable downgrade tests for UpgradePluginVersion#6704
MBoegers wants to merge 4 commits intomainfrom
mboegers/fix-upgrade-plugin-version-downgrade

Conversation

@MBoegers
Copy link
Copy Markdown
Contributor

@MBoegers MBoegers commented Feb 9, 2026

Summary

  • Add tests covering the scenario where UpgradePluginVersion with an exact version could downgrade plugins when versions are stored in a Kotlin DSL val variable shared across multiple plugin declarations
  • Replace assert statements with proper null checks in the scanner for the GString and Identifier variable branches to avoid silent null storage when assertions are disabled

Test plan

  • dontDowngradeKotlinDslSharedVariable — verifies no downgrade with shared val variable across multiple Kotlin plugins
  • dontDowngradeKotlinDslSinglePluginVariable — verifies no downgrade with single plugin using a val variable
  • upgradeKotlinDslSharedVariable — verifies upgrades work correctly with shared val variable
  • All existing UpgradePluginVersionTest tests pass

Add tests covering the scenario from customer-requests#1809 where
UpgradePluginVersion with an exact version could downgrade plugins
when versions are stored in a Kotlin DSL val variable shared across
multiple plugin declarations.

Also replace assert statements with proper null checks in the scanner
for the GString and Identifier variable branches to avoid silent null
storage when assertions are disabled.
@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite Feb 9, 2026
@MBoegers MBoegers force-pushed the mboegers/fix-upgrade-plugin-version-downgrade branch from 1c21f6d to 3004b88 Compare February 16, 2026 12:52
Expand dontDowngradeKotlinDslSharedVariable to use the complete
customer build file from customer-requests#1809, including all 5
Kotlin plugins, Spring Boot, dependency-management, application
plugin, dependencies block, and toolchain configuration.
@MBoegers MBoegers force-pushed the mboegers/fix-upgrade-plugin-version-downgrade branch from 3004b88 to 312d726 Compare February 16, 2026 12:55
@timtebeek
Copy link
Copy Markdown
Member

This seems similar to another change I've seen come by; do we still need this PR?

@MBoegers
Copy link
Copy Markdown
Contributor Author

I don't think so, it was "just" a reproducer PR, can you linke the PR?

@timtebeek
Copy link
Copy Markdown
Member

@MBoegers
Copy link
Copy Markdown
Contributor Author

retested and resolved

@MBoegers MBoegers closed this Feb 25, 2026
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Feb 25, 2026
@timtebeek timtebeek deleted the mboegers/fix-upgrade-plugin-version-downgrade branch February 25, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants