Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve feedback messages #898

Open
3 tasks done
WorkingAmeise opened this issue Dec 13, 2024 · 2 comments · May be fixed by #903
Open
3 tasks done

Improve feedback messages #898

WorkingAmeise opened this issue Dec 13, 2024 · 2 comments · May be fixed by #903
Assignees
Labels
enhancement New feature or request

Comments

@WorkingAmeise
Copy link
Contributor

WorkingAmeise commented Dec 13, 2024

As a IDEasy User, I want understandable and descriptive feedback messages when the software performs tasks

get-edition / get-version

  • calling with commandlets, that are not installed atm should result in an info message (currently prints an empty line)

uninstall

  • calling with commandlets, that are not installed atm currently only prints: "Couldn't uninstall docker". Should be enhanced by : "Because docker was not installed previously"

uninstall-plugin

  • Should log any success/failure message (currently does not print anything)
@WorkingAmeise WorkingAmeise added the enhancement New feature or request label Dec 13, 2024
@WorkingAmeise WorkingAmeise moved this to 🆕 New in IDEasy board Dec 13, 2024
@WorkingAmeise WorkingAmeise self-assigned this Dec 13, 2024
@WorkingAmeise WorkingAmeise moved this from 🆕 New to 🏗 In progress in IDEasy board Dec 13, 2024
@hohwille
Copy link
Member

hohwille commented Dec 17, 2024

For get-edition and get-version I still recommend that without any other arguments, this should print the configured value if the tool is not already installed.
Also it IMHO makes sense that if I do ide set-version mvn 3.9.9 and then call ide get-version mvn I should actually get 3.9.9 what is a natural expectation (I get back what I just have set).
However, this will currently not work and is IMHO only causing confusion.

  • So to fix this this issue should be implemented such that if the tool is not installed, the configured value is printed (because when I would install the tool now that version/edition is going to be installed).
  • Additionally to make the set-* and get-* commandlets really symmetric, the set-* commandlets should additionally be changed such that if I override the edition of version not in settings/ide.properties but e.g. in conf/ide.properties then the set-version/set-edition commandlet will actually change the configured value there (unless explicitly configured via e.g. --cfg=settings).

Finally, we must be aware that it is also possible to install a tool and afterwards configuring the version/edition otherwise.
In such case it will be correct that after ide set-version mvn 3.9.9 and then call ide get-version mvn we get the previously installed version of maven.
The user has the following options:

ide -d get-version mvn

This will print both the installed and the configured version including additional debug output.

ide get-version --configured --installed mvn

This will print both the installed and the configured version without additional debug output.
Please also note that if configured and installed version/edition are identical, then still only one version/edition is printed without further details.
Also I can explicitly request only the configured (--configured) or the installed (--installed) version by providing only one of these two long options.
And for the record:
The current implementation of these commandlets is quite buggy:

$ ide -d get-version mvn
Running commandlet VersionGetCommandlet[get-version]
Configuration directory C:\Users\hohwille\.ide does not exist.
The installed version for tool mvn is 3.9.9
The configured version for tool mvn is 4.0.0-rc-1
To install that version call the following command:
ide install mvn
Step 'ide' ended successfully.

This looks correct. But...

$ ide get-version --configured --installed mvn

$

This should print both the configured and the installed version but for some unclear reason it prints nothing at all (my assumption is that some stuff is logged on INFO that now instead needs to be logged on PROCESSABLE).
Further while testing this I also found a bug that ide set-version mvn 4.0.0-rc-1 was creating an ide.properties from devon.properties but produced nonsense:
devon.properties had this content:

MVN_VERSION=3.9.6
MAVEN_VERSION=${MVN_VERSION}

And the resulting ide.properties had this content:

MVN_VERSION=4.0.0-rc-1
MVN_VERSION=${MVN_VERSION}

The second line is what I consider as nonsense.

@WorkingAmeise
Copy link
Contributor Author

WorkingAmeise commented Dec 18, 2024

This should print both the configured and the installed version but for some unclear reason it prints nothing at all (my assumption is that some stuff is logged on INFO that now instead needs to be logged on PROCESSABLE).

I fixed it to print both versions under each other, starting with the configured version. In Case of a not installed tool, only the configured version/edition is logged, however the user could not differentiate between the output in case both versions are the same and the output in case there is no installed version since both only log one output. Is there a problem with this or is this expected behavior?

WorkingAmeise pushed a commit to WorkingAmeise/IDEasy that referenced this issue Dec 19, 2024
Edition/VersionGetCommandlet changed them to log the configured option if the tool is not installed and the installed option if it is installed.
Changed the toolInstallInfo method to log into IdeSublogger instead of using context.info or context.warning.
Changed the uninstall commandlet to log a warning in case the requested commandlet is not installed.
Changed the uninstallPlugin commandlet to give feedback wether the plugin could be deleted or if there was not installation found.
Adjusted Tests for Edition/VersionGetCommandlet as well as Uninstall commandlet to expect the correct loglevel or content of logged messages.
Added logAtProccessable to IdeTestContextAssertions to check if a log-message was logged on PROCESSABLE-level.
Added .ide.software.version file to the npm software in the basic ide-test-project-ressource, since it was needed to test my implementation.
WorkingAmeise pushed a commit to WorkingAmeise/IDEasy that referenced this issue Dec 19, 2024
added CHANGELOG entry
@WorkingAmeise WorkingAmeise linked a pull request Dec 19, 2024 that will close this issue
@hohwille hohwille added this to the release:2025.01.001 milestone Dec 20, 2024
hohwille added a commit to WorkingAmeise/IDEasy that referenced this issue Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 🏗 In progress
Development

Successfully merging a pull request may close this issue.

2 participants