[CI Visibility] Fix coverage rewrites with shared framework dependencies - #9102
[CI Visibility] Fix coverage rewrites with shared framework dependencies#9102tonyredondo wants to merge 5 commits into
Conversation
BenchmarksBenchmark execution time: 2026-08-24 12:22:08 Comparing candidate commit fe1c0b0 in PR branch Found 1 performance improvements and 0 performance regressions! Performance is the same for 71 metrics, 0 unstable metrics, 62 known flaky benchmarks, 64 flaky benchmarks without significant changes.
|
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (9102) and master. ✅ No regressions detected |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6ab68d9e57
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .Where(candidate => candidate.Parsed && | ||
| candidate.Version.Major == requestedVersion.Major && | ||
| candidate.Version.Minor == requestedVersion.Minor && | ||
| candidate.Version >= requestedVersion) |
There was a problem hiding this comment.
Honor runtime roll-forward when locating shared frameworks
When a test application relies on a permissive runtime policy such as rollForward: Major or DOTNET_ROLL_FORWARD=Major, the host can successfully run an 8.0 runtimeconfig using an installed 9.0 shared framework. This filter nevertheless requires the installed framework to have exactly the requested major and minor, so the collector cannot find dependencies that the running application is actually loading and the coverage rewrite still fails. Framework selection needs to account for the effective roll-forward policy instead of hard-coding same-major/same-minor compatibility.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This is a valid broader edge case, but I am keeping it outside the scope of this fix. The resolver here follows the Coverlet approach referenced by issue 9023 and targets same-major/minor patch resolution. Correct major roll-forward support must account for the effective host policy from runtimeconfig settings, per-framework overrides, environment variables, command-line options, and prerelease behavior. Simply probing a higher major could select a framework the host would not use. I am leaving this thread unresolved rather than treating that partial behavior as fixed.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8178eddf8d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fe1c0b0bef
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fe1c0b0bef
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary of changes
Reason for change
The coverage collector could not resolve assemblies that were available only through an installed shared framework, such as
Microsoft.Extensions.Logging.AbstractionsfromMicrosoft.AspNetCore.App. If Mono.Cecil encountered that dependency while writing metadata, it had already truncated the assembly under test and left a damaged DLL on disk.Implementation details
framework,frameworks, andincludedFrameworksentries from sibling*.runtimeconfig.jsonfilesSystem.Private.CoreLiband select the highest compatible patch version using full semantic-version orderingFile.Replacebackups and rollbackTest coverage
CoverageResolverTestson net10.0 and net8.0CoverageRewriteTestson net10.0Datadog.Trace.Coverage.collectorproject buildMicrosoft.AspNetCore.Appand an optionalLogLevelparameterOther details
Windows and Linux CI provide the remaining platform coverage for replacement and locking semantics.
Fixes #9023