Make it harder to mistake deletions for legitimate writes in commit hooks#1221
Merged
achamayou merged 7 commits intomicrosoft:masterfrom May 28, 2020
Merged
Make it harder to mistake deletions for legitimate writes in commit hooks#1221achamayou merged 7 commits intomicrosoft:masterfrom
achamayou merged 7 commits intomicrosoft:masterfrom
Conversation
|
distinct_deletes2@8746 aka 20200527.21 vs master ewma over 50 builds from 8546 to 8743 |
achamayou
reviewed
May 27, 2020
achamayou
reviewed
May 27, 2020
achamayou
reviewed
May 27, 2020
achamayou
reviewed
May 27, 2020
achamayou
approved these changes
May 27, 2020
63156a9 to
e305b76
Compare
jumaffre
approved these changes
May 27, 2020
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.

Fixes #1208.
The value type in a
Writeis nowstd::optional<V>instead ofVersionV<V>. The version was supposed to beNoVersionto indicate a deletion, but all of our own hooks were ignoringversionand accessingvaluedirectly. assuming it was a real written value. This is a breaking API change - even if you want to ignore the possibility of deletions, you now need to access the actual values by.value()(preferably gated by a check to.has_value(),) not.value.Our hooks don't expect deletions and don't have anything sensible to do if they do occur, so they all simply throw an exception. It would be nice to have this expectation statically enforced (some kind of
NoRemovalsmodifier type for akv::Map, which returnedTxViews with noremovemethod, and whoseWritetype could store values directly), but this is an unnecessary extra bit of machinery for now.