Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature-87: delete_object Refactor & Enhancements #88

Merged
merged 45 commits into from
May 22, 2024

Conversation

doulikecookiedough
Copy link
Contributor

@doulikecookiedough doulikecookiedough commented Feb 8, 2024

Summary of Changes:

  • Updated object_metadata class with new attribute pid to help client streamline the process of passing a pid value.
  • Metadata Public API Method Updates:
    • Refactored store_metadata to follow new metadata storage design, where all metadata documents for a given pid live in a directory formed by calculating the hash of the pid, with the document name being the hash of the pid + format_id
    • Updated retrieve_metadata and delete_metadata to account for above changes.
    • delete_metadata will remove all metadata documents for a given pid if no format_id is provided
  • Public API Method delete_object Updates:
    • Deleting an object will also remove all metadata associated with a given pid
    • Addressed situations involving orphaned pid references files by handling exceptions where relevant
    • Improved atomicity of deletion by renaming all files (appending _delete to the file name), adding them to a list, and then iterating over that list to delete files.
  • Refactored methods related to creating reference files to improve clarity
  • Updated documentation

…delete_object' for when 'id_type' is 'cid' and add new pytests
… by sharding the hash of the 'pid', with metadata doc name being the hash of the 'format_id' and update related pytests
…en pid if no 'format_id' is supplied, and add new pytests
…trings, remove boolean return values and update pytests
…tomicity of the process, and to also delete all metadata documents when 'id_type' is pid
…one method '_write_refs_file' and update pytests
…method '_update_refs_file' and update pytests
…ception class thrown in FileHashStore for clarity
…d rail to '_update_refs_file' to ensure duplicate pids are not written when 'update_type' is 'add'
…d '_tag_pid_cid_and_verify_refs_files' and update/add new pytests
…() on fnfe), revise '_verify_hashstor_references' to improve clarity and update affected code
@doulikecookiedough
Copy link
Contributor Author

Greetings @artntek, when you have a moment - can you please help me review this branch?

src/hashstore/hashstore.py Outdated Show resolved Hide resolved
src/hashstore/hashstore.py Outdated Show resolved Hide resolved
src/hashstore/hashstore.py Outdated Show resolved Hide resolved
src/hashstore/hashstore.py Outdated Show resolved Hide resolved
src/hashstore/hashstore.py Outdated Show resolved Hide resolved
src/hashstore/filehashstore.py Show resolved Hide resolved
src/hashstore/hashstore.py Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
src/hashstore/filehashstore.py Show resolved Hide resolved
…d, update affected methods and add new pytest
… found in its expected cid refs file, update affected methods and add new pytest
@doulikecookiedough
Copy link
Contributor Author

I am merging this PR into develop as I have addressed @artntek's review comments. @jeanetteclark who will be testing HashStore in the coming weeks will provide further feedback.

@doulikecookiedough doulikecookiedough merged commit 9ab8139 into develop May 22, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants