Skip to content

#1965: improve dependent installations#2016

Open
AdemZarrouki wants to merge 8 commits into
devonfw:mainfrom
AdemZarrouki:feature/1965-improve-dependent-installations
Open

#1965: improve dependent installations#2016
AdemZarrouki wants to merge 8 commits into
devonfw:mainfrom
AdemZarrouki:feature/1965-improve-dependent-installations

Conversation

@AdemZarrouki

@AdemZarrouki AdemZarrouki commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

This PR fixes #1965

Implemented changes:

  • For NpmBasedCommandlet installed-version checks now call runPackageManager(request, true) which prevents npm list -g <package> --depth=0 from recursively triggering npm.install.
  • npm-based tools now skip the package-manager installation step when npm is already available.
  • The same was done for PipBasedCommandlet

Testing instructions

For the test you can use Intellij directly by running com.devonfw.tools.ide.cli.Ideasy with install <Tool> as arguments or using GraalVM and the call the created ideasy.exe with install <Tool>

  1. Run the ideasy cli with install nest: you see
$ ide install nest
No CVEs found for version 11.0.21 of tool nest.
added 210 packages in 23s
39 packages are looking for funding
  run `npm fund` for details
Successfully installed nest in version 11.0.21 at C:\Users\projects\IDEasy\software\node
  1. For tools that has a declared dependency on node like ng we get this:
$ ide install ng
No CVEs found for version 22.0.1 of tool ng.
No CVEs found for version v24.16.0 of tool node.
Version v24.16.0 of tool node is already installed
npm warn using --force Recommended protections disabled.

added 276 packages in 29s

68 packages are looking for funding
  run `npm fund` for details
Successfully installed ng in version 22.0.1 at C:\Users\projects\IDEasy\software\node
  1. No reduandant call of node or npm should be present to the user.

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"

@coveralls

coveralls commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 27610519697

Coverage increased (+0.03%) to 71.313%

Details

  • Coverage increased (+0.03%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 1 coverage regression across 1 file.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

1 previously-covered line in 1 file lost coverage.

File Lines Losing Coverage Coverage
com/devonfw/tools/ide/tool/ide/IdeToolCommandlet.java 1 78.33%

Coverage Stats

Coverage Status
Relevant Lines: 16224
Covered Lines: 12062
Line Coverage: 74.35%
Relevant Branches: 7250
Covered Branches: 4678
Branch Coverage: 64.52%
Branches in Coverage %: Yes
Coverage Strength: 3.15 hits per line

💛 - Coveralls

@AdemZarrouki AdemZarrouki added enhancement New feature or request npm node package manager pip Python package manager (Pip Installs Packages) dependencies dependencies.json (if tool A requires tool B) labels Jun 12, 2026
@AdemZarrouki AdemZarrouki marked this pull request as ready for review June 12, 2026 07:40
@AdemZarrouki AdemZarrouki self-assigned this Jun 12, 2026
@AdemZarrouki AdemZarrouki moved this from 🆕 New to Team Review in IDEasy board Jun 12, 2026
@laert-ll laert-ll self-requested a review June 12, 2026 08:52
@laert-ll laert-ll self-assigned this Jun 12, 2026

@laert-ll laert-ll 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 want to make sure I understand the scope correctly: the issue description gave me the impression that the fix was supposed to be on a bigger scale (using the parent install request so loops get detected on their own). So is it intentional to use the skipInstallation as a workaround or am I missing something?
Also it might be a good idea to add some tests for this as well.

Everything works well, the issue is solved in a simple way and removes the problem, thanks for your work!

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.

Is there any particular reason why Pip doesn't override isSkipInstallation() in the same way that Npm does?

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.

because i didn't found a loop dependency that can occurs in pip context.

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.

regarding tests i will add some junit tests in NgTest and NestTest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies dependencies.json (if tool A requires tool B) enhancement New feature or request npm node package manager pip Python package manager (Pip Installs Packages)

Projects

Status: Team Review

Development

Successfully merging this pull request may close these issues.

Improve dependent installations

3 participants