Skip to content

Conversation

@maybeec
Copy link
Member

@maybeec maybeec commented Jan 8, 2026

Summary

Fixes #1667 - Running ide without arguments was triggering unexpected downloads and installations.

Root Cause

The issue occurred because EnvironmentCommandlet.setEnvironmentVariablesInLocalTools() iterates through all local tools and calls isInstalled() on each. For package-manager-based tools (pip, npm, yarn, etc.), the inherited isInstalled() implementation was calling getInstalledVersion()computeInstalledVersion()runPackageManager() without skipInstallation=true, which triggered installation cascades.

See detailed analysis in issue comment.

Solution

Override isInstalled() in PackageManagerBasedLocalToolCommandlet to use file existence check with SystemPath.findBinary() instead of version computation. This prevents triggering the package manager during environment setup while still correctly detecting installed tools.

Changes

  • ✅ Override isInstalled() in PackageManagerBasedLocalToolCommandlet using platform-specific binary resolution
  • ✅ Add @implNote warning to computeInstalledVersion() JavaDoc
  • ✅ Remove redundant isInstalled() from NodeBasedCommandlet (now inherited)
  • ✅ Add test testRunWithoutArgumentsDoesNotTriggerInstallation() in IdeasyTest
  • ✅ Update CHANGELOG.adoc

Testing

  • All existing tests pass (2/2 in IdeasyTest, 2/2 in EnvironmentCommandletTest)
  • New test verifies running ide without arguments doesn't create new tool directories

Checklist

  • Changes comply with coding conventions
  • All tests pass locally
  • Test added to verify fix
  • CHANGELOG.adoc updated
  • Commit message follows format: #«issue-id»: «describe your change»

Override isInstalled() in PackageManagerBasedLocalToolCommandlet to use file existence check instead of version computation which was triggering package manager execution and causing unintended installations.

- Add isInstalled() override using SystemPath.findBinary() for platform-specific binary resolution
- Update JavaDoc for computeInstalledVersion() with warning about not triggering installations
- Remove redundant isInstalled() override from NodeBasedCommandlet
- Add test in IdeasyTest to verify running 'ide' without arguments doesn't trigger installations
- Update CHANGELOG.adoc
@github-project-automation github-project-automation bot moved this to 🆕 New in IDEasy board Jan 8, 2026
@maybeec maybeec added bugfix PR that fixes a bug issue download download of tools, plugins, code from git, any HTTP traffic over the network labels Jan 8, 2026
@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 20817627478

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 13 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.02%) to 69.884%

Files with Coverage Reduction New Missed Lines %
com/devonfw/tools/ide/tool/node/NodeBasedCommandlet.java 3 78.26%
com/devonfw/tools/ide/tool/PackageManagerBasedLocalToolCommandlet.java 10 81.61%
Totals Coverage Status
Change from base Build 20815639483: -0.02%
Covered Lines: 10195
Relevant Lines: 14010

💛 - Coveralls

@maybeec maybeec moved this from 🆕 New to Team Review in IDEasy board Jan 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 download download of tools, plugins, code from git, any HTTP traffic over the network

Projects

Status: Team Review

Development

Successfully merging this pull request may close these issues.

ide command without arguments triggers download and installation

2 participants