Skip to content

Delete dead code#7734

Merged
Youssef1313 merged 2 commits into
mainfrom
dev/ygerges/deadcode
Apr 16, 2026
Merged

Delete dead code#7734
Youssef1313 merged 2 commits into
mainfrom
dev/ygerges/deadcode

Conversation

@Youssef1313

Copy link
Copy Markdown
Member

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.

Copilot AI review requested due to automatic review settings April 16, 2026 08:31

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

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.ObsolescenceMessage and 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.

@Youssef1313 Youssef1313 force-pushed the dev/ygerges/deadcode branch from 03690cf to d8582ab Compare April 16, 2026 08:37
Copilot AI review requested due to automatic review settings April 16, 2026 08:46
@Youssef1313 Youssef1313 force-pushed the dev/ygerges/deadcode branch from d8582ab to 1588e27 Compare April 16, 2026 08:46

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 9 out of 9 changed files in this pull request and generated no new comments.

@Evangelink Evangelink left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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:

  1. Orphaned CommandLineOptionObsoleteWarning resource string + 13 xlf files should be cleaned up.
  2. Commented-out field ID constant — prefer either deleting or a proper reservation comment.

Neither is blocking. LGTM.

@Youssef1313 Youssef1313 enabled auto-merge (squash) April 16, 2026 12:13
@Youssef1313 Youssef1313 merged commit 335520b into main Apr 16, 2026
10 checks passed
@Youssef1313 Youssef1313 deleted the dev/ygerges/deadcode branch April 16, 2026 13:39
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.

3 participants