Skip to content

#2131: improve auto completion for ide upgrade mode#2164

Open
vivu001 wants to merge 9 commits into
devonfw:mainfrom
vivu001:feature/2131-Improve-auto-completion-for-ide-upgrade-mode
Open

#2131: improve auto completion for ide upgrade mode#2164
vivu001 wants to merge 9 commits into
devonfw:mainfrom
vivu001:feature/2131-Improve-auto-completion-for-ide-upgrade-mode

Conversation

@vivu001

@vivu001 vivu001 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

This PR fixes #2131

Implemented changes:

  • Added enum-based auto-completion support for CLI parameters using EnumProperty
  • Implemented value suggestions for --mode in UpgradeCommandlet
  • Enabled prefix-based filtering for parameter values (e.g. --mode=s)
  • Ensured completion output follows IDEasy token-based behavior (--key=value)
  • Added user-facing documentation for parameter value completion in CLI docs

Testing instructions

  1. Checkout the feature branch.
  2. Run the following script to build the native image: ./build-local-dev.sh.
  3. Start a new terminal session
    Ensure the newly built executable is picked up (restart shell if needed).
  4. Verify auto-completion suggestions: open a bash terminal, then run:
  • Case 1:
ide upgrade --mode=[Tab][Tab]

Expected output:
--mode=snapshot --mode=stable --mode=unstable

The suggested values correspond to all predefined values of the UpgradeMode enum.

  • Case 2: Verify prefix filtering
ide upgrade --mode=s[Tab][Tab]

Expected output:
--mode=snapshot --mode=stable

  • Case 3: Verify direct completion
ide upgrade --mode=st[Tab]

Expected output: the command is automatically completed with the matched value.
ide upgrade --mode=stable


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"

vivu001 added 6 commits July 13, 2026 17:52
Add enum value completion for `ide upgrade --mode` and keep the
implementation local to `UpgradeModeProperty`.
Preserve `--mode=` in shell completion so `ide upgrade --mode` can offer enum value suggestions correctly.
@github-project-automation github-project-automation Bot moved this to 🆕 New in IDEasy board Jul 14, 2026
@vivu001 vivu001 moved this from 🆕 New to 🏗 In progress in IDEasy board Jul 14, 2026
@vivu001 vivu001 added enhancement New feature or request commandlet ide sub-command labels Jul 14, 2026
@coveralls

coveralls commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 29421588719

Warning

No base build found for commit a88c41e on main.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 72.212%

Details

  • Patch coverage: No coverable lines changed in this PR.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 16740
Covered Lines: 12596
Line Coverage: 75.24%
Relevant Branches: 7468
Covered Branches: 4885
Branch Coverage: 65.41%
Branches in Coverage %: Yes
Coverage Strength: 3.18 hits per line

💛 - Coveralls

@vivu001 vivu001 self-assigned this Jul 14, 2026
@vivu001 vivu001 marked this pull request as ready for review July 14, 2026 15:33
@vivu001 vivu001 moved this from 🏗 In progress to Team Review in IDEasy board Jul 14, 2026
@oanding-blrng oanding-blrng self-assigned this Jul 15, 2026

@oanding-blrng oanding-blrng 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.

I was able to test the implemented auto-completion and can confirm that the described behaviour. After the suggestions this PR can move forward.

Image Example from my terminal after execution of `./build-local-dev.sh`.

Comment thread cli/src/main/java/com/devonfw/tools/ide/commandlet/UpgradeModeProperty.java Outdated
Comment thread cli/src/test/java/com/devonfw/tools/ide/commandlet/UpgradeCommandletTest.java Outdated
Comment thread documentation/cli.adoc Outdated
This can cause that the auto-completion of versions can take a few seconds sometimes.
However, we implemented a smart caching mechanism so we do not call `git pull` again if already done a minute ago.

The auto-completion also supports argument values.

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.

As someone reading this for the first time, I would assume, that argument values are supported everywhere within ide .... If this is in fact true, it's fine.

In case, there are still places, auto-completion for argument values are not implemented yet, this could cause confusion or bug reports and should be changed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed 😃. I’ll refine the wording slightly so it’s less likely to be misinterpreted.

@oanding-blrng

Copy link
Copy Markdown
Contributor

Please also change the title of this PR to follow the rules of DoD:

PR title is of the form #«issue-id»: «brief summary» (e.g. #921: fixed setup.bat). If no issue ID exists, title only.

@vivu001 vivu001 changed the title Feature/2131 improve auto completion for ide upgrade mode #2131: improve auto completion for ide upgrade mode Jul 15, 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

Projects

Status: Team Review

Development

Successfully merging this pull request may close these issues.

Improve auto-completion for "ide upgrade --mode" enum values

3 participants