-
Notifications
You must be signed in to change notification settings - Fork 757
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
Migrate HybridCache from aspnetcore to extensions #5391
Conversation
remaining |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Yes, let's mark it as |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started the review before I realised this changeset moves implementations from dotnet/aspnetcore. I left a number of style-related comments, as I'm guessing dotnet/aspnetcore follows a different style to us.
Besides that there are few other comments and questions. I find the use of !
operator and reliance one Debug.Assert somewhat worrisome, it does look those cases could result either in NREs or incorrect behaviours in release builds.
Overall, it would be good to understand the target state of this code move (since I'm not attending the Tactics) - will dotnet/aspnetcore version be deprecated, and dotnet/aspnetcore will instead depend on our artifacts and implementations? What would this mean for consumers? Etc.
src/Libraries/Microsoft.Extensions.Caching.Hybrid/HybridCacheOptions.cs
Outdated
Show resolved
Hide resolved
src/Libraries/Microsoft.Extensions.Caching.Hybrid/IHybridCacheBuilder.cs
Outdated
Show resolved
Hide resolved
src/Libraries/Microsoft.Extensions.Caching.Hybrid/Internal/BufferChunk.cs
Show resolved
Hide resolved
src/Libraries/Microsoft.Extensions.Caching.Hybrid/Internal/BufferChunk.cs
Outdated
Show resolved
Hide resolved
src/Libraries/Microsoft.Extensions.Caching.Hybrid/Internal/BufferChunk.cs
Outdated
Show resolved
Hide resolved
src/Libraries/Microsoft.Extensions.Caching.Hybrid/Microsoft.Extensions.Caching.Hybrid.csproj
Outdated
Show resolved
Hide resolved
src/Libraries/Microsoft.Extensions.Caching.Hybrid/Microsoft.Extensions.Caching.Hybrid.csproj
Outdated
Show resolved
Hide resolved
src/Libraries/Microsoft.Extensions.Caching.Hybrid/Microsoft.Extensions.Caching.Hybrid.csproj
Outdated
Show resolved
Hide resolved
...s/Microsoft.Extensions.Caching.Hybrid.Tests/Microsoft.Extensions.Caching.Hybrid.Tests.csproj
Outdated
Show resolved
Hide resolved
test/Libraries/Microsoft.Extensions.Caching.Hybrid.Tests/StampedeTests.cs
Show resolved
Hide resolved
Discussed this with Jose separately; this API has already been shipped non-[Experimental] in multiple net9 previews; might be confusing to add it now. That said, I'm happy with any outcome - this is not a hill I need to die on, as long as it is appropriately considered ;p |
@RussKie thanks for the detailed feedback; commit with tweaks pushed |
The assertions here are for things that we already absolutely positively already believe to be true and pre-validated by separate logic, but we just want to be paranoid in debug, because of paranoia.
Yes, the plan is to relocate |
Sounds good, the more - the merrier :) |
I wasn't in the loop. |
src/Libraries/Microsoft.Extensions.Caching.Hybrid/Internal/BufferChunk.cs
Outdated
Show resolved
Hide resolved
In this repo we only have two states - "dev" and "normal" or (in a consumer terms) - "experimental" and "prod-ready". All our packages except for the following three are "prod-ready", these three are "experimental":
During the "9.0-previewX" releases there are not visible branding difference, however, at and after the official release the "prod-ready" packages have stable branding, e.g.: "Microsoft.Extensions.Compliance.Testing.8.8.0.nupkg"; and the "experimental" packages have not, e.g.: "Microsoft.Extensions.Diagnostics.Probes.8.8.0-rtm.24412.9.nupkg". The "experimental" packages are also decorated with the extensions/src/Libraries/Microsoft.Extensions.Options.Contextual/Directory.Build.props Lines 2 to 8 in 135a94a
So... if we're not expecting any further API changes in this package, then we can mark the package as "prod-ready", i.e., set We also need to do the following:
/cc: @joperezr |
this is a direct snapshot from dotnet/aspnetcore, with modifications to: 1. satisfy local repo style rules 2. work with different build setup Minor global changes: 1. support netstandard2.1 on some legacy shim includes 2. add some additional required packages (for testing)
c469343
to
389975e
Compare
(rebased against |
@@ -0,0 +1 @@ | |||
Full `HybridCache` documentation is [here](https://learn.microsoft.com/aspnet/core/performance/caching/hybrid). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do try to enforce that all packages produced out of this repo have a README that more or less follows the same format (brief description of the package intent, Instructions for installing the package, Usage Examples). You can see an example of this here: https://github.com/dotnet/extensions/blob/main/src/Libraries/Microsoft.Extensions.Diagnostics.HealthChecks.Common/README.md. They don't have to be very exahustive, but it would be good to have at least a very basic README here with at least some of those details as opposed to just pointing to some other learn page. The main idea of this README is: "What would a consumer NEED TO KNOW in the first 5 minutes of consuming the package?" That means it is totally fine to still have more detailed documentation elsewhere and we specifically don't want this README to be big, but it would be good to follow pattern if possible.
src/Libraries/Microsoft.Extensions.Caching.Hybrid/Microsoft.Extensions.Caching.Hybrid.csproj
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To confirm - is the decision to ship this package and the API within as "stable/prod-ready"? |
If the intention is whether or not the APIs should be experimental, I don't think it is needed, I would leave that up to @mgravell's discretion. The intent of that analyzer requiring you to mark the APIs as experimental the first time you introduce them is to make sure that you at least release them once and let customers use it before you mark them as stable. In this library's case, it's API has already been shipped as preview multiple times and people has shared feedback, so I don't think that is a concern. Also, this is in the dev branch which means that even if this gets merged now, it would still only ship as preview. |
- reorder .ctor first - add baseline API (instead of suppressing)
Suggestions integrated; code remains as per vanilla "relocate from aspnetcore main" |
Plan agreed in "tactics" to migrate
HybridCache
from dotnet/aspnetcore to dotnet/extensions.This is a direct snapshot of the code from this point in dotnet/aspnetcore, with minor modifications to the library code:
Minor global changes:
Microsoft Reviewers: Open in CodeFlow
Reasons for move:
<IsPackable>false</IsPackable>
for now?)