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

Add cas command #72

Merged
merged 9 commits into from Dec 23, 2019
Merged

Add cas command #72

merged 9 commits into from Dec 23, 2019

Conversation

@letmutx
Copy link
Collaborator

letmutx commented Dec 15, 2019

Fixes #47

Haven't yet tested, I'll add tests soon.

@codecov-io
Copy link

codecov-io commented Dec 15, 2019

Codecov Report

Merging #72 into master will decrease coverage by 0.46%.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #72      +/-   ##
=========================================
- Coverage   55.86%   55.4%   -0.47%     
=========================================
  Files          11      11              
  Lines         571     583      +12     
=========================================
+ Hits          319     323       +4     
- Misses        252     260       +8
Impacted Files Coverage Δ
src/protocol/binary_packet.rs 83.11% <ø> (+1.06%) ⬆️
src/client.rs 94.52% <ø> (ø) ⬆️
src/protocol/mod.rs 83.33% <ø> (ø) ⬆️
src/lib.rs 0% <ø> (ø) ⬆️
src/value.rs 54.54% <ø> (ø) ⬆️
src/protocol/ascii.rs 0% <0%> (ø) ⬆️
src/protocol/binary.rs 77.9% <100%> (+1.07%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 66bd967...98b49e4. Read the comment docs.

@letmutx letmutx force-pushed the letmutx:add-cas-command branch 2 times, most recently from bbf4c5b to 94106e6 Dec 16, 2019
@letmutx
Copy link
Collaborator Author

letmutx commented Dec 16, 2019

@aisk Please review when you get a chance!

@letmutx letmutx changed the title WIP: Add cas command Add cas command Dec 16, 2019
@aisk
Copy link
Owner

aisk commented Dec 17, 2019

Thanks @letmutx ! I'll review this as soon as posible!

@letmutx
Copy link
Collaborator Author

letmutx commented Dec 20, 2019

@aisk Just a heads up - please do not merge this yet. I added more tests and a particular test is failing. I am debugging. Will try and fix over the weekend.

@letmutx letmutx force-pushed the letmutx:add-cas-command branch from 94106e6 to d259b21 Dec 21, 2019
@letmutx
Copy link
Collaborator Author

letmutx commented Dec 21, 2019

@aisk Fixed now. Should be good to review.

@letmutx
Copy link
Collaborator Author

letmutx commented Dec 21, 2019

The failing test is because of a debug_assert! I added in parse_header_only_response. In some cases, a body can follow after a store command. (for ex: when using cas, add, replace commands, if the key doesn't exist, an error string follows after the response header)

There are no tests for these cases. We should handle them in a different issue. I will remove the debug_assert and add an issue.

@aisk
Copy link
Owner

aisk commented Dec 21, 2019

Hi sorry late for the review, I'm a little busy these days.

I saw you added a FromMemcacheValueExt trait which implements FromMemcacheValue, and the origin FromMemcacheValue trait is not directly used now. Can we merge the two trait into one and keep the old name? Or do you have some other consideration?

src/protocol/mod.rs Outdated Show resolved Hide resolved
@letmutx
Copy link
Collaborator Author

letmutx commented Dec 21, 2019

The Ext trait is to keep backwards compatibility. Because the definition of from_memcache_value changes in the new trait, users who have implemented the trait for their custom types would've had to implement the new trait.

But because there is a blanket impl of FromMemcacheValueExtfor all types which implement FromMemcacheValue, they no longer need to do that.

@aisk
Copy link
Owner

aisk commented Dec 22, 2019

Yes you are right, sorry I don't considered the backwards compatibility issue. We shoul keep it, thanks @letmutx

@aisk
Copy link
Owner

aisk commented Dec 22, 2019

Hi @letmutx I approved this PR, except I want to remove the CasID type as mentioned above. I think maybe we should add a type or trait some day if we have a chance to refactor the API.

And can you rebase the master branch since there are some changes. Seems there was no conflict but I think a rebase with CI test is needed.

Really thanks @letmutx 👍

@letmutx letmutx force-pushed the letmutx:add-cas-command branch from 3e71efe to 98b49e4 Dec 22, 2019
@letmutx
Copy link
Collaborator Author

letmutx commented Dec 22, 2019

Thanks for the review.

@letmutx
Copy link
Collaborator Author

letmutx commented Dec 23, 2019

@aisk rebased and pushed the changes. good to merge now, i think.

@aisk
aisk approved these changes Dec 23, 2019
@aisk aisk merged commit 9f862bf into aisk:master Dec 23, 2019
1 of 3 checks passed
1 of 3 checks passed
codecov/patch 33.33% of diff hit (target 55.86%)
Details
codecov/project 55.4% (-0.47%) compared to 66bd967
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@aisk
Copy link
Owner

aisk commented Dec 23, 2019

@letmutx merged, thanks!

@letmutx letmutx deleted the letmutx:add-cas-command branch Dec 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants
You can’t perform that action at this time.