Skip to content

#1953: Complete cleanup commandlet implementation and review handover - #2230

Merged
hohwille merged 45 commits into
devonfw:mainfrom
Caylipp:feature/1953-cleanup-commandlet-handover
Aug 6, 2026
Merged

#1953: Complete cleanup commandlet implementation and review handover#2230
hohwille merged 45 commits into
devonfw:mainfrom
Caylipp:feature/1953-cleanup-commandlet-handover

Conversation

@Caylipp

@Caylipp Caylipp commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

This PR fixes #1953

This PR completes and supersedes #1957 after the original author left the team.

Implemented changes:

  • Reused the existing global -f / --force mode instead of introducing a cleanup-specific force option.
  • Removed the obsolete --force-delete help entries.
  • Kept cleanup discovery stateless by creating the discovered-tool list locally for each execution.
  • Moved the cleanup model into reusable top-level classes in the lowercase commandlet.cleanup package.
  • Scanned all repositories below _ide/software, including default, maven, and custom repository IDs.
  • Matched project software references against resolved installation paths instead of relying on fixed path positions.
  • Supported project links to subdirectories of an installation, such as Contents/MacOS.
  • Supported the following software link structures:
    • software/<tool>
    • software/extra/<tool>
    • software/extra/<tool>/<name>
  • Stored project usage only on the concrete tool edition version.
  • Derived the unused state of editions and tools from their child versions.
  • Improved JavaDoc for the cleanup model and its properties.

Testing instructions

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

  1. mvn -pl cli -Dtest=CleanupCommandletTest test
  2. mvn clean test

Related

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). If no issue ID exists, title only.
  • PR top-level comment summarizes 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 labeled
    with internal
  • You have formulated clear instructions on how to test your contribution under "Testing instructions"

Checklist for tool commandlets

Have you added a new «tool» as commandlet? There are the following additional checks:

  • The tool can be installed automatically (during setup via settings) or via the commandlet call
  • The tool is isolated in its IDEasy project, see Sandbox Principle
  • The new tool is added to the table of tools in LICENSE.asciidoc
  • The new commandlet is a command-wrapper for «tool»
  • Proper help texts for all supported languages are added here
  • The new commandlet installs potential dependencies automatically
  • The variables «TOOL»_VERSION and «TOOL»_EDITION are honored by your commandlet
  • The new commandlet is tested on all platforms it is available for or tested on all platforms that are in scope of the linked issue

areinicke and others added 29 commits May 15, 2026 16:05
- scan all global software repositories
- detect used versions by resolved installation paths
- support links to installation subfolders and nested extra tools
- make cleanup discovery stateless
- track project usage only on version level
- reuse the global force mode for confirmation
- add regression tests for used and unused installations
@coveralls

coveralls commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 31014731240

Coverage increased (+0.3%) to 72.861%

