-
Notifications
You must be signed in to change notification settings - Fork 29
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
New Commit Hash Algorithm #120
Merged
Merged
Conversation
This file contains 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
…nable degree at the low end. Just need to make sure that all the higher level calling functions are updated to refspec the new returns. Rather than just returning the raw bytes, we return the digest of the uncompressed bytes alongside them
… by adding special case to verification method
Codecov Report
@@ Coverage Diff @@
## master #120 +/- ##
==========================================
+ Coverage 92.09% 92.12% +0.03%
==========================================
Files 59 60 +1
Lines 9859 9973 +114
Branches 990 993 +3
==========================================
+ Hits 9079 9187 +108
- Misses 568 574 +6
Partials 212 212
|
rlizzo
added
the
Awaiting Review
Author has determined PR changes area nearly complete and ready for formal review.
label
Sep 6, 2019
Hey @hhsecond I fixed up the bugs. this is ready to be merged. Can you give it a once over as a sanity check? |
hhsecond
approved these changes
Sep 10, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Awaiting Review
Author has determined PR changes area nearly complete and ready for formal review.
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.
Motivation and Context
Why is this change required? What problem does it solve?:
This method fixes some legacy behavior which was used in order to calculate commit hashs. The current implementation calculates the hash of commit record contents based on the compressed and binary packed (via
msgpack
) lmdbref
value. This is undesireable as we are not calculating the digest based on some intrinsic (and inspectable) hangar record format, but the output of two dependent libraries.In addition, verification of record integrity is rather lacking in the current implemenation, this is addressed as well.
Description
Describe your changes in detail:
Digests are now calculated based on each lmdb key/value pair (for every record in the commit), The final digest is calculated from hashing each of these digests.
Upon checkout, we verify that the stored record data matches the expected commit hash, and will raise an exception warning of disk issues if it does not match.
This is a WIP at the time of submission, and there are still a few issues to iron out. This is a breaking change to repositories written in any previous version of hangar.
Types of changes
What types of changes does your code introduce? Put an
x
in all the boxes that apply:Is this PR ready for review, or a work in progress?
How Has This Been Tested?
Put an
x
in the boxes that apply:Checklist: