Skip to content

#2312: Fix NPE in Uv.setEnvironment and suppress errors during auto-c… - #2332

Open
krystynaShatkovska wants to merge 3 commits into
devonfw:mainfrom
krystynaShatkovska:feature/issue-2312-python-uv-npe
Open

#2312: Fix NPE in Uv.setEnvironment and suppress errors during auto-c…#2332
krystynaShatkovska wants to merge 3 commits into
devonfw:mainfrom
krystynaShatkovska:feature/issue-2312-python-uv-npe

Conversation

@krystynaShatkovska

@krystynaShatkovska krystynaShatkovska commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

This PR fixes 2312

Implemented changes:

  • Change 1

Uv.java - Added a null check on getSoftwarePath(). If it is null, setEnvironment() returns early instead of crashing.

  • Change 2

AbstractIdeContext.java - In the catch (Throwable) block, exceptions during processable-output commandlets (like CompleteCommandlet) are no longer logged to stderr. The exception
still re-throws, but nothing reaches the user's screen, keeping auto-completion output clean.

Testing instructions

Test 1: Auto-completion outside an IDEasy project

Navigate to a directory that is NOT inside an IDEasy project
cd /tmp

Trigger auto-completion for Python versions (no IDE_HOME)
ide complete install python ""
Expected: Clean output with version suggestions only, no error messages, no NPE.
Before fix: NullPointerException error printed to console.

Test 2: Auto-completion inside an IDEasy project

Navigate to an IDEasy project
cd

ide complete install python ""
Expected: Clean output with version suggestions only.

Test 3: Normal error display for regular commands

cd /tmp
ide install python invalid-version-xyz
Expected: Error IS displayed normally (the user should see it for real commands, only auto-completion suppresses errors).

Test 4: Uv.setEnvironment with no IDE_HOME

cd /tmp
This should not crash even if it triggers uv environment setup
ide complete install python ""
Expected: No crash, clean output.

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» (e.g. #921: fixed setup.bat and not feature/921 fixed setup.bat). If no issue ID exists, title only.
  • PR top-level comment summaries 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 labelled
    with internal
  • You have not changed any dependency in pom.xml files or otherwise if runtime dependencies changed, you have updated our LICENSE.asciidoc
  • You have formulated clear instructions on how to test your contribution under "Testing instructions"

… auto-completion

Co-Authored-By: Capgemini Sovereign AI Platform
@github-project-automation github-project-automation Bot moved this to 🆕 New in IDEasy board Aug 14, 2026
@krystynaShatkovska krystynaShatkovska self-assigned this Aug 14, 2026
@krystynaShatkovska krystynaShatkovska added python runtime for python language completion auto-completion in bash or build in CLI logging IDEasy specific logging (levels, messages, etc.) uv fast Python package and project manager labels Aug 14, 2026
@krystynaShatkovska krystynaShatkovska moved this from 🆕 New to Team Review in IDEasy board Aug 14, 2026
@krystynaShatkovska krystynaShatkovska moved this from Team Review to 🏗 In progress in IDEasy board Aug 14, 2026
…ommandlets

The original fix wrapped both activateLogging() and step.error() inside
the isProcessableOutput check. However, step.error(t, true) logs at DEBUG
level (not ERROR) and is needed for proper step tracking and test assertions.

Only activateLogging() should be skipped to prevent errors from appearing
in the terminal during auto-completion.
@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 31788178452

Warning

No base build found for commit 31dabbf on main.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 72.864%

Details

  • Patch coverage: No coverable lines changed in this PR.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 17557
Covered Lines: 13344
Line Coverage: 76.0%
Relevant Branches: 7767
Covered Branches: 5108
Branch Coverage: 65.77%
Branches in Coverage %: Yes
Coverage Strength: 3.23 hits per line

💛 - Coveralls

@samuelkos17 samuelkos17 self-assigned this Aug 14, 2026
@samuelkos17 samuelkos17 moved this from 🏗 In progress to Team Review in IDEasy board Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

completion auto-completion in bash or build in CLI logging IDEasy specific logging (levels, messages, etc.) python runtime for python language uv fast Python package and project manager

Projects

Status: Team Review

Development

Successfully merging this pull request may close these issues.

3 participants