#1517: configure Git Bash in Windows Terminal during MSI installation#2079
Draft
quando632 wants to merge 2 commits into
Draft
#1517: configure Git Bash in Windows Terminal during MSI installation#2079quando632 wants to merge 2 commits into
quando632 wants to merge 2 commits into
Conversation
Collaborator
Coverage Report for CI Build 28240448711Coverage increased (+0.004%) to 71.36%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions42 previously-covered lines in 1 file lost coverage.
Coverage Stats💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes #1517
Implemented changes:
NullPointerExceptioninIdeasyCommandlet.configureGitBashProfile(...)that occurred whenIDE_ROOTis not yet set, exactly the case during a fresh MSI installation. The code calledthis.context.getIdeRoot().toString()unconditionally; since the NPE was swallowed by the surroundingtry/catch, it was only logged asFailed to configure Git Bash in Windows Terminal: nulland the Git Bash profile was never added to Windows Terminal. It now falls back to the user home directory asstartingDirectoryviaObjects.requireNonNullElse(...).setup.batfrom within an existing project worked (thereIDE_ROOTis set), while the MSI installer did not (noIDE_ROOTon a fresh machine).configureWindowsTerminalGitBashtest with a@ParameterizedTestthat covers both cases (IDE_ROOTset and unset) and fixed an unusedSystemInfovariable that was never applied to the test context.CHANGELOG.adoc.Testing instructions
Automated (proves the fix):
Run the regression test both parameterized runs (
IDE_ROOTset + unset) must pass:mvn -pl cli -Dtest=IdeasyCommandletTest#testConfigureWindowsTerminalGitBash test
Negative control, re-introduce the bug to confirm the test catches it. In
cli/src/main/java/com/devonfw/tools/ide/tool/IdeasyCommandlet.java:Re-run the command from step 1. The
IDE_ROOT == nullrun now fails: theNullPointerExceptionis swallowed by the surroundingtry/catchand logged as the exactmessage from the issue (
Failed to configure Git Bash in Windows Terminal: null), so theGit Bashprofile is never written tosettings.json. Revert both lines (e.g.git checkout cli/src/main/java/com/devonfw/tools/ide/tool/IdeasyCommandlet.java) → green again.Checklist for this PR
Make sure everything is checked before merging this PR. For further info please also see
our DoD.
mvn clean testlocally all tests pass and build is successful#«issue-id»: «brief summary»(e.g.#921: fixed setup.bat). If no issue ID exists, title only.In Progressand assigned to you or there is no issue (might happen for very small PRs)with
internal