Skip to content

Validate crash dump sub-options require a main option - #8452

Merged
Amaury Levé (Evangelink) merged 5 commits into
mainfrom
copilot/fix-crashdump-options-ignored
May 22, 2026
Merged

Amaury Levé (Evangelink) merged 5 commits into
mainfrom
copilot/fix-crashdump-options-ignored

Conversation

Copilot AI commented May 21, 2026 •

Copy link
Copy Markdown
Contributor

--crashdump-filename and --crashdump-type were accepted without --crashdump or --crash-report, then silently ignored because crash dump environment setup never activates without a main option.

  • Command-line validation
    • Rejects crash dump sub-options unless --crashdump or --crash-report is also present.
    • Preserves the existing Windows-specific --crash-report rejection.
dotnet test -- --crashdump-type Full
// invalid: add --crashdump or --crash-report
  • Resources

    • Adds a localized validation message for the missing crash dump main option.
  • Tests

    • Covers invalid standalone --crashdump-filename / --crashdump-type.
    • Covers valid combinations with --crashdump and --crash-report.

Copilot AI self-assigned this May 21, 2026
Copilot AI review requested due to automatic review settings May 21, 2026 08:07
Copilot AI removed the request for review from Copilot May 21, 2026 08:07
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 21, 2026 08:24
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 21, 2026 08:25
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 21, 2026 08:28
Copilot AI changed the title [WIP] Fix CrashDump sub-options being ignored without required flags Validate crash dump sub-options require a main option May 21, 2026
@Evangelink
Amaury Levé (Evangelink) marked this pull request as ready for review May 21, 2026 09:24
Copilot AI review requested due to automatic review settings May 21, 2026 09:24

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

This pull request tightens command-line validation for the CrashDump extension so that crash dump sub-options aren’t silently ignored when the crash dump feature itself isn’t enabled, improving UX and preventing confusing no-op configurations.

Changes:

  • Add command-line validation to reject --crashdump-filename / --crashdump-type unless --crashdump or --crash-report is also specified.
  • Introduce a new localized resource string for the validation error.
  • Add unit tests covering both invalid standalone sub-options and valid combinations with main options.
Show a summary per file
File Description
test/UnitTests/Microsoft.Testing.Extensions.UnitTests/CrashDumpTests.cs Adds unit tests for missing main crash dump option validation and valid main+sub-option combinations.
src/Platform/Microsoft.Testing.Extensions.CrashDump/CrashDumpCommandLineProvider.cs Implements validation to require a main crash dump option when sub-options are present and preserves Windows crash-report rejection.
src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/CrashDumpResources.resx Adds a new user-facing validation message resource.
src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.cs.xlf Updates localization file with the new resource entry.
src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.de.xlf Updates localization file with the new resource entry.
src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.es.xlf Updates localization file with the new resource entry.
src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.fr.xlf Updates localization file with the new resource entry.
src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.it.xlf Updates localization file with the new resource entry.
src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.ja.xlf Updates localization file with the new resource entry.
src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.ko.xlf Updates localization file with the new resource entry.
src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.pl.xlf Updates localization file with the new resource entry.
src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.pt-BR.xlf Updates localization file with the new resource entry.
src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.ru.xlf Updates localization file with the new resource entry.
src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.tr.xlf Updates localization file with the new resource entry.
src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.zh-Hans.xlf Updates localization file with the new resource entry.
src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.zh-Hant.xlf Updates localization file with the new resource entry.

Copilot's findings

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

@Evangelink

Copy link
Copy Markdown
Member

Copilot address review comment

Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>

Copilot AI commented May 21, 2026

Copy link
Copy Markdown
Contributor Author

Copilot address review comment

Addressed in a5b08b2. I rephrased MissingCrashDumpMainOption to remove the comma splice and ambiguity, and synced the CrashDump XLF resource files.

@Evangelink
Amaury Levé (Evangelink) merged commit 30b97e2 into main May 22, 2026
23 of 25 checks passed
@Evangelink
Amaury Levé (Evangelink) deleted the copilot/fix-crashdump-options-ignored branch May 22, 2026 09:03
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 Diagnostic Analysis] CrashDump sub-options are silently ignored without --crashdump/--crash-report

3 participants