Skip to content

Remove dead coverlet.collector dependency and the no-longer-needed System.Formats.Asn1 pin - #1281

Merged
Alexandre Zollinger Chohfi (azchohfi) merged 2 commits into
mainfrom
azchohfi-coverlet-cleanup-followup
Sep 24, 2026
Merged

Alexandre Zollinger Chohfi (azchohfi) merged 2 commits into
mainfrom
azchohfi-coverlet-cleanup-followup

Conversation

@azchohfi

@azchohfi Alexandre Zollinger Chohfi (azchohfi) commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up cleanup to #1279 ("Remove unnecessary Microsoft.NET.Test.Sdk dependencies"), which removed Microsoft.NET.Test.Sdk from Directory.Packages.props and all 13 test projects. A review on that PR flagged two leftovers it did not address. This PR removes both — net 20 deletions, 0 insertions across 5 files.

1. Removed the dead coverlet.collector dependency

coverlet.collector is a VSTest data collector and is dead in this repo for two independently verified reasons:

  1. Its only wiring hook now targets a non-existent target. coverlet.collector.targets hangs everything off <Target Name="SetXPlatDataCollectorPath" BeforeTargets="VSTest">. The VSTest MSBuild target was supplied by Microsoft.NET.Test.Sdk, which Remove unnecessary Microsoft.NET.Test.Sdk dependencies #1279 removed. (This is inert rather than an error — MSBuild tolerates BeforeTargets on a missing target — which is exactly why it went unnoticed.)
  2. Nothing ever drove it anyway. Coverage in this repo runs on the dotnet-coverage global tool: tools/coverage/run-coverage.ps1 (dotnet-coverage collect / instrument / merge), .github/workflows/coverage.yml, TESTING.md, and .github/skills/coverage-uplift/SKILL.md. A repo-wide sweep for coverlet, --collect and XPlat Code Coverage found zero active consumers, with dotnet-coverage matching in 12 files as the positive control. src/vs-reactor/TESTING.md even records that --collect:"XPlat Code Coverage" fails with "Unable to find a datacollector with friendly name 'XPlat Code Coverage'".

Removed the PackageVersion plus the PackageReference blocks from tests/Reactor.Tests, tests/Reactor.IntegrationTests and tests/Reactor.DocPipeline.Tests. The only surviving mention is tools/reviewer/reports/fix-list.md, a frozen 2026-04-11 review artifact describing a project shape that no longer exists — left untouched.

Under central package management a surviving PackageReference with no PackageVersion fails restore with NU1010, so the sweep mattered; the clean solution restore below is the proof it was complete.

2. Removed the System.Formats.Asn1 pin

tests/Reactor.Compile.Analyzer.Tests pinned System.Formats.Asn1, with a comment attributing the vulnerable transitive 5.0.0 (GHSA-447r-wph3-92pm, High) to "the Microsoft.CodeAnalysis.* / Test.Sdk graph" — the Test.Sdk half is wrong after #1279. Rather than just re-word it, the pin is removed, because the condition it guarded no longer holds.

Advisory range. GHSA-447r-wph3-92pm (CVE-2024-38095, High), read from the GitHub advisories API, lists two affected ranges for System.Formats.Asn1:

Affected range First patched
>= 5.0.0-preview.7.20364.11, < 6.0.1 6.0.1
>= 7.0.0-preview.1.22076.8, < 8.0.1 8.0.1

Resolved version without the pin: 9.0.6 (project.assets.json, net8.0 target) — outside both ranges. It is now purely transitive: System.Formats.Asn1 no longer appears in projectFileDependencyGroups, and dotnet nuget why shows the only path is Microsoft.CodeAnalysis.CSharp.Analyzer.Testing → Microsoft.CodeAnalysis.Analyzer.Testing (directly, and via NuGet.Packaging → System.Security.Cryptography.Pkcs → Microsoft.Bcl.Cryptography). Microsoft.CodeAnalysis.CSharp and .Workspaces contribute no path at all.

