Refactor checksum handling and introduce Checksum Class#65
Open
bobvanoorschot wants to merge 27 commits intomainfrom
Open
Refactor checksum handling and introduce Checksum Class#65bobvanoorschot wants to merge 27 commits intomainfrom
bobvanoorschot wants to merge 27 commits intomainfrom
Conversation
…lass for improved integrity management
…um class for improved clarity and consistency
…on and add debugging breakpoints in attachable module
…dant checksum computation methods
…r invalid checksums
…ed readability and functionality
…ility and maintainability
…orrect input usage
… and tests for improved consistency and clarity
…d clarity and consistency
…d readability and maintainability
…ksum.rb and clean up shared service tests
…d consistency in handling checksums
…consistency and readability
… updating tests for consistency
… updating tests for consistency
…ate related methods for consistency
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.
This pull request introduces a new
Checksumclass to handle checksum operations in theStorageTablesmodule. The changes refactor various parts of the codebase to use this new class, replacing direct checksum manipulations with methods from theChecksumclass. This improves code readability, maintainability, and ensures consistent checksum handling across the application.Introduction of
Checksumclass:app/models/storage_tables/checksum.rb: Added a newChecksumclass that encapsulates checksum operations, including creation from strings, IO objects, and file paths, as well as validation and sanitization.Refactoring to use
Checksumclass:app/models/storage_tables/blob.rb: Refactored methods to use theChecksumclass for checksum operations, such as setting, getting, and finding by checksum. [1] [2] [3]lib/storage_tables/service/disk_service.rb: Updated methods to use theChecksumclass for path generation and file matching. Removed therefactored_checksummethod as it is now handled by theChecksumclass. [1] [2] [3]Test updates:
test/controllers/disk_controller_test.rb: Modified tests to use theChecksumclass for generating and comparing checksums. [1] [2]test/models/attachment_test.rb: Updated tests to use theChecksumclass for creating checksums and verifying paths. [1] [2]test/models/blob_test.rb: Refactored tests to use theChecksumclass for checksum operations. [1] [2] [3]test/models/checksum_test.rb: Added new tests for theChecksumclass to verify its functionality and edge cases.test/service/disk_service_test.rb: Updated tests to use theChecksumclass for generating and verifying checksums. [1] [2]test/service/shared_service_tests.rb: Refactored shared service tests to use theChecksumclass for checksum operations. [1] [2] [3] [4]