⚙️ FEATURE-#287: Expand Storage ABC with delete, list, TTL, CAS#297
Merged
Conversation
FernandoCelmer
commented
May 2, 2026
Member
Author
There was a problem hiding this comment.
🔍 Code Review
Code issues found: 5
| # | Severity | Comment |
|---|---|---|
| 1 | [Blocking] | S3.delete catches non-existent exception type |
| 2 | [Blocking] | atomic_swap inherits stale TTL in StorageDefault |
| 3 | [Blocking] | atomic_swap cannot propagate TTL in StorageFile |
| 4 | [Blocking] | StorageFile lock only protects atomic_swap |
| 5 | [Suggestion] | S3/GCS atomic_swap is not truly atomic |
FernandoCelmer
commented
May 3, 2026
FernandoCelmer
left a comment
Member
Author
There was a problem hiding this comment.
Code Review (re-review after fixes)
All 5 issues from previous review have been resolved:
- S3
delete— now usesfrom botocore.exceptions import ClientErrorwith proper 404 code filtering StorageDefault.atomic_swap— clears old TTL/fingerprint before writing, applies new TTL if providedStorageFile.atomic_swap— entire swap operation now within singlewith self._lock:blockStorageFilelock coverage —post()andget()now acquireself._lock- S3/GCS
atomic_swap— now uses conditional writes (S3IfMatch/IfNoneMatchETags, GCSif_generation_match). True CAS semantics.
Verdict: All blockers resolved. Ready to merge.
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.
Closes #287
Description
dotflow/abc/storage.py— Storage ABC gains five new abstract methods:delete,delete_prefix,list_keys,atomic_swap;postsignature extended with optionalttlandfingerprint;cleardemoted to a concrete default that delegates todelete_prefixdotflow/providers/storage_default.py— Full in-memory implementation withthreading.RLock, TTL viatime.monotonic, lazy eviction onget/list_keysdotflow/providers/storage_file.py— File-backed implementation with sidecar.metafiles for TTL/fingerprint;threading.RLockadded (currently only used inatomic_swap)dotflow/providers/storage_s3.py— S3 implementation delegating new operations to theS3service classdotflow/providers/storage_gcs.py— GCS implementation delegating new operations to theGCSservice classdotflow/cloud/aws/services/s3.py— Addsdeleteandlist_keysto the S3 service layerdotflow/cloud/gcp/services/gcs.py— Addsdeleteandlist_keysto the GCS service layerdotflow/testing/storage_contract.py— New reusableStorageContractmixin for third-party driver authorsdotflow/testing/__init__.py— ExportsStorageContracttests/providers/test_storage_default_contract.py— RunsStorageContractagainstStorageDefaulttests/providers/test_storage_file_contract.py— RunsStorageContractagainstStorageFileMotivation and Context
The existing Storage ABC exposed only
post,get,key, andclear, which was insufficient for workflows that need TTL-based expiration, fingerprint-based deduplication, enumeration of stored keys, targeted single-key deletion, and compare-and-swap updates. Closes #287.Types of changes
Checklist