Skip to content

Add github issue suggestion in user visible error - #41432

Merged
Feng Wang (chemwolf6922) merged 2 commits into
masterfrom
user/chemwolf6922/add-github-issues-suggestion-in-user-visible-error
Aug 26, 2026
Merged

Add github issue suggestion in user visible error#41432
Feng Wang (chemwolf6922) merged 2 commits into
masterfrom
user/chemwolf6922/add-github-issues-suggestion-in-user-visible-error

Conversation

@chemwolf6922

Copy link
Copy Markdown
Contributor

Summary of the Pull Request

This PR adds a "search or file issue on github" suggestion in all user visible errors to:

  1. Help users find solutions faster.
  2. Collect more user reported issues to help reliability improvements.

This PR also updates all tests checking the error message to use a unified function for creating the expected error message.

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

Run the updated tests locally. No error message related failures.

@chemwolf6922
Feng Wang (chemwolf6922) requested a review from a team as a code owner August 25, 2026 02:30
Copilot AI lite review requested due to automatic review settings August 25, 2026 02:30
@chemwolf6922
Feng Wang (chemwolf6922) requested a review from a team as a code owner August 25, 2026 02:30
Comment thread localization/strings/en-US/Resources.resw

Copilot AI 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.

Pull request overview

Adds GitHub issue-reporting guidance to localized WSL errors and standardizes affected test expectations.

Changes:

  • Extends localized MessageErrorCode messages.
  • Adds shared FormatErrorMessage test helper.
  • Updates WSL and WSLC error-output tests.

The guidance does not cover all user-visible failures because several paths bypass MessageErrorCode, including direct OutputHelp/Terminal.Error output, InspectTasks not-found errors, and some WslClient errors.

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 1 comment.

Show a summary per file
File Summary
test/windows/wslc/e2e/WSLCE2EVolumeRemoveTests.cpp Updates volume-removal error expectations.
test/windows/wslc/e2e/WSLCE2ESessionEnterTests.cpp Updates session error expectations.
test/windows/wslc/e2e/WSLCE2EPushPullTests.cpp Updates image push/pull expectations.
test/windows/wslc/e2e/WSLCE2ENetworkTests.cpp Updates network error expectations.
test/windows/wslc/e2e/WSLCE2ENetworkCreateTests.cpp Updates network-creation expectations.
test/windows/wslc/e2e/WSLCE2EImageTagTests.cpp Updates image-tag expectations.
test/windows/wslc/e2e/WSLCE2EImageSaveTests.cpp Updates image-save expectations.
test/windows/wslc/e2e/WSLCE2EImageDeleteTests.cpp Updates image-delete expectations.
test/windows/wslc/e2e/WSLCE2EImageBuildTests.cpp Updates image-build expectations.
test/windows/wslc/e2e/WSLCE2EHelpers.h Removes the old error formatter.
test/windows/wslc/e2e/WSLCE2EGlobalTests.cpp Updates global error expectations.
test/windows/wslc/e2e/WSLCE2EContainerStopTests.cpp Updates container-stop expectations.
test/windows/wslc/e2e/WSLCE2EContainerRunTests.cpp Updates container-run expectations.
test/windows/wslc/e2e/WSLCE2EContainerRemoveTests.cpp Updates container-removal expectations.
test/windows/wslc/e2e/WSLCE2EContainerKillTests.cpp Updates container-kill expectations.
test/windows/wslc/e2e/WSLCE2EContainerExecTests.cpp Updates container-exec expectations.
test/windows/wslc/e2e/WSLCE2EContainerCreateTests.cpp Updates container-creation expectations.
test/windows/wslc/e2e/WSLCE2EContainerAttachTests.cpp Updates container-attach expectations.
test/windows/UnitTests.cpp Updates WSL error expectations.
test/windows/SimpleTests.cpp Updates sparse-VHD error expectations.
test/windows/PolicyTests.cpp Updates policy error expectations.
test/windows/PluginTests.cpp Updates plugin error expectations.
test/windows/MountTests.cpp Updates mount error expectations.
test/windows/InstallerTests.cpp Updates installer error expectations.
test/windows/Common.h Declares the shared formatter.
test/windows/Common.cpp Implements the shared formatter.
localization/strings/en-US/Resources.resw Adds GitHub issue guidance to localized error messages.
Suppressed comments (2)

