Skip to content

Align hangdump type help with validator#8524

Merged
Evangelink merged 9 commits into
mainfrom
copilot/fix-help-advertise-hangdump-types
May 25, 2026
Merged

Align hangdump type help with validator#8524
Evangelink merged 9 commits into
mainfrom
copilot/fix-help-advertise-hangdump-types

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 23, 2026

--hangdump-type help and validation advertised values that did not match the target-specific validator. Non-NETCOREAPP targets were told Triage was valid, while None was described as .NET 6+-only despite being accepted.

  • Shared option formatting
    • Formats help and invalid-argument text from HangDumpTypeOptions, the same target-specific list used by validation.
    • Keeps Triage limited to NETCOREAPP.
    • Keeps None advertised wherever it is accepted.
#if NETCOREAPP
private static readonly string[] HangDumpTypeOptions = ["Mini", "Heap", "Full", "Triage", "None"];
#else
private static readonly string[] HangDumpTypeOptions = ["Mini", "Heap", "Full", "None"];
#endif
  • Resources and localization

    • Changed HangDump resource strings to accept formatted valid-value lists.
    • Updated localized XLF sources.
  • Tests

    • Added focused unit coverage for valid None, target-specific help text, and invalid-value messages.
    • Updated acceptance expectations for --help and invalid --hangdump-type output.

Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 23, 2026 16:00
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 23, 2026 16:02
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 23, 2026 16:03
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 23, 2026 16:05
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 23, 2026 16:07
Copilot AI changed the title [WIP] Fix help message for hangdump type options Align hangdump type help with validator May 23, 2026
Copilot AI requested a review from Evangelink May 23, 2026 16:07
@Evangelink Evangelink marked this pull request as ready for review May 25, 2026 11:23
Copilot AI review requested due to automatic review settings May 25, 2026 11:23
@Evangelink
Copy link
Copy Markdown
Member

@copilot resolve the merge conflicts in this pull request

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Aligns --hangdump-type help text and invalid-argument messaging with the target-specific validator in the HangDump extension, so the advertised valid values match what is actually accepted per TFM.

Changes:

  • Centralized formatting of the valid-value list for --hangdump-type in HangDumpCommandLineProvider and wired it into help + validation error messages.
  • Updated HangDump resource strings to accept formatted option lists and refreshed localized XLF files accordingly.
  • Added/updated unit + acceptance tests to cover None validity, TFM-specific help output, and invalid-value messaging.
Show a summary per file
File Description
test/UnitTests/Microsoft.Testing.Extensions.UnitTests/HangDumpTests.cs Adds unit coverage for None, option description valid-value list, and updated invalid-type message formatting.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoAllExtensionsTests.cs Updates --help/--info expectations to use TFM-specific hangdump valid-value list.
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HangDumpTests.cs Updates invalid --hangdump-type output expectation to match new formatting/order.
src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.zh-Hant.xlf Updates localized resource entries for the new formatted placeholders.
src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.zh-Hans.xlf Updates localized resource entries for the new formatted placeholders.
src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.tr.xlf Updates localized resource entries for the new formatted placeholders.
src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.ru.xlf Updates localized resource entries for the new formatted placeholders.
src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.pt-BR.xlf Updates localized resource entries for the new formatted placeholders.
src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.pl.xlf Updates localized resource entries for the new formatted placeholders.
src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.ko.xlf Updates localized resource entries for the new formatted placeholders.
src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.ja.xlf Updates localized resource entries for the new formatted placeholders.
src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.it.xlf Updates localized resource entries for the new formatted placeholders.
src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.fr.xlf Updates localized resource entries for the new formatted placeholders.
src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.es.xlf Updates localized resource entries for the new formatted placeholders.
src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.de.xlf Updates localized resource entries for the new formatted placeholders.
src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/xlf/ExtensionResources.cs.xlf Updates localized resource entries for the new formatted placeholders.
src/Platform/Microsoft.Testing.Extensions.HangDump/Resources/ExtensionResources.resx Changes strings to accept formatted valid-value lists ({0} / {1}).
src/Platform/Microsoft.Testing.Extensions.HangDump/HangDumpCommandLineProvider.cs Implements shared formatting for valid dump types and uses it in option description + validation errors.

Copilot's findings

  • Files reviewed: 18/18 changed files
  • Comments generated: 1

Comment thread src/Platform/Microsoft.Testing.Extensions.HangDump/HangDumpCommandLineProvider.cs Outdated
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 25, 2026

@copilot resolve the merge conflicts in this pull request

Resolved by merging origin/main into this branch and fixing the conflict in HangDumpTests.cs while preserving both changes. Addressed in commit 060c6dd.

Copilot AI review requested due to automatic review settings May 25, 2026 13:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot's findings

  • Files reviewed: 18/18 changed files
  • Comments generated: 1

Comment thread src/Platform/Microsoft.Testing.Extensions.HangDump/HangDumpCommandLineProvider.cs Outdated
Address Copilot review feedback: the previous formatter interpolated
hard-coded English 'or'/'and' conjunctions into localized resource
strings, leaking English into non-English help and validation output.

Switch to a single comma-separated list (e.g., ''Mini', 'Heap', 'Full',
'None''), which is locale-neutral and lets us collapse the two former
constants/helpers into one.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Evangelink Evangelink merged commit 24c46f9 into main May 25, 2026
25 checks passed
@Evangelink Evangelink deleted the copilot/fix-help-advertise-hangdump-types branch May 25, 2026 15:12
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.

[MTP CLI Analysis] --hangdump-type help advertises target-dependent values incorrectly

3 participants