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

coveralls commented Jan 8, 2026

Pull Request Test Coverage Report for Build 21099077048

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.009%) to 70.346%

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 21013786095: -0.009%
Covered Lines: 10444
Relevant Lines: 14259

💛 - Coveralls

@maybeec maybeec moved this from 🆕 New to Team Review in IDEasy board Jan 8, 2026
@hohwille hohwille added this to the release:2026.01.001 milestone Jan 15, 2026
@hohwille
Copy link
Member

@maybeec thanks for your PR. Awesome that you did the analysis and fix of this issue.
I definitely want to get this merged and included in the upcoming release. 👍
Since I need some more time to review, I will postpone the release by 1-2 days to get all your great work into it...

Copy link
Member

@hohwille hohwille left a comment

Choose a reason for hiding this comment

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

@maybeec thanks again for this great PR. 👍
So scanning vor env variables iterating the commandlets, we ran every package manager based commandlet triggering an installation that checked for updates and installed them if available.
I now understand why I only saw the download and extract progress bar but no info what tool this is about:
When we run ide env we disable our regular logging and suppress all messages except the environment variables. However, the progress-bar component we are using is not using our logging infrastructure and directly writes to the console bypassing this (see #627).
So this was actually the tool uv (for python/pip) that ships updates very frequently.

I left a small suggestion for improvement. Apart from that we can merge this and finally fix the bug.

@github-project-automation github-project-automation bot moved this from Team Review to 👀 In review in IDEasy board Jan 15, 2026
@hohwille hohwille merged commit 4d9fc2d into devonfw:main Jan 17, 2026
4 checks passed
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in IDEasy board Jan 17, 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: ✅ Done

Development

Successfully merging this pull request may close these issues.

ide command without arguments triggers download and installation

3 participants