Skip to content

#2718: do not log variable values at trace level - #2739

Open
Ali-Shariati-Najafabadi wants to merge 4 commits into
devonfw:mainfrom
Ali-Shariati-Najafabadi:feature/2718-trace-log-writes-the-values-of
Open

Ali-Shariati-Najafabadi wants to merge 4 commits into
devonfw:mainfrom
Ali-Shariati-Najafabadi:feature/2718-trace-log-writes-the-values-of

Conversation

@Ali-Shariati-Najafabadi

@Ali-Shariati-Najafabadi Ali-Shariati-Najafabadi commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

This PR fixes #2718

EnvironmentVariablesMap.getFlat logged Variable NAME=value at trace level for every variable it read, so secrets from conf/ide.properties ended up in the trace log. The trace messages no longer contain the value.

Implemented changes:

  • EnvironmentVariablesMap.getFlat logs Variable «name» is defined. instead of name and value
  • The "Normalized ... using ..." trace message now logs the variable name and the path syntax instead of the original and normalized value
  • Enabled the existing testAlreadyDefinedSecretIsNotLoggedInLogOutput in EnvironmentVariablesTest (it was disabled until this issue is fixed)
  • Added the entry to CHANGELOG.adoc

Testing instructions

Please add conscise, understandable instructions on how a reviewer can test/verify the functionality of your contribution here:

  1. In cli run mvn -Dtest=EnvironmentVariablesTest test. testAlreadyDefinedSecretIsNotLoggedInLogOutput fails without the change and passes with it.
  2. Add MY_TOKEN=secret-value to conf/ide.properties of a project and run ide --trace env.
  3. Check that the trace output has no line Variable MY_TOKEN=secret-value. The MY_TOKEN="secret-value" line is still printed, because printing the variables is what ide env does.

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 and not feature/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 labelled
    with internal
  • You have not changed any dependency in pom.xml files or otherwise if runtime dependencies changed,
    you have updated our LICENSE.adoc
  • You have formulated clear instructions on how to test your contribution under "Testing instructions"

@github-project-automation github-project-automation Bot moved this to 🆕 New in IDEasy board Oct 23, 2026
@Ali-Shariati-Najafabadi Ali-Shariati-Najafabadi added logging IDEasy specific logging (levels, messages, etc.) environment EnvironmentCommandlet, env variables, path, etc. bugfix PR that fixes a bug issue labels Oct 23, 2026
@coveralls

coveralls commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 41042797231

Coverage increased (+0.02%) to 75.309%

Details

  • Coverage increased (+0.02%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 3 coverage regressions across 2 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

3 previously-covered lines in 2 files lost coverage.

File Lines Losing Coverage Coverage
com/devonfw/tools/ide/environment/EnvironmentVariablesMap.java 2 80.95%
com/devonfw/tools/ide/version/VersionSegment.java 1 91.6%

Coverage Stats

Coverage Status
Relevant Lines: 19909
Covered Lines: 15645
Line Coverage: 78.58%
Relevant Branches: 8850
Covered Branches: 6013
Branch Coverage: 67.94%
Branches in Coverage %: Yes
Coverage Strength: 3.38 hits per line

💛 - Coveralls

@Ali-Shariati-Najafabadi
Ali-Shariati-Najafabadi marked this pull request as ready for review October 23, 2026 11:33
@Ali-Shariati-Najafabadi Ali-Shariati-Najafabadi moved this from 🆕 New to Team Review in IDEasy board Oct 23, 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 environment EnvironmentCommandlet, env variables, path, etc. logging IDEasy specific logging (levels, messages, etc.)

Projects

Status: Team Review

Development

Successfully merging this pull request may close these issues.

Trace log writes the values of secret variables

3 participants