Repository navigation
feat: v2.0.0 — stateless allocation-conscious rewrite (net8/9/10) - #3
Merged
Merged
Conversation
…ffers Fixes cross-request race condition (shared attribute instance held per-request state), the non-compiling HEAD, sync-over-async, the max-age Seconds/TotalSeconds bug, and Headers.Clear() wiping middleware headers. Adds IBufferDistributedCache fast path, LOH-safe MaxPayloadBytes default, and fail-open cache error handling. Claude-Session: https://claude.ai/code/session_01V1QeCENrvWQ1u6zN1qzBAU
Removes flaky timing-based v1 tests. Adds unit coverage for the stateless filter, key builder and pooled buffer writer; a 500-request concurrency regression for the fixed cross-request race; fail-open, cancellation, oversized payload and buffered-provider paths; and TestServer integration tests. Line coverage 96%, branch 92%. Test project targets net9.0 to match an installed runtime; the library under test stays net8.0. Claude-Session: https://claude.ai/code/session_01V1QeCENrvWQ1u6zN1qzBAU
BenchmarkDotNet MemoryDiagnoser over key generation, buffered/legacy hits and buffered store. budgets.json + check-allocation-budgets.ps1 fail the build on any Gen1/Gen2 collection or bytes/op regression. Measured (net9 host, short job): KeyGen 344 B/op, BufferedHit 104 B/op, LegacyHit 144 B/op, Store 864 B/op, all Gen0-only. Claude-Session: https://claude.ai/code/session_01V1QeCENrvWQ1u6zN1qzBAU
Minimal ASP.NET Core app targeting the cache attribute, used as the load-test target for the soak validation and as a runnable README example. Claude-Session: https://claude.ai/code/session_01V1QeCENrvWQ1u6zN1qzBAU
Drops the .NET Core 2.2 / codecov workflow. Adds build+test with opencover coverage feeding SonarQube (SonarCloud by default, self-hosted supported), gated on the SONAR_TOKEN secret so fork PRs stay green. Separate job runs the benchmarks and enforces the allocation budgets. Claude-Session: https://claude.ai/code/session_01V1QeCENrvWQ1u6zN1qzBAU
Pushing a v* tag builds, tests, packs (deterministic + SourceLink + snupkg), pushes to NuGet.org and creates a GitHub Release. Version is derived from the tag, replacing the abandoned third-party publish action. Claude-Session: https://claude.ai/code/session_01V1QeCENrvWQ1u6zN1qzBAU
Bilingual (EN/PT-BR) README with badges, quick start, attribute settings, global options, key format, measured performance numbers, and a v1→v2 migration table. Honest framing of the 1M rps premise (scale-out; the library's job is zero added GC pressure). Claude-Session: https://claude.ai/code/session_01V1QeCENrvWQ1u6zN1qzBAU
coverage.opencover.xml is a build artifact; it was accidentally committed with the test rewrite. Remove from tracking and ignore coverage/*.opencover.xml. Claude-Session: https://claude.ai/code/session_01V1QeCENrvWQ1u6zN1qzBAU
Adds the UTF-8 BOM the .editorconfig requires for C# files. No code changes. Claude-Session: https://claude.ai/code/session_01V1QeCENrvWQ1u6zN1qzBAU
Ships lib/net8.0, lib/net9.0 and lib/net10.0 in the package so consumers on each LTS/STS get a matching build. IBufferDistributedCache comes from the 9.0 package on net8.0 and from the shared framework on net9.0+. CI/release install the 10.0.x SDK; README documents the target set. Claude-Session: https://claude.ai/code/session_01V1QeCENrvWQ1u6zN1qzBAU
… secret env) - CacheAttribute.TryServeBufferedAsync: dispose the pooled buffer once in a finally guarded by a handed-off flag (S3966 redundant dispose). - CacheKeyBuilder: hoist the rented-array assignment out of the span initializer (S1121 assignment in sub-expression), keeping stackalloc ref-safe. - Pin all GitHub Actions to full commit SHAs (S7637). - Pass NUGET_API_KEY via env instead of expanding the secret in the run block (S7636). Claude-Session: https://claude.ai/code/session_01V1QeCENrvWQ1u6zN1qzBAU
…serror The library keeps TreatWarningsAsErrors via its csproj; not forcing it across the solution stops SonarAnalyzer smells in the Sonar-excluded sample/benchmark projects from failing the analysis build. Strict -warnaserror still runs in the allocation-gate job and locally. Claude-Session: https://claude.ai/code/session_01V1QeCENrvWQ1u6zN1qzBAU
- CacheKeyBuilder: use var for the rented array and destination span (IDE0007), consistent with the rest of the method. - PooledArrayBufferWriter: expose the write cursor as an auto-property (IDE0032). - Suppress CA1822 on the integration-test controller action with a justification (MVC action methods must be instance methods). Claude-Session: https://claude.ai/code/session_01V1QeCENrvWQ1u6zN1qzBAU
Replace the NUGET_API_KEY secret with NuGet Trusted Publishing: request an id-token, exchange it through NuGet/login for a short-lived key, then push. No long-lived API key to store or rotate. Action pinned to its commit SHA. Claude-Session: https://claude.ai/code/session_01V1QeCENrvWQ1u6zN1qzBAU
The NuGet Trusted Publisher policy pins Environment=production, so the OIDC token must carry that claim. Declare the environment on the release job. Claude-Session: https://claude.ai/code/session_01V1QeCENrvWQ1u6zN1qzBAU
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



AspNet.Cache v2.0.0
Modernization of the
CacheAttributeresponse-cache filter. Full plan inPLANO-MODERNIZACAO.md.Fixes
max-ageSeconds→TotalSeconds, andHeaders.Clear()wiping middleware headers.Highlights
IDistributedCache;IBufferDistributedCachefast path (net9+) with automatic fallback.ArrayPoolkey generation,SHA256.HashData, pooled buffers, directBodyWriterwrites on hits. Measured: key-gen 344 B/op (v1 ~1784), buffered hit 104 B/op, 0 Gen1/Gen2 across all paths.MaxPayloadBytes = 84_000); fail-open on provider errors.Validation (local)
-warnaserror: 0 warnings across all TFMs.build/check-allocation-budgets.ps1): all budgets respected, Gen2=0.CI / Release
.github/workflows/ci.yml: build + test (opencover) + SonarQube + allocation gate..github/workflows/release.yml: tagv*→ pack (SourceLink + snupkg) → NuGet.org + GitHub Release.Required before publish (owner)
SONAR_TOKEN,SONAR_PROJECT_KEY,SONAR_ORGANIZATION,NUGET_API_KEY.v2.0.0to trigger the NuGet release.https://claude.ai/code/session_01V1QeCENrvWQ1u6zN1qzBAU