Repository navigation
Support multiple unique assembly ids in packages and tasks - #27203
Conversation
This change updates the ApiCompatibility and the PackageValidation backend to allow comparing assembly sets with each other instead of only single assemblies. This enables api compatibility checks on packages that contain more than a single assembly and also unblocks packages that are named differently than the underlying assembly.
Tests need to be updated as the CompatDifference type now stores the metadata information of the left and right that triggered the difference. Also updating the styling to follow the arrance-act-assert pattern that makes reading these tests easier.
|
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
| if (symbol is IAssemblySymbol assembly) | ||
| { | ||
| // When mapping assemblies, we must ignore the version, culture and token. | ||
| return assembly.Identity.Name; | ||
| } |
There was a problem hiding this comment.
This is a very interesting change. Before, an assembly with the same identity but different version, culture or public key didn't not map together when resolved from an assembly set. As an example, System.Runtime/6.0.0.0 didn't map with System.Runtime/7.0.0.0.
There was a problem hiding this comment.
I'm not sure where this is used, but maybe you can test these scenarios to make sure we catch them?
- Error when changing public key.
- Error when version is lower on right than left.
- Ensure we compare newer versions of the same assembly and find compatibility problems in them.
- Either error when changing culture, or support mapping multiple assemblies with different cultures. I'm not sure there's a scenario for API compat on culture-specific assemblies since they typically have no code in them just embedded resources.
There was a problem hiding this comment.
Yes, what you describe is already being validated by the AssemblyIdentityMustMatch rule here:
This specific change here affects the mapping of assemblies (before the rule is even invoked) and resulted in assemblies with different full qualified names (i.e. the version) not being mapped together.
|
@dotnet/dnceng can you please take a look at the following AzDO failures? Are those related to the known outage? |
This one happens semi-regularly, and it's always the same root cause; the same build artifact being uploaded by different agents at the same time. Somewhere you have name duplication and it's causing a collision, surfaced by these strange storage API loggings. |
|
/azp run dotnet-sdk-public-ci |
|
Azure Pipelines successfully started running 1 pipeline(s). |
) * Support multiple assemblies in package and task This change updates the ApiCompatibility and the PackageValidation backend to allow comparing assembly sets with each other instead of only single assemblies. This enables api compatibility checks on packages that contain more than a single assembly and also unblocks packages that are named differently than the underlying assembly. * Update tests because of the multi assembly mode Tests need to be updated as the CompatDifference type now stores the metadata information of the left and right that triggered the difference. Also updating the styling to follow the arrance-act-assert pattern that makes reading these tests easier. * Update AssemblyMapper.cs
Fixes #17364
Fixes #23393
Fixes dotnet/runtime#65260
Contributes to #18165
Support multiple assemblies in package and task
This change updates the ApiCompatibility and the PackageValidation
backend to allow comparing assembly sets with each other instead of only
single assemblies.
This enables api compatibility checks on packages
that contain more than a single assembly and also unblocks packages that
are named differently than the underlying assembly.
Update tests because of the multi assembly mode
Tests need to be updated as the CompatDifference type now stores the
metadata information of the left and right that triggered the
difference.
Also updating the styling to follow the arrance-act-assert pattern that
makes reading these tests easier.