Repository navigation
Narrow Dynamic Exclude Filters for Loaded Assemblies - #2069
Merged
Bertk merged 2 commits intoNov 3, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Generated exclusion filters for hyphenated assembly names fail validation, so intended assembly exclusions can be silently dropped.
1 open issue
What changed in this PR
This PR narrows Coverlet.MTP’s dynamic exclusions for loaded assemblies to avoid excluding system-under-test assemblies that share a prefix.
Changes:
- Uses exact-name filters for loaded assemblies while preserving wildcard normalization for
deps.jsonentries. - Adds tests for exact filter generation and shared-prefix scenarios.
- Documents the two discovery sources and their filtering behavior.
| File | Description |
|---|---|
test/coverlet.MTP.tests/Configuration/CoverageConfigurationDynamicExcludeTests.cs |
Updates expectations and adds shared-prefix regression coverage. |
test/coverlet.core.tests/Helpers/ProcessAssemblyHelperTests.cs |
Tests exact-name filter generation. |
src/coverlet.MTP/Configuration/CoverageConfiguration.cs |
Applies separate filter transformations to each discovery source. |
src/coverlet.core/Helpers/ProcessAssemblyHelper.cs |
Adds the exact-name filter helper. |
Documentation/Coverlet.MTP.Integration.md |
Explains runtime discovery and exclusion precision. |
Review effort: Balanced
This was referenced Nov 15, 2026
This was referenced Dec 4, 2026
Bump coverlet.collector from 3.0.2 to 10.1.1
tahayagizguler/skills-secure-repository-supply-chain#11
Open
Open
Open
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.

This pull request refines the logic for generating dynamic exclude filters in Coverlet.MTP, making the exclusion of assemblies more precise and reducing the risk of unintentionally excluding assemblies that share common prefixes with the system under test (SUT). The update distinguishes between exclusions derived from
deps.json(which remain wildcarded) and those from loaded assemblies (which are now exact matches), and updates documentation and tests accordingly.Dynamic Exclude Filter Precision Improvements:
deps.jsoncontinue to use wildcard filters, while assemblies already loaded in the controller process now use exact-name filters for exclusion. This prevents overly broad exclusions that could unintentionally exclude SUT assemblies with similar prefixes.Documentation Updates:
Coverlet.MTP.Integration.mdto clarify the new behavior of dynamic exclude filters, explaining the distinction between runtime discovery sources and the improved exclusion precision for loaded assemblies.Test Enhancements:
CoverageConfigurationDynamicExcludeTests.csto verify that loaded assemblies are excluded using exact-name filters and that wildcard filters are not erroneously applied to SUTs with shared prefixes.ProcessAssemblyHelperTests.csto ensure the newToExactExcludeFiltermethod generates the correct filter patterns.