-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
.Net: Enable package compatibility validation #4438
.Net: Enable package compatibility validation #4438
Conversation
@stephentoub For compatibility validation I suppressed following errors, let me know if it's okay:
Thanks! |
@ViktorHofer, can you assist @dmytrostruk here? We're trying to get package validation set up for Semantic Kernel. |
Sure but I'm out till Monday. cc @ericstj |
Seems odd, if it were me I'd just have Debug and Release use public signing with the same public key. That minimizes the differences between configurations that run tests. I guess you might have another reason to not sign, but if not consider using public signing.
Interesting - I wouldn't expect that to happen. It should be bringing the reference from ResolveReferences. Perhaps you're packing without building so ResolveReferences doesn't run? Let me pull this down and try. I might be able to provide a workaround. |
Actually, we pack after build by using
Thank you! |
Yep, I got the repro and I see the reference being passed in. Something fishy happening where the lookup isn't working. I'll debug a bit then report the findings. Suppressing is OK as a workaround. Running API Compat with references can give you more coverage; for example, when a type is forwarded outside the assembly we can compare the target type in the new assembly with the previous type. |
@ericstj Thanks for letting me know! For CP0003 I will check public signing. I will temporary suppress CP1002 and bring it back when the issue is resolved. |
These are actually caused by the same problem. What's happening is when loading the baseline assembly from your shipping nuget package we load Since your latest build is omitting the public key token, it doesn't satisfy the reference, thus the load failure. The compiler is doing the loading for us, so we don't really have anything we can do to change this behavior in API compat. The best way to solve both problems is using public signing. That way you don't fiddle with the identity of your assembly. |
Here's a change that fixes both warnings by enabling public-signing. It builds for me but I haven't tested anything. Use if you like: ericstj@821066d |
@ericstj Thanks a lot! |
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> Resolves: microsoft#4294 This PR contains changes to enable package compatibility validation for packages without `alpha` or `preview` prefix. This will allow to catch breaking changes in public API earlier and resolve them before the release. Verification: After following test commit with new optional parameter - microsoft@dd8745c, PR build pipeline failed with following error: https://github.com/microsoft/semantic-kernel/actions/runs/7350765480/job/20012998030?pr=4438 <img width="787" alt="image" src="https://github.com/microsoft/semantic-kernel/assets/13853051/a0292351-4811-48d5-b64f-24401a4c5e57"> ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄 --------- Co-authored-by: Mark Wallace <127216156+markwallace-microsoft@users.noreply.github.com>
Motivation and Context
Resolves: #4294
This PR contains changes to enable package compatibility validation for packages without
alpha
orpreview
prefix. This will allow to catch breaking changes in public API earlier and resolve them before the release.Verification:

After following test commit with new optional parameter - dd8745c, PR build pipeline failed with following error:
https://github.com/microsoft/semantic-kernel/actions/runs/7350765480/job/20012998030?pr=4438
Contribution Checklist