Skip to content

Comments

Reduce IVT by using Embedded attribute and source link#7443

Draft
Evangelink wants to merge 3 commits intomainfrom
dev/amauryleve/ivt
Draft

Reduce IVT by using Embedded attribute and source link#7443
Evangelink wants to merge 3 commits intomainfrom
dev/amauryleve/ivt

Conversation

@Evangelink
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings February 20, 2026 20:19
Copy link
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

This pull request reduces the InternalsVisibleTo (IVT) surface area by marking internal helper classes with the [Embedded] attribute and source-linking them into consuming projects. This approach allows types to be embedded at compile time rather than accessing them via InternalsVisibleTo, reducing binary coupling and avoiding breaking changes when modifying these types.

Changes:

  • Added [Embedded] attribute to internal helper classes (ApplicationStateGuard, ExitCodes, EnvironmentVariableConstants, RoslynString, TimeoutHelper, TimeSpanParser, TargetFrameworkParser)
  • Removed 4 InternalsVisibleTo entries that are no longer needed
  • Added TESTING_PLATFORM_SOURCE_EMBEDDED conditional compilation symbol to projects that embed sources
  • Added conditional compilation to use hardcoded error messages in embedded contexts instead of resource files
  • Replaced hardcoded string with constant reference in MSBuild task

Reviewed changes

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

Show a summary per file
File Description
src/Platform/Microsoft.Testing.Platform/Microsoft.Testing.Platform.csproj Removed 4 IVT entries that are no longer needed (TrxReport.Abstractions, VSTestBridge.TestAdapter, MSTest.Acceptance.IntegrationTests, MSTest.IntegrationTests)
src/Platform/Microsoft.Testing.Platform/Helpers/*.cs Added [Embedded] attribute to helper classes (ApplicationStateGuard, ExitCodes, EnvironmentVariableConstants, RoslynString, TimeoutHelper, TimeSpanParser)
src/Platform/Microsoft.Testing.Platform/OutputDevice/TargetFrameworkParser.cs Added [Embedded] attribute
src/Platform/Microsoft.Testing.Platform/IPC/NamedPipeServer.cs Added conditional compilation to use hardcoded error messages when TESTING_PLATFORM_SOURCE_EMBEDDED is defined
src/Platform/Microsoft.Testing.Platform/IPC/NamedPipeBase.cs Added conditional compilation to use hardcoded error messages when TESTING_PLATFORM_SOURCE_EMBEDDED is defined
src/Platform/Microsoft.Testing.Platform.MSBuild/Microsoft.Testing.Platform.MSBuild.csproj Added TESTING_PLATFORM_SOURCE_EMBEDDED constant, embedded helper files, added CS0436 to NoWarn
src/Platform/Microsoft.Testing.Platform.MSBuild/Tasks/InvokeTestingPlatformTask.cs Replaced hardcoded "TestResults" reference with proper string literal (removing dependency on AggregatedConfiguration)
src/Platform/Microsoft.Testing.Extensions.*/**.csproj Added TESTING_PLATFORM_SOURCE_EMBEDDED constant and embedded necessary helper files from Microsoft.Testing.Platform
test//.csproj Added TESTING_PLATFORM_SOURCE_EMBEDDED constant, embedded helper files, and added Polyfill package where needed

Copilot AI review requested due to automatic review settings February 22, 2026 09:51
Copy link
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

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

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.

1 participant