Skip to content

#1031: integrate openrewrite - #2299

Open
samuelkos17 wants to merge 29 commits into
devonfw:mainfrom
samuelkos17:feature/1031_integrate_with_openrewrite
Open

#1031: integrate openrewrite#2299
samuelkos17 wants to merge 29 commits into
devonfw:mainfrom
samuelkos17:feature/1031_integrate_with_openrewrite

Conversation

@samuelkos17

@samuelkos17 samuelkos17 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

This PR fixes #1031

Old PR was #1266

Implemented changes:

  • RewriteCommandlet — new commandlet to execute OpenRewrite recipes
  • RecipeManager — manages and loads configurable OpenRewrite recipes
  • RecipeWrapper / RecipeWrapperJsonDeserializer — wrapper and JSON deserializer for recipe configuration
  • RewriteRecipeEnum — enum for predefined rewrite recipes
  • JSON configuration files (refactor/openrewrite.json) for defining recipes
  • Help texts for the rewrite command in English and German
  • Updated CommandletManagerImpl, JsonMapping, and native-image reflect/resource configs to support the new modules
  • Added tests for RewriteCommandlet and RecipeManager

Testing instructions

Please add conscise, understandable instructions on how a reviewer can test/verify the functionality of your contribution here:

  1. Run mvn clean test in the cli module to verify all tests pass
  2. Test the rewrite commandlet manually with the provided openrewrite.json configuration using the local dev build.
  3. Verify help texts are displayed correctly for the rewrite command

Checklist for this PR

Make sure everything is checked before merging this PR. For further info please also see
our DoD.

  • When running mvn clean test locally all tests pass and build is successful
  • PR title is of the form #«issue-id»: «brief summary» (e.g. #921: fixed setup.bat and not feature/921 fixed setup.bat). If no issue ID exists, title only.
  • PR top-level comment summaries what has been done and contains link to addressed issue(s)
  • PR and issue(s) have suitable labels
  • Issue is set to In Progress and assigned to you or there is no issue (might happen for very small PRs)
  • You followed all coding conventions
  • You have added the issue implemented by your PR in CHANGELOG.adoc unless issue is labelled
    with internal
  • You have not changed any dependency in pom.xml files or otherwise if runtime dependencies changed, you have updated our LICENSE.asciidoc
  • You have formulated clear instructions on how to test your contribution under "Testing instructions"

yurii-yu and others added 25 commits February 26, 2025 11:07
…nrewrite' into feature/1031_intergrate_with_openrewrite
…ith_openrewrite

# Conflicts:
#	cli/src/main/java/com/devonfw/tools/ide/commandlet/CommandletManagerImpl.java
#	cli/src/main/resources/nls/Help.properties
#	cli/src/main/resources/nls/Help_de.properties
…ith_openrewrite

# Conflicts:
#	cli/src/main/java/com/devonfw/tools/ide/commandlet/CommandletManagerImpl.java
#	cli/src/main/resources/nls/Help.properties
#	cli/src/main/resources/nls/Help_de.properties
…h_openrewrite

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
@github-project-automation github-project-automation Bot moved this to 🆕 New in IDEasy board Aug 10, 2026
@samuelkos17 samuelkos17 self-assigned this Aug 10, 2026
@samuelkos17 samuelkos17 moved this from 🆕 New to Team Review in IDEasy board Aug 10, 2026
@samuelkos17 samuelkos17 added the enhancement New feature or request label Aug 10, 2026
@samuelkos17 samuelkos17 added the rewrite command for OpenRewrite label Aug 10, 2026
@samuelkos17 samuelkos17 changed the title Feature/1031 integrate with openrewrite #1031 integrate with openrewrite Aug 10, 2026
@samuelkos17 samuelkos17 changed the title #1031 integrate with openrewrite #1031: integrate openrewrite Aug 10, 2026
@coveralls

coveralls commented Aug 16, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 32134237327

Coverage decreased (-0.06%) to 72.865%

Details

  • Coverage decreased (-0.06%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 8 coverage regressions across 2 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

8 previously-covered lines in 2 files lost coverage.

File Lines Losing Coverage Coverage
com/devonfw/tools/ide/commandlet/CommandletManagerImpl.java 7 92.02%
com/devonfw/tools/ide/json/JsonMapping.java 1 96.43%

Coverage Stats

Coverage Status
Relevant Lines: 17663
Covered Lines: 13420
Line Coverage: 75.98%
Relevant Branches: 7791
Covered Branches: 5127
Branch Coverage: 65.81%
Branches in Coverage %: Yes
Coverage Strength: 3.23 hits per line

💛 - Coveralls

@Ali-Shariati-Najafabadi Ali-Shariati-Najafabadi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice first step on the OpenRewrite integration. A few things before this can merge:

Missing CHANGELOG.adoc entry for #1031.
Left a few inline notes: an exception path that can leak a raw NPE, a redundant try/catch, some stale help text, and a bit of dead code.
Scope-wise, the original issue talked about AssertJ/Hamcrest/JUnit recipes plus a generic --artifact= option ,this PR only covers two formatting recipes. Might be fine as a first cut, but worth checking with a maintainer whether that's okay to merge as-is.

Comment thread cli/src/main/java/com/devonfw/tools/ide/commandlet/RewriteCommandlet.java Outdated
Comment thread cli/src/main/java/com/devonfw/tools/ide/tool/openrewrite/RecipeManager.java Outdated
Comment thread cli/src/main/java/com/devonfw/tools/ide/tool/openrewrite/RecipeManager.java Outdated
Comment thread cli/src/main/java/com/devonfw/tools/ide/tool/openrewrite/RecipeWrapper.java Outdated
Comment thread cli/src/main/resources/nls/Help.properties Outdated
Comment thread cli/src/main/resources/nls/Help.properties Outdated
Comment thread cli/src/main/resources/nls/Help_de.properties Outdated
Comment thread cli/src/main/resources/nls/Help_de.properties Outdated
Comment thread cli/src/test/java/com/devonfw/tools/ide/commandlet/RewriteCommandletTest.java Outdated
Comment thread cli/src/test/java/com/devonfw/tools/ide/commandlet/RewriteCommandletTest.java Outdated
@samuelkos17

Copy link
Copy Markdown
Contributor Author

@Ali-Shariati-Najafabadi thanks for all the Review suggestions! I agree with you on all of them and added them all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request rewrite command for OpenRewrite

Projects

Status: Team Review

Development

Successfully merging this pull request may close these issues.

Integration of OpenRewrite

7 participants