The audit oracle was validated, not assumed. This matters: the repo nuget.config <clear />s sources down to nuget.org, which is TLS-blocked on the machine this was verified on, so NuGet emits NU1900 ("unable to get package vulnerability data") and NU1901–NU1904 can never fire — a zero result would have been vacuous. Restoring instead against a feed advertising VulnerabilityInfo/6.7.0 makes audit live. Injecting System.Formats.Asn1 6.0.0 (inside the first affected range) produced:

warning NU1903: Package 'System.Formats.Asn1' 6.0.0 has a known high severity
vulnerability, https://github.com/advisories/GHSA-447r-wph3-92pm

…confirming the oracle fires for exactly this advisory. With the pin removed and the same live audit, dotnet restore Reactor.slnx exits 0 with zero NU1901/1902/1903/1904.

The PackageVersion was decided separately. A repo-wide sweep (case-insensitive Asn1) found this project was its sole consumer, and CentralPackageTransitivePinningEnabled is not set anywhere in the repo (defaults false), so a PackageVersion alone pins no transitive resolution — removing it changes nothing. Dropped as orphaned.

Deliberately NOT done

  • xunit.runner.visualstudio is retained on purpose — please don't re-litigate it. It looks like a VSTest leftover but is load-bearing: its nuspec (v4.0.0) states it runs "xUnit.net v1, v2, and v3 tests"; its build/net8.0/xunit.runner.visualstudio.props emits <ProjectCapability Include="TestContainer" /> and copies the adapter DLL, which is what gives Visual Studio Test Explorer discovery; and its net8.0 dependency group is empty (only net472 depends on Microsoft.TestPlatform.ObjectModel), so it never needed Test.Sdk on modern TFMs. Removing it would degrade the IDE experience for contributors.
  • Known follow-up (deferred): tests/Reactor.Compile.Analyzer.Tests and tests/external_proof/Reactor.External.TestControl.Tests have no CI test gate. That gap is real but pre-existing and intentionally left for a separate PR.
  • No product code, OutputType, or anything else Remove unnecessary Microsoft.NET.Test.Sdk dependencies #1279 changed was touched.

CHANGELOG: skipped per CHANGELOG.md's own contributor-convention block and recent precedent — build-infrastructure-only change with no runtime effect.

Verification

Check Result
dotnet restore Reactor.slnx exit 0 — no NU1010, and zero NU1901–NU1904 under a validated-live audit feed
dotnet build Reactor.slnx --no-restore -c Release 0 errors
Resolved System.Formats.Asn1 after pin removal 9.0.6 — outside both advisory ranges
NU1903 positive control (Asn1 6.0.0 injected) fires, citing GHSA-447r-wph3-92pm — oracle proven non-vacuous
dotnet test tests/Reactor.Compile.Analyzer.Tests 11 / 0 failed
dotnet test tests/Reactor.Tests 14144 / 0 failed (14080 passed, 64 skipped)
dotnet test tests/Reactor.DocPipeline.Tests 472 / 0 failed
dotnet test tests/Reactor.IntegrationTests 6 pre-existing network failures — see below

