Skip to content

#1659: abort runTool with warning when global tool installer runs in background#2113

Open
Ali-Shariati-Najafabadi wants to merge 5 commits into
devonfw:mainfrom
Ali-Shariati-Najafabadi:feature/1659-global-tool-async-install
Open

#1659: abort runTool with warning when global tool installer runs in background#2113
Ali-Shariati-Najafabadi wants to merge 5 commits into
devonfw:mainfrom
Ali-Shariati-Najafabadi:feature/1659-global-tool-async-install

Conversation

@Ali-Shariati-Najafabadi

@Ali-Shariati-Najafabadi Ali-Shariati-Najafabadi commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

This PR fixes #1659

Implemented changes:

  • Added installedAsynchronously flag to ToolInstallation record to signal that a background installer was launched and the tool is not yet available
  • In GlobalToolCommandlet.doInstall(), return ToolInstallation with installedAsynchronously=true instead of throwing a CliException when the installation path is not yet available after launching the background installer
  • In ToolCommandlet.runTool(), check the new flag and log a warning to the user instead of trying to execute the not-yet-available binary

Testing instructions

  1. Run unit test: mvn test -pl cli -Dtest=GlobalToolCommandletTest
  2. For manual testing on Windows (Docker not installed):
    • Temporarily change GlobalToolCommandlet.java line 175 to always return new ToolInstallation(null, null, null, resolvedVersion, true, true)
    • Run: Ideasy.main() with Program arguments : docker ps
    • Expected output: warning message about background installation instead of docker: command not found
    • Revert the temporary change afterwards

Checklist for this PR

  • When running mvn clean test locally all tests pass and build is successful
  • PR title is of the form #«issue-id»: «brief summary»
  • 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
  • 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"

@github-project-automation github-project-automation Bot moved this to 🆕 New in IDEasy board Jul 5, 2026
@Ali-Shariati-Najafabadi Ali-Shariati-Najafabadi added docker docker and esp. DockerDesktop install installation process of IDE + tools and install commandlet kubectl kubernetes command integration bugfix PR that fixes a bug issue labels Jul 5, 2026
@Ali-Shariati-Najafabadi Ali-Shariati-Najafabadi moved this from 🆕 New to 🏗 In progress in IDEasy board Jul 5, 2026
@coveralls

coveralls commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 28826464634

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage increased (+0.05%) to 71.809%

Details

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

Uncovered Changes

No uncovered changes found.

Coverage Regressions

232 previously-covered lines in 14 files lost coverage.

Top 10 Files by Coverage Loss Lines Losing Coverage Coverage
com/devonfw/tools/ide/context/AbstractIdeContext.java 56 67.59%
com/devonfw/tools/ide/tool/ToolCommandlet.java 51 74.08%
com/devonfw/ide/gui/MainController.java 26 59.0%
com/devonfw/ide/gui/App.java 25 0.0%
com/devonfw/tools/ide/version/VersionIdentifier.java 21 81.85%
com/devonfw/tools/ide/process/ProcessContextImpl.java 16 81.38%
com/devonfw/tools/ide/version/VersionLetters.java 11 81.76%
com/devonfw/tools/ide/tool/GlobalToolCommandlet.java 8 2.34%
com/devonfw/tools/ide/version/VersionSegment.java 7 91.08%
com/devonfw/tools/ide/tool/claude/Claude.java 4 84.62%

Coverage Stats

Coverage Status
Relevant Lines: 16564
Covered Lines: 12398
Line Coverage: 74.85%
Relevant Branches: 7440
Covered Branches: 4839
Branch Coverage: 65.04%
Branches in Coverage %: Yes
Coverage Strength: 3.17 hits per line

💛 - Coveralls

@Ali-Shariati-Najafabadi Ali-Shariati-Najafabadi moved this from 🏗 In progress to Team Review in IDEasy board Jul 5, 2026
@Ali-Shariati-Najafabadi Ali-Shariati-Najafabadi moved this from Team Review to 🏗 In progress in IDEasy board Jul 5, 2026
@hohwille hohwille moved this from 🏗 In progress to Team Review in IDEasy board Jul 6, 2026

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

You did a really great job. I just have one small correction for the ide install <globalTool> test because it loses the log to reboot

Comment thread cli/src/main/java/com/devonfw/tools/ide/tool/ToolCommandlet.java
Comment thread cli/src/test/java/com/devonfw/tools/ide/tool/GlobalToolCommandletTest.java Outdated
@Ali-Shariati-Najafabadi Ali-Shariati-Najafabadi moved this from Team Review to 👀 In review in IDEasy board Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PR that fixes a bug issue docker docker and esp. DockerDesktop install installation process of IDE + tools and install commandlet kubectl kubernetes command integration

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

Global tools run tool while installation is running in background

4 participants