-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Remove duplicate SDK environment variable log messages and unused string resources #12918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
These log messages were cluttering the structured log viewer with repeated messages about DOTNET_HOST_PATH and other SDK environment variables. Since these messages report normal expected behavior and aren't actionable for users, they have been removed entirely. Co-authored-by: YuliiaKovalova <[email protected]>
| // If the property has already been set as an environment variable, we do not overwrite it. | ||
| if (_environmentVariableProperties.Contains(name)) | ||
| { | ||
| _loggingContext.LogComment(MessageImportance.Low, "SdkEnvironmentVariableAlreadySet", name, value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot do we need these strings in other places?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! The string resources were not used anywhere else in the codebase. I've removed them from Strings.resx and all localized .xlf files in commit 743e2d2.
The string resources SdkEnvironmentVariableAlreadySet, SdkEnvironmentVariableAlreadySetBySdk, and SdkEnvironmentVariableSet are no longer used after removing the log messages that referenced them. This removes them from Strings.resx and all localized .xlf files. Co-authored-by: YuliiaKovalova <[email protected]>
|
This removes the logging entirely, right? How do we know if/how the SdkResolvers had any impact on the overall evaluation - does the viewer still show them as Properties in the eval (I'd expect so)? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR removes non-actionable log messages about SDK environment variable operations that were cluttering structured log viewers. The changes eliminate three LogComment calls from AddSdkResolvedEnvironmentVariable() and clean up the associated unused string resources from all localization files.
- Removed logging of SDK environment variable setting operations (already set as env var, already set by another SDK, and successful set)
- Cleaned up three unused string resources from
Strings.resxand all 13 localized.xlffiles
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Build/Instance/ProjectInstance.cs | Removed three LogComment calls from AddSdkResolvedEnvironmentVariable() method |
| src/Build/Resources/Strings.resx | Removed three unused string resource definitions |
| src/Build/Resources/xlf/Strings.cs.xlf | Removed Czech translations for the three unused string resources |
| src/Build/Resources/xlf/Strings.de.xlf | Removed German translations for the three unused string resources |
| src/Build/Resources/xlf/Strings.es.xlf | Removed Spanish translations for the three unused string resources |
| src/Build/Resources/xlf/Strings.fr.xlf | Removed French translations for the three unused string resources |
| src/Build/Resources/xlf/Strings.it.xlf | Removed Italian translations for the three unused string resources |
| src/Build/Resources/xlf/Strings.ja.xlf | Removed Japanese translations for the three unused string resources |
| src/Build/Resources/xlf/Strings.ko.xlf | Removed Korean translations for the three unused string resources |
| src/Build/Resources/xlf/Strings.pl.xlf | Removed Polish translations for the three unused string resources |
| src/Build/Resources/xlf/Strings.pt-BR.xlf | Removed Brazilian Portuguese translations for the three unused string resources |
| src/Build/Resources/xlf/Strings.ru.xlf | Removed Russian translations for the three unused string resources |
| src/Build/Resources/xlf/Strings.tr.xlf | Removed Turkish translations for the three unused string resources |
| src/Build/Resources/xlf/Strings.zh-Hans.xlf | Removed Simplified Chinese translations for the three unused string resources |
| src/Build/Resources/xlf/Strings.zh-Hant.xlf | Removed Traditional Chinese translations for the three unused string resources |
The changes are clean and well-executed. The functionality of tracking and setting SDK environment variables remains intact—only the logging has been removed. All string resources have been properly cleaned up from the main resource file and all 13 localization files consistently. No issues were found during the review.
rainersigwald
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I might favor keeping these messages only if the values differ, instead of dropping them entirely.
Context
Structured log viewer was cluttered with repeated non-actionable messages about SDK environment variables (e.g.,
DOTNET_HOST_PATH). These appeared for every project evaluation, reporting normal SDK behavior without providing value to users.Changes Made
Removed three
LogCommentcalls fromProjectInstance.AddSdkResolvedEnvironmentVariable():Removed unused string resources that were referenced by the deleted log messages:
SdkEnvironmentVariableAlreadySetSdkEnvironmentVariableAlreadySetBySdkSdkEnvironmentVariableSetThese resources were removed from
Strings.resxand all 13 localized.xlffiles (cs, de, es, fr, it, ja, ko, pl, pt-BR, ru, tr, zh-Hans, zh-Hant).The underlying functionality is unchanged—environment variables are still tracked and set correctly, just without the logging noise.
Testing
Notes
The removed messages logged at
MessageImportance.Lowbut still appeared prominently in structured log viewer output. Since they report expected behavior rather than issues requiring user action, logging adds no value. The cleanup of unused string resources reduces maintenance burden and keeps the codebase clean.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.