CI Vulnerable packages gate, replicated end to end (restore + dotnet list Reactor.slnx package --vulnerable --include-transitive + the job's own Reactor.slnx-derived exclusion parse): listExit=0, 0 High/Critical findings in shipped projects, no Asn1 rows at all → the job would pass. Worth flagging honestly: that gate excludes the 104 projects under samples/ and tests/ from failing the build (issue #607), and Reactor.Compile.Analyzer.Tests is in that excluded set — so the gate would not have caught a regression here on its own. The NU1903 control and the resolved 9.0.6 are the load-bearing evidence, not the gate.

The 6 Reactor.IntegrationTests failures are all in Packaging.SourceMapPackageConsumerTests / Packaging.CreateTemplateTests and are the documented network gate, not a regression. SourceMapPackageConsumerTests.cs says so in its own doc comment: "this needs network access to restore the Windows App SDK, so it only runs where NuGet.org is reachable (CI's 'Integration Tests' job). On a network-restricted machine both fail identically with NU1301 during restore." Every failure is verbatim NU1301 against api.nuget.org, in temp consumer projects that never referenced coverlet. CI's Integration Tests job has the network access to run them for real.

Test counts were checked to be non-zero: MTP prints "Zero tests ran" with exit 5 when it rejects a forwarded argument, and the module labels read net10.0|x64 / net8.0|x64 (handshake-derived), confirming the hosts actually started.

Follow-up cleanup to #1279, which removed Microsoft.NET.Test.Sdk from
Directory.Packages.props and all 13 test projects. A PR review on that
change flagged two leftovers it did not address.

coverlet.collector is a VSTest data collector and is dead in this repo
for two independent reasons:

1. Its only wiring hook is
   `<Target Name="SetXPlatDataCollectorPath" BeforeTargets="VSTest">` in
   coverlet.collector.targets. The `VSTest` MSBuild target was supplied
   by Microsoft.NET.Test.Sdk, which #1279 removed, so that hook now
   points at a target that no longer exists. (Inert, not an error -
   MSBuild tolerates BeforeTargets on a missing target.)
2. Nothing ever drove it. Coverage in this repo runs on the
   dotnet-coverage global tool: tools/coverage/run-coverage.ps1,
   .github/workflows/coverage.yml, TESTING.md and the coverage-uplift
   skill all invoke `dotnet-coverage collect|instrument|merge`. A
   repo-wide sweep for `coverlet` / `--collect` / `XPlat Code Coverage`
   found zero active consumers, with `dotnet-coverage` matching in 12
   files as the positive control. src/vs-reactor/TESTING.md even records
   that `--collect:"XPlat Code Coverage"` fails with "Unable to find a
   datacollector with friendly name 'XPlat Code Coverage'".

Removed the PackageVersion and the three PackageReference blocks
(Reactor.Tests, Reactor.IntegrationTests, Reactor.DocPipeline.Tests).
Under central package management a surviving PackageReference without a
PackageVersion fails restore with NU1010, so the sweep mattered.

Also corrected the now-stale comment on the System.Formats.Asn1 pin in
Reactor.Compile.Analyzer.Tests, which attributed the vulnerable
transitive 5.0.0 to "the Microsoft.CodeAnalysis.* / Test.Sdk graph".
`dotnet nuget why` shows the only path today is
Microsoft.CodeAnalysis.CSharp.Analyzer.Testing, and removing the pin
resolves 9.0.6 - not 5.0.0 - with no NuGet audit warning. The pin is
kept as defence in depth against a future transitive regression; only
the comment changed, so it now describes verifiable reality.

xunit.runner.visualstudio is deliberately retained: it runs xUnit v1/v2/v3,
its build props emit `<ProjectCapability Include="TestContainer" />` for
Visual Studio Test Explorer discovery, and its net8.0 dependency group is
empty, so it never depended on Test.Sdk on modern TFMs.

Verified: `dotnet restore Reactor.slnx` exit 0 (no NU1010);
`dotnet build Reactor.slnx --no-restore -c Release` 0 errors;
Reactor.Tests 14144/0 failed, Reactor.DocPipeline.Tests 472/0,
Reactor.Compile.Analyzer.Tests 11/0. Reactor.IntegrationTests' 6
packaging failures are the pre-existing NU1301 network gate its own
source documents ("On a network-restricted machine both fail
identically with NU1301 during restore").

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

📦 Build metrics

Artifact sizes for 3486c08 vs the base branch (cd6cc90).

Packages (compressed .nupkg)

Artifact base PR Δ
Microsoft.UI.Reactor.nupkg 1.71 MB 1.71 MB +62 B (0.00%) ≈
Microsoft.UI.Reactor.Advanced.nupkg 487.6 KB 487.6 KB +8 B (0.00%) ≈
Microsoft.UI.Reactor.Devtools.nupkg 284.1 KB 284.1 KB +8 B (0.00%) ≈

Assemblies in Microsoft.UI.Reactor

Artifact base PR Δ
Reactor.Analyzers.dll 373.0 KB 373.0 KB +0 B (0.00%) ≈
Reactor.dll 2.44 MB 2.44 MB +0 B (0.00%) ≈
Reactor.Localization.Generator.dll 16.0 KB 16.0 KB +0 B (0.00%) ≈
Reactor.Wrappers.Abstractions.dll 10.5 KB 10.5 KB +0 B (0.00%) ≈
Reactor.Wrappers.Generator.dll 99.5 KB 99.5 KB +0 B (0.00%) ≈

Assemblies in Microsoft.UI.Reactor.Advanced

Artifact base PR Δ
Reactor.Advanced.dll 1021.5 KB 1021.5 KB +0 B (0.00%) ≈

Assemblies in Microsoft.UI.Reactor.Devtools

Artifact base PR Δ
Microsoft.UI.Reactor.Devtools.dll 784.5 KB 784.5 KB +0 B (0.00%) ≈

No size change beyond the noise floor. ✅

✅ smaller / ⚠️ larger / ≈ within noise. Sizes come from a Release dotnet pack on the CI runner: packages are the compressed .nupkg download size, assemblies the uncompressed DLL inside it.
workflow run.

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🧪 Merged coverage

Coverage for 3486c08 vs the base branch (cd6cc90) — unit + selftest merged.

Metric base PR Δ
Line 85.79% 85.79% 0.00 pp ≈
Branch 77.58% (962/1240) 77.58% (962/1240) 0.00 pp ≈

No coverage change beyond the noise floor. ✅

✅ higher / ⚠️ lower / ≈ within noise. Δ is in percentage points; coverage is unit + selftest merged (Debug x64) on the CI runner. Cobertura reports attached to the workflow run as artifacts.

…earing

Follow-up within this PR. The previous commit kept the pin and only
corrected its comment; this removes it outright, because the condition
it guarded no longer holds.

GHSA-447r-wph3-92pm (CVE-2024-38095, High) lists two affected ranges for
System.Formats.Asn1, read from the GitHub advisories API:

  >= 5.0.0-preview.7.20364.11, < 6.0.1   (patched 6.0.1)
  >= 7.0.0-preview.1.22076.8, < 8.0.1    (patched 8.0.1)

Without the pin the package resolves to 9.0.6 (project.assets.json,
net8.0 target), which is outside both ranges. It is now purely
transitive - System.Formats.Asn1 no longer appears in
projectFileDependencyGroups - reached only via
Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.

The audit oracle was validated rather than assumed. The repo nuget.config
pins sources to nuget.org, which is TLS-blocked here, so NuGet emits
NU1900 ("unable to get package vulnerability data") and NU1901-NU1904 can
never fire - a zero result would have been vacuous. Restoring instead
against a feed that advertises VulnerabilityInfo/6.7.0 makes audit live:
injecting System.Formats.Asn1 6.0.0 produced

  NU1903: Package 'System.Formats.Asn1' 6.0.0 has a known high severity
  vulnerability, GHSA-447r-wph3-92pm

confirming the oracle fires. With the pin removed and the same live
audit, `dotnet restore Reactor.slnx` exits 0 with zero NU1901/1902/1903/1904.

Also dropped the now-orphaned <PackageVersion> from
Directory.Packages.props. A repo-wide sweep found this project was its
only consumer, and CentralPackageTransitivePinningEnabled is not set
anywhere (defaults false), so a PackageVersion alone pins no transitive
resolution - removing it changes nothing.

Verified: solution restore exit 0, zero audit warnings;
`dotnet build Reactor.slnx --no-restore -c Release` 0 errors;
Reactor.Compile.Analyzer.Tests 11/11 passed. Replicating the CI
"Vulnerable packages" gate end to end (restore + `dotnet list
Reactor.slnx package --vulnerable --include-transitive` + its slnx-derived
exclusion parse) gives listExit=0, 0 findings, no Asn1 rows. Note that
gate excludes the 104 projects under samples/ and tests/, so it would not
have caught a regression here on its own; the NU1903 control and the
resolved 9.0.6 are the load-bearing evidence.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@azchohfi Alexandre Zollinger Chohfi (azchohfi) changed the title Remove dead coverlet.collector dependency and fix stale System.Formats.Asn1 pin comment Remove dead coverlet.collector dependency and the no-longer-needed System.Formats.Asn1 pin Sep 24, 2026
@azchohfi
Alexandre Zollinger Chohfi (azchohfi) merged commit 71bc108 into main Sep 24, 2026
54 of 55 checks passed
@azchohfi
Alexandre Zollinger Chohfi (azchohfi) deleted the azchohfi-coverlet-cleanup-followup branch September 24, 2026 21:08
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