Details

  • Coverage increased (+0.3%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 28 coverage regressions across 4 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

28 previously-covered lines in 4 files lost coverage.

File Lines Losing Coverage Coverage
com/devonfw/tools/ide/context/IdeContext.java 17 77.46%
com/devonfw/tools/ide/commandlet/CommandletManagerImpl.java 7 91.94%
com/devonfw/ide/gui/context/ProjectManager.java 3 86.67%
com/devonfw/tools/ide/version/VersionSegment.java 1 91.86%

Coverage Stats

Coverage Status
Relevant Lines: 17453
Covered Lines: 13262
Line Coverage: 75.99%
Relevant Branches: 7721
Covered Branches: 5080
Branch Coverage: 65.79%
Branches in Coverage %: Yes
Coverage Strength: 3.23 hits per line

💛 - Coveralls

@quando632 quando632 self-assigned this Jul 29, 2026

@hohwille hohwille left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We are closing the finishing line 👍
Still I found some points...

Comment thread cli/src/main/java/com/devonfw/tools/ide/commandlet/cleanup/CleanupIdeTool.java Outdated
Comment thread cli/src/main/java/com/devonfw/tools/ide/commandlet/cleanup/CleanupCommandlet.java Outdated
Comment thread cli/src/main/java/com/devonfw/tools/ide/commandlet/cleanup/CleanupCommandlet.java Outdated
Comment thread cli/src/main/java/com/devonfw/tools/ide/commandlet/cleanup/CleanupCommandlet.java Outdated
Comment thread cli/src/main/java/com/devonfw/tools/ide/commandlet/cleanup/CleanupCommandlet.java Outdated

@quando632 quando632 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.

Thanks for picking this up the substance of the #1957 review is addressed and the new tests cover exactly the cases that were requested there. I went through the branch and found a few points before this can go in, three of them blocking from my side:

  • the new tests error out on Windows without symlink privileges (verified locally, 3 of 4 tests)
  • the CHANGELOG entry landed in an already released section
  • the confirmation cannot actually be skipped with -f alone

The remaining ones are smaller correctness and consistency points. I left out anything already covered by the review above (common super class for the model classes, delete flag only on version level, central findProjects()).

Comment thread CHANGELOG.adoc Outdated
Comment thread cli/src/main/resources/nls/Help.properties Outdated
Comment thread cli/src/main/java/com/devonfw/tools/ide/commandlet/cleanup/CleanupCommandlet.java Outdated
Comment thread cli/src/main/java/com/devonfw/tools/ide/commandlet/cleanup/CleanupCommandlet.java Outdated
Caylipp and others added 7 commits July 30, 2026 14:02
- add common abstract base class for installed software items
- centralize software item name and path
- rename cleanup model classes for reuse
- keep deletion state only on software versions
- delete unused versions before empty parent folders
- remove redundant deletion state from tools and editions
- add reusable project discovery to IdeContext
- exclude non project folders centrally
- reuse project discovery in cleanup and GUI
- scan default, Maven, and configured custom repositories explicitly
- update cleanup test for the configured custom repository
Co-authored-by: quando632 <quang-hieu.do@capgemini.com>
- add better help message
- propagate user cancellation through the standard abort handling
- correct software discovery variable names
- report affected tools and editions accurately
- cover batch force mode and Windows symlink restrictions
- adjust CHANGELOG.adoc entry

@quando632 quando632 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.

All eight points from my previous review are addressed on dc95fdea. mvn -Dtest=CleanupCommandletTest test is green (5 tests, 3 skipped for missing symlink privileges), and checkstyle and spotless report no violations in the new files. Solving the counter problem by reporting "affected" tools and editions is nicer than what I suggested.

Two issues came out of the changes themselves, one of them blocking. Both only appear when the individual fixes are combined, so they are not visible in any single change.

Comment thread cli/src/main/java/com/devonfw/tools/ide/commandlet/cleanup/CleanupCommandlet.java Outdated
Comment thread cli/src/main/java/com/devonfw/tools/ide/commandlet/cleanup/CleanupCommandlet.java Outdated
Comment thread cli/src/main/java/com/devonfw/tools/ide/commandlet/cleanup/CleanupCommandlet.java Outdated
@Caylipp Caylipp moved this from Team Review to 👀 In review in IDEasy board Aug 4, 2026

@hohwille hohwille left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Caylipp thanks for taking up this story and PR. 👍
I still have suggestions for improvement.
I hope you can address them tomorrow and I can merge the next day what would be awesome.
If you are running out of time, you may skip some "nice to haves" and I will create a cleanup issue and merge then. Thanks.

Comment thread cli/src/main/java/com/devonfw/tools/ide/commandlet/cleanup/CleanupCommandlet.java Outdated
Comment thread cli/src/main/java/com/devonfw/tools/ide/commandlet/cleanup/CleanupCommandlet.java Outdated
Comment thread cli/src/main/java/com/devonfw/tools/ide/commandlet/cleanup/CleanupCommandlet.java Outdated
@Caylipp Caylipp changed the title #1953: Complete cleanup commandlet implementation and review handoverShow more lines #1953: Complete cleanup commandlet implementation and review handoverShow Aug 5, 2026
@Caylipp Caylipp changed the title #1953: Complete cleanup commandlet implementation and review handoverShow #1953: Complete cleanup commandlet implementation and review handover Aug 5, 2026
Caylipp and others added 3 commits August 5, 2026 14:33
…anupCommandlet.java

Co-authored-by: Jörg Hohwiller <hohwille@users.noreply.github.com>
- index installed versions by path
- replace nested version lookup with map based lookup
- preserve lookup for referenced subdirectories
- centralize hierarchy updates through add methods
- use a set for projects using a version
@hohwille

hohwille commented Aug 6, 2026

Copy link
Copy Markdown
Member

Build failed with:

[ERROR] Errors: 
[ERROR]   TaskWindowTest.listContentsAreCoherent:111 » ConcurrentModification
[INFO] 
[ERROR] Tests run: 56, Failures: 0, Errors: 1, Skipped: 0

Seems to be #2242 - I restarted the build and hope we get a green run.
Will also look at PR for #2242 and get this merged/fixed.
If that goes fast, I can also just sync this PR with main.

@hohwille
hohwille merged commit f0f4c29 into devonfw:main Aug 6, 2026
4 of 5 checks passed
@github-project-automation github-project-automation Bot moved this from 👀 In review to ✅ Done in IDEasy board Aug 6, 2026
@hohwille hohwille added this to the release:2026.08.001 milestone Aug 6, 2026
@quando632

Copy link
Copy Markdown
Contributor

Successfully tested with ide-cli 2026.08.001-SNAPSHOT on Windows

@quando632 quando632 added the QA approved Label a PR that has been re-testet via nightly SNAPSHOT after merge and commented. label Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commandlet ide sub-command enhancement New feature or request QA approved Label a PR that has been re-testet via nightly SNAPSHOT after merge and commented.

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Implement Base Functionality of Cleanup Commandlet

6 participants