refactor(cache)!: move implementation classes out of the abstractions package - #216
cosmin-staicu wants to merge 1 commit into
Conversation
|
🔎 Maintainer heads-up: automated triage flagged this PR as potentially material, so it may need a signed CLA in addition to the DCO sign-off. Strong signals
This is advisory only — the bot does not decide. Please judge against the CLA criteria (material, product-critical, patent-sensitive, corporate contributor, broad commercial use). Note that thresholds can be gamed by splitting PRs, so use your judgement.
|
249a2a7 to
e23125b
Compare
da2aee2 to
994a589
Compare
e23125b to
bffb69e
Compare
bffb69e to
cbf41cd
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The public batch helper lacks consistent argument validation, and the interface documentation still shows removed default implementations.
Review effort: Balanced
Findings: 1
What changed in this PR
Moves concrete cache implementations from UiPath.Caching.Abstractions into UiPath.Caching, preserving namespaces while enforcing a cleaner package boundary.
Changes:
- Relocates serializers, typed-cache wrappers, comparers, expiration helpers, and telemetry utilities.
- Makes
BatchGetOrAddpublic and requires externalICacheimplementations to provide batch overloads. - Updates null-cache behavior, tests, API baselines, documentation, and migration notes.
| File | Description |
|---|---|
tests/UiPath.Caching.Tests/Fakes/DictionaryCache.cs |
Implements required batch overloads. |
tests/UiPath.Caching.Tests/BatchGetOrAddTests.cs |
Verifies null-cache batch equivalence. |
src/UiPath.Caching/Telemetry/TelemetryTags.cs |
Moves telemetry tag conversion helper. |
src/UiPath.Caching/SystemJsonByteSerializerProxy.cs |
Moves the default JSON serializer. |
src/UiPath.Caching/RawByteSerializerProxy.cs |
Moves the raw-byte serializer. |
src/UiPath.Caching/PublicAPI.Unshipped.txt |
Records newly exposed core APIs. |
src/UiPath.Caching/HashCacheOfT.cs |
Moves the typed hash-cache wrapper. |
src/UiPath.Caching/CacheOfT.cs |
Moves the typed cache wrapper. |
src/UiPath.Caching/CacheKeyComparer.cs |
Moves cached key comparers. |
src/UiPath.Caching/CacheFactoryExtensions.cs |
Moves typed factory extensions. |
src/UiPath.Caching/CacheExpiration.cs |
Moves expiration validation helpers. |
src/UiPath.Caching/BatchGetOrAdd.cs |
Makes the batch helper public. |
src/UiPath.Caching.Abstractions/PublicAPI.Unshipped.txt |
Records removed and required APIs. |
src/UiPath.Caching.Abstractions/NullCache.cs |
Implements required batch operations. |
src/UiPath.Caching.Abstractions/IHashCache.cs |
Removes cross-package documentation reference. |
src/UiPath.Caching.Abstractions/ICache.cs |
Removes batch default implementations. |
docs/reference/interfaces.md |
Documents required batch methods and typed injection. |
docs/how-to/extending.md |
Documents serializer package ownership. |
CHANGELOG.md |
Records package and interface breaking changes. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
cbf41cd to
eb358d0
Compare
eb358d0 to
da27781
Compare
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
The broad assembly relocation and intentional binary-breaking interface changes warrant final human validation, especially because the PR is stacked on #215.
Review effort: Balanced
Findings: None
994a589 to
64e59cc
Compare
555c8cb to
7287a4a
Compare
ceafb35 to
ce4cbe4
Compare
a80cae6 to
51fdd9b
Compare
0b74a70 to
95a3364
Compare
95ae7db to
db70dcb
Compare
95a3364 to
6905a0f
Compare
db70dcb to
e332441
Compare
6905a0f to
d53fd00
Compare
e332441 to
160611f
Compare
d53fd00 to
c9ad742
Compare
160611f to
5cc49c3
Compare
c9ad742 to
947655f
Compare
947655f to
c0305ee
Compare
c0305ee to
ae13f6f
Compare
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
The deliberate binary-breaking assembly and interface changes, combined with its stacked dependency on PR #215, warrant final human validation.
Review effort: Balanced
Findings: None
Resolved since last review (1)
… package SystemJsonByteSerializerProxy, RawByteSerializerProxy, Cache<T>, HashCache<T>, CacheFactoryExtensions, CacheExpiration, CacheKeyComparer, TelemetryTags and BatchGetOrAdd move to UiPath.Caching, so UiPath.Caching.Abstractions keeps to interfaces, null implementations, DTOs and the extensions over them. Namespaces are unchanged. ICache's three batch GetOrAddAsync overloads lose their default bodies, which called BatchGetOrAdd. BatchGetOrAdd becomes public, so an implementation outside the library can forward to it. NullCache implements them with the result BatchGetOrAdd gives over a cache that never hits: the generator answers each key's first state, and states on the same key share that answer. Disposable stays, since the null implementations return Disposable.Empty. BREAKING CHANGE: code that references only UiPath.Caching.Abstractions and uses one of the moved classes must reference UiPath.Caching, or inject ICache<T> and IHashCache<T> instead of calling CreateCache<T>. An ICache implementation outside the library must implement the batch GetOrAddAsync overloads. Binaries compiled against the old location or the old interface fail with TypeLoadException. Signed-off-by: Cosmin Staicu <cosmin.staicu@uipath.com>
ae13f6f to
2649eba
Compare
|




Stacked on #215; its base is
perf/breaking-hot-path. Review and merge that one first.Moves the implementation classes from
UiPath.Caching.AbstractionstoUiPath.Caching, so the abstractions package keeps to interfaces, null implementations, DTOs and the extensions over them:SystemJsonByteSerializerProxyandRawByteSerializerProxyCache<T>,HashCache<T>andCacheFactoryExtensions, which constructs themCacheExpiration,CacheKeyComparerandTelemetryTagsBatchGetOrAdd, now publicNamespaces are unchanged, so code that references
UiPath.Cachingcompiles as before.AddCachingalready registersICache<T>andIHashCache<T>, so a library that references only the abstractions package can inject typed caches withoutCreateCache<T>.Batch GetOrAdd
ICache's three batchGetOrAddAsync<T, TState>overloads lose their default bodies, which calledBatchGetOrAdd.RedisCacheandMultilayerCachealready implement them. An implementation outside the library forwards to the publicBatchGetOrAdd.RunAsync, which validates all four reference arguments synchronously, before the cache is touched.NullCacheimplements them with the resultBatchGetOrAddgives over a cache that never hits: the generator answers each key's first state, and states on the same key share that answer. A test checks that the two agree.What stays
Disposable:NullCacheChangeTokenandNullTopic<T>returnDisposable.Empty.The other extension classes:
CacheExtensions,CacheSyncExtensions,HashCacheExtensions,HashCacheSyncExtensionsandTimeProviderExtensions.Breaking
Code that references only
UiPath.Caching.Abstractionsand uses a moved class must add aUiPath.Cachingreference, or injectICache<T>andIHashCache<T>instead of callingCreateCache<T>.An
ICacheimplementation outside the library must implement the three batch overloads.Binaries compiled against the old location or the old interface fail with
TypeLoadException. The abstractions package cannot forward types toUiPath.Caching, which depends on it.Verification
dotnet build -c Release -warnaserrordotnet test: 4075 passed on net8.0 and net10.0, with the Redis integration tests on.