Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CompatibilitySuppressions after updating APICompat that uses references #58208

Merged
merged 1 commit into from
Sep 1, 2021

Conversation

joperezr
Copy link
Member

Updating the Compatibility package used in dotnet/runtime repo and updating the CompatibilitySuppresion.xml files now that ApiCompat is able to follow type-forwards. This now allow us to remove some suppressions that were just due to not finding the types to the forwarded assembly, as well as add new suppressions for breaking changes to types that are forwarded.

@dotnet-issue-labeler
Copy link

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.

@ghost
Copy link

ghost commented Aug 26, 2021

Tagging subscribers to this area: @Anipik, @safern, @ViktorHofer
See info in area-owners.md if you want to be subscribed.

Issue Details

Updating the Compatibility package used in dotnet/runtime repo and updating the CompatibilitySuppresion.xml files now that ApiCompat is able to follow type-forwards. This now allow us to remove some suppressions that were just due to not finding the types to the forwarded assembly, as well as add new suppressions for breaking changes to types that are forwarded.

Author: joperezr
Assignees: -
Labels:

area-Infrastructure-libraries

Milestone: -

Comment on lines +4 to +9
<DiagnosticId>CP1002</DiagnosticId>
<Target>System.ServiceModel.Internals.dll</Target>
</Suppression>
<Suppression>
<DiagnosticId>CP1002</DiagnosticId>
<Target>SMDiagnostics.dll</Target>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These appear in multiple suppression files now. What is that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I chatted briefly with @ericstj and @Anipik about these. Basically some APICompat rules now might need a full closure of references when loading the assemblies, and for some projects that target net461, these two assemblies represent part of the full closure and are part of the GAC, just are not part of the targeting pack for whatever reason. The way ApiCompat works today, is that if you elected to load references and APICompat is unable to get the full closure, it emits a warning (CP1002) for each assembly in the closure that it couldn't find. We could opt for special-casing these two when targeting net461, but I think a better solution is for APICompat to be smarter and only emit CP1002 warnings when the assembly that it couldn't find was actually required by some rule that was doing some dependency walking. I have an idea on how to do this, and plan to add it for RC2, so my suggestion for now would be to check in these suppressions as-is, and once we fix APICompat to not warn about these then come back and remove these suppressions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation Joe.

just are not part of the targeting pack for whatever reason

Presumably because only assemblies that are meant to be directly referenced are part of the targeting pack, which System.ServiceModel.Internals.dll isn't. Just my guess.

I think a better solution is for APICompat to be smarter and only emit CP1002 warnings when the assembly that it couldn't find was actually required by some rule that was doing some dependency walking. I have an idea on how to do this, and plan to add it for RC2, so my suggestion for now would be to check in these suppressions as-is, and once we fix APICompat to not warn about these then come back and remove these suppressions.

Fully agree on that CP1002 should only be raised for references that are actually required to satisfy the graph. Presumably when you re-generated the suppression files with the newer version of PackageValidation, you already got a ton of value as you could test your change on dotnet/runtime.

Based on the diff and the amount of suppressions being added in comparison to what's being deleted, what do we gain by merging this in now instead of waiting until your mentioned change is merged and consumable?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the diff and the amount of suppressions being added in comparison to what's being deleted, what do we gain by merging this in now instead of waiting until your mentioned change is merged and consumable?

By enabling this, we first get coverage of a current blind spot (testing facades) and we also get us closer to our goal of getting all APICompat warnings with a very small cost (which is just temporary) which is these CP1002 errors which may or may not be relevant. We already saw in other places (like your AccessControl PR) that PackageValidation has helped catch interesting issues on the build, so I'd rather check this in and have some progress made as opposed to waiting for the full solution and miss a) feedback on this feature since we are shipping it in 6.0, b) coverage for full facades, c) coverage of other potential APICompat issues with our build.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds like the right set of reasons to get this in 👍

Copy link
Member

@ViktorHofer ViktorHofer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving under the assumption that some of the suppression files noise is just temporary and the files will be cleaned-up with a follow-up change.

@ghost
Copy link

ghost commented Sep 1, 2021

Hello @joperezr!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@joperezr
Copy link
Member Author

joperezr commented Sep 1, 2021

Errors in CI are unrelated. Merging to unblock upcoming maestro consumption PRs

@joperezr joperezr merged commit 67e3785 into dotnet:main Sep 1, 2021
@ViktorHofer
Copy link
Member

@joperezr please link to existing issues or file new ones for the unrelated failures in the PR, according to our PR guide.

@ghost ghost locked as resolved and limited conversation to collaborators Nov 3, 2021
@joperezr joperezr deleted the UpdateApiCompat branch April 6, 2022 16:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants