fix: allow dynamic storages in ExternalLocation.from_name#313
Draft
lmmx wants to merge 3 commits into
Draft
Conversation
ed6c655 to
b5cb93c
Compare
Contributor
Author
|
Re-pushed to ensure tests pass incrementally
|
b5cb93c to
6002ae4
Compare
Contributor
Author
|
Re-pushed to reorder commits (protocol may need to be split off if it's the one causing test failures) There are far fewer test failures on the (now 2nd) commit, the one that moves the missing values It's possible these failures indicate this cannot be done though |
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.
1. Dynamic Storage Backends
Description
As discussed in #311 (discussion) I am building a prototype of the
phash:storage protocol forExternalLocationso we can writeexternal("phash:")and have a file be saved tocontent-addressable storage using a perceptual hash rather than a cryptographic one, and this will
effectively serve as deduplication as well as a novel way to tolerate inexact matches in file
content in a snapshot.
To add this we discussed changing the validation from hardocing hash and uuid strings to instead
validate against
state().all_storageswhose keys would provide the set of possible storageprotocol prefixes.
This PR does so, and changes the error message from
to
reprof the string keys rather than the keys themselves to wrap them in single quoteswhich I expect to be clearer even if there are unfamiliar ones.
2. Storage Protocol compare method
As a secondary part of the same work, I also needed a
comparemethod on StorageProtocol to make mine work, which was discussed here3. Don't increment
missing_valuesinExternalbase class__eq__method if in create modeExternalbase__eq__causes test failure in teardown after new snapshot created #314Nudge the increment line to after create so as not to break the test in teardown if it was just created
Related Issue(s)
Checklist
hatch run cov:github).[x] I have added tests for new functionality (if applicable).N/Ahatch run changelog:entryfeat:will cause a major andfix:a minor version bump)fix:and force push overwrite