feat(ulid): add NetEvolve.Http.Correlation.Ulid.ByteAether provider for monotonic correlation IDs - #733
#733feat(ulid): add NetEvolve.Http.Correlation.Ulid.ByteAether provider for monotonic correlation IDs#733samtrion merged 1 commit intomaindailydevops/http.correlation:mainfrom feature/730-byteaether-uliddailydevops/http.correlation:feature/730-byteaether-ulidCopy head branch name to clipboard
Conversation
…scope monotonicity claim The Basic Setup snippet resolved WithUlidGenerator() without importing the namespace that declares it, so it could not compile as shown. ByteAether's monotonic guarantee is per-generator via lock-free CAS on local state, so it neither establishes a total order across nodes nor eliminates ULID collision probability. Reword the benefit accordingly. Assert ULID ordering with string.CompareOrdinal, since lexicographic sortability is defined ordinally and TUnit's generic IsLessThan routes to culture-sensitive string.CompareTo.
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #733 +/- ##
=======================================
Coverage 97.63% 97.63%
=======================================
Files 18 18
Lines 169 169
Branches 22 22
=======================================
Hits 165 165
Misses 2 2
Partials 2 2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Adds the
NetEvolve.Http.Correlation.Ulid.ByteAetherprovider, which generates correlation IDs viaByteAether.Ulidto guarantee strictly monotonic ordering for IDs created within the same millisecond — unlike the existingNetEvolve.Http.Correlation.Ulidpackage, whose IDs are randomly ordered inside a millisecond.This supersedes #730 by @Seramis, whose commits are preserved here with original authorship. That PR could not be updated: "Allow edits by maintainers" is disabled on the source fork, so the review fixes below could not be pushed to it, and its workflow runs were additionally gated behind manual approval.
Changes
src/NetEvolve.Http.Correlation.Ulid.ByteAetherwith an internalUlidCorrelationIdProviderand aWithUlidGenerator()builder extension mirroring the existing ULID package.ByteAether.Ulid1.4.0 added to central package management.Parallel.For, and sequential ordering across net8.0/9.0/10.0.Review feedback from #730
Three findings from the automated review were adopted:
using NetEvolve.Http.Correlation.Ulid.ByteAether;, the namespace declaringWithUlidGenerator(), so it could not compile as shown.IsLessThan, which resolves through culture-sensitivestring.CompareTo. ULID sortability is defined ordinally, so the test now asserts onstring.CompareOrdinal.Three were declined, with reasoning recorded in the #730 threads: splitting the root README snippet (exclusivity is already stated per import), extending the builder-contract test (would diverge from the identical test in
NetEvolve.Http.Correlation.Ulid.Tests.Unit), and adding a clock seam for a same-millisecond monotonicity test (widens production API to assert a guarantee owned by the dependency).Verification
dotnet build: 0 errors, 0 warnings.Notes
main, so it includes chore(deps): update dependency tunit to 1.62.0 #731 (TUnit 1.62.0) and feat: Replace NSubstitute with TUnit.Mocks in test suite #732 (TUnit.Mocks migration); feat(ulid): add NetEvolve.Http.Correlation.Ulid.ByteAether provider for monotonic event ordering #730 was based on a stalemain.dotnet formatreports a pre-existingCHARSETerror ontests/NetEvolve.Http.Correlation.HttpClient.Tests.Unit/HttpCorrelationIdHandlerTests.cs(missing UTF-8 BOM). Present onmainsince chore(deps): update dependency netevolve.defaults to 2.4.0 #604 and unrelated to this change; needs a separate fix.