-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
ConfigureHttpClientDefaults isn't an extension method in the reference assembly #90911
Comments
Tagging subscribers to this area: @dotnet/ncl Issue DetailsThis PR added ConfigureHttpClientDefaults but it turns out there's a ref/def mismatch that's causing this API to only show up as a static method instead of an extension method: Def: Line 80 in 3bda6e0
cc @karelz @JamesNK @CarnaViire @stephentoub
|
I wonder why PublicApiAnalyzer didn't fail this or warn about it!? 🤔 |
Reopening for backport |
This looks like a valid bug in analyzer, we should create issue at given repo. I don't know which repo manages this analyzer. I am out as of now, can someone create a issue for this!? Thanks, |
cc @ericstj @carlossanlop @ViktorHofer it looks like there might be a bug in API Compat |
The public API comparison of a contract and implementation assembly is handled by APICompat, not by PublicApiAnalyzer. I would describe this case as a case that isn't yet covered by APICompat's validation. We have many other cases for which we have issues that aren't yet covered by the tool. See https://github.com/dotnet/sdk/issues?q=is%3Aopen+is%3Aissue+label%3AArea-ApiCompat |
Filed an issue dotnet/sdk#34824 |
Great! Thanks! I guess we can close this issue now! 😇 |
It's open for the backport to release/8.0 branch |
13 hours from report to fix in both main and 8.0. That is FAST! Kudos @ShreyasJejurkar and @CarnaViire! |
Kudos to @ShreyasJejurkar as well 🥳 |
Right, @ShreyasJejurkar did the original PR, I entirely forgot. Sorry -- kudos to @ShreyasJejurkar as well! (fixed above) |
haha, Thanks @karelz and @CarnaViire. I don't think there is anything to appreciate, to be honest, this was a simple fix! 😅 But the major issue is on the API Compact side where this got missed from flagging, I hope there are no more like these cases in the build. I don't know (am yet to explore) what the code volume needs to go in APICompact to solve this issue, but if anyone here has an idea if it's trivial, it would be great to get that fix so that we can catch this kind of things before release! @ViktorHofer Thanks for the pointers to APICompact, I wasn't aware as I used to get errors from PublicApiAnalyzer. 😄 But btw this Public API Shipped/UnShipped part of SDK? I mean customers can also use that, is it? I thought this is specifically designed for dotnet repos! 🤔 |
The Public API Analyzers uses this concept of shipped/unshipped files to track API changes. That analyzer is publicly available to use: https://github.com/dotnet/roslyn-analyzers/blob/main/src/PublicApiAnalyzers/PublicApiAnalyzers.Help.md APICompat / PackageValidation is the tool that we use here in runtime, which is also publicly available and even part of the .NET SDK and can be enabled by setting a property. See the documentation here: https://learn.microsoft.com/en-us/dotnet/fundamentals/package-validation/overview |
This PR added ConfigureHttpClientDefaults but it turns out there's a ref/def mismatch that's causing this API to only show up as a static method instead of an extension method:
Ref:
https://github.com/dotnet/runtime/blob/3bda6e0013ddb5b48a7b2a89fd84bf4fbbed0e37/src/libraries/Microsoft.Extensions.Http/ref/Microsoft.Extensions.Http.cs#L60C83-L60C105
Def:
runtime/src/libraries/Microsoft.Extensions.Http/src/DependencyInjection/HttpClientFactoryServiceCollectionExtensions.cs
Line 80 in 3bda6e0
cc @karelz @JamesNK @CarnaViire @stephentoub
The text was updated successfully, but these errors were encountered: