Delete dead code#7734
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Removes the unused/never-fully-implemented “obsolete command line option” surface area from Microsoft.Testing.Platform, including its IPC serialization and help/warning output paths.
Changes:
- Removes
CommandLineOption.ObsolescenceMessageand the related public constructor overload. - Deletes the obsolete-options warning path (
CheckForObsoleteOptionsAsync) and strips “[obsolete]”/obsolete text from help output. - Updates DotnetTest IPC models/serialization to stop emitting/reading the obsolete-message field.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Platform/Microsoft.Testing.Platform/ServerMode/DotnetTest/IPC/Serializers/CommandLineOptionMessagesSerializer.cs | Stops serializing/deserializing the obsolete-message field in IPC payloads. |
| src/Platform/Microsoft.Testing.Platform/ServerMode/DotnetTest/IPC/ObjectFieldIds.cs | Removes the obsolete-message field id from the IPC field-id list (currently left as commented-out code). |
| src/Platform/Microsoft.Testing.Platform/ServerMode/DotnetTest/IPC/Models/CommandLineOptionMessages.cs | Updates IPC record shape to drop the obsolete-message value. |
| src/Platform/Microsoft.Testing.Platform/ServerMode/DotnetTest/DotnetTestConnection.cs | Stops sending obsolete-message over IPC when constructing option messages. |
| src/Platform/Microsoft.Testing.Platform/PublicAPI/PublicAPI.Shipped.txt | Updates shipped API declarations for the removed API surface (partial update). |
| src/Platform/Microsoft.Testing.Platform/Hosts/TestHostBuilder.cs | Removes invocation of obsolete-options warning check during host build. |
| src/Platform/Microsoft.Testing.Platform/CommandLine/CommandLineOptionsValidator.cs | Removes the obsolete-options warning implementation. |
| src/Platform/Microsoft.Testing.Platform/CommandLine/CommandLineOption.cs | Removes ObsolescenceMessage and the public ctor overload that accepted it; adjusts equality/hash. |
| src/Platform/Microsoft.Testing.Platform/CommandLine/CommandLineHandler.cs | Removes “[obsolete]” label and obsolete-message printing from help output. |
03690cf to
d8582ab
Compare
d8582ab to
1588e27
Compare
Evangelink
approved these changes
Apr 16, 2026
Evangelink
left a comment
Member
There was a problem hiding this comment.
Clean removal of unused API surface. The deletion is thorough across all layers (public API, help display, validator, IPC serialization) and IPC backward compat is safe thanks to the field-skip default branch in the deserializer.
Two minor nits left as inline comments:
- Orphaned
CommandLineOptionObsoleteWarningresource string + 13 xlf files should be cleaned up. - Commented-out field ID constant — prefer either deleting or a proper reservation comment.
Neither is blocking. LGTM.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We should have never introduced this as a public non-experimental API. It was introduced in 2.1.0 and wasn't used and also was never implemented fully with dotnet test. While it's binary breaking change, our users of such API will be test framework authors which is a very limited audience and no one is using it today. So it's a safe breaking change.