localization/strings/en-US/Resources.resw:1173

  • This updates only the en-US template. Localization::LookupString prefers an exact user-language entry before falling back, and localization/strings/en-GB/Resources.resw:1170-1174 still contains the old two-line MessageErrorCode value. As a result, en-GB and other locales with an existing translation will not show the GitHub suggestion. Please route this changed key through the localization regeneration process, or otherwise ensure the new suffix is available for existing locale entries.
If this error was unexpected, please consider searching for existing issues or filing a new issue at https://github.com/microsoft/WSL/issues.</value>

test/windows/Common.cpp:3153

  • The migration leaves existing error assertions with raw Error code: literals (for example, WSLCE2EVolumePruneTests.cpp:228, WSLCE2ENetworkCreateTests.cpp:91, and WSLCE2EVolumeCreateTests.cpp:87). Because these use StderrContainsSubstring, they still pass even if the new GitHub suffix is omitted and therefore do not cover the behavior introduced by this helper. Update those assertions to use FormatErrorMessage or add an exact assertion for the complete output.
std::wstring FormatErrorMessage(std::wstring_view message, std::wstring_view errorCode)

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread localization/strings/en-US/Resources.resw
Copilot AI review requested due to automatic review settings August 25, 2026 02:37

Copilot AI 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.

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated no new comments.

Suppressed comments (3)

localization/strings/en-US/Resources.resw:1173

  • This updates only the MessageErrorCode path. WslClient.cpp still prints strings.Message directly for WSL_E_DEFAULT_DISTRO_NOT_FOUND/WSL_E_INVALID_USAGE, and uses GetErrorString(result) whenever no ReportedError exists, so those user-visible failures will not include this GitHub guidance. If the stated goal is all user-visible errors, route these fallback/special-case paths through the same localized suffix or a shared formatter.
If this error was unexpected, please consider searching for existing issues or filing a new issue at https://github.com/microsoft/WSL/issues.</value>

localization/strings/en-US/Resources.resw:1173

  • This updates only the en-US value, but MessageErrorCode is present in every localized Resources.resw; LookupString selects an exact locale before falling back. For example, the checked-in en-GB value still contains only {}\nError code: {}, so en-GB and other localized installs will not show this new issue link. Please route the corresponding resource update through the localization pipeline (or otherwise preserve the link for localized values) before relying on this for all users.
If this error was unexpected, please consider searching for existing issues or filing a new issue at https://github.com/microsoft/WSL/issues.</value>

test/windows/wslc/e2e/WSLCE2ESessionEnterTests.cpp:119

  • This update only affects failures that flow through MessageErrorCode. The same CLI still has user-visible failures that bypass it—for example, SessionEnterCommand throws ExecutionException and CoreMain prints ee.Message() directly, so WSLCE2E_Help_ExecutionErrorDoesNotShowHelp still has no GitHub suggestion. Please apply the common suffix to this path (and the parser/help error paths if “all user visible errors” is the intended scope), then update those assertions.
            .Stderr = FormatErrorMessage(
                wsl::shared::Localization::MessageWslcSessionStorageNotFound(storagePath), L"ERROR_PATH_NOT_FOUND"),

@OneBlue

Copy link
Copy Markdown
Collaborator

Deferring to Craig Loewen (@craigloewen-msft) to review this. The test changes look good

Comment thread localization/strings/en-US/Resources.resw
@chemwolf6922
Feng Wang (chemwolf6922) merged commit 00df65a into master Aug 26, 2026
12 checks passed
@chemwolf6922
Feng Wang (chemwolf6922) deleted the user/chemwolf6922/add-github-issues-suggestion-in-user-visible-error branch August 26, 2026 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants