node-redis icon indicating copy to clipboard operation
node-redis copied to clipboard

Support ZRANK and ZREVRANK: Added the optional WITHSCORE argument

Open codrin-ch opened this issue 2 years ago • 6 comments

Description

Describe your pull request here


Checklist

  • [ ] Does npm test pass with this change (including linting)?
  • [ ] Is the new or changed code fully tested?
  • [ ] Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?

fix https://github.com/redis/node-redis/issues/2463 and https://github.com/redis/node-redis/issues/2464

codrin-ch avatar Apr 29 '23 11:04 codrin-ch

@codrin-ch thanks for contributing! The WITHSCORE argument should be implemented as a separate command since it has other return type (ZRANK_WITHSCORE and ZREVRANK_WITHSCORE). See ZDIFF_WITHSCORES for example.

leibale avatar Apr 29 '23 17:04 leibale

Codecov Report

Patch coverage: 83.33% and project coverage change: -0.08% :warning:

Comparison is base (a217cc1) 95.71% compared to head (25939e5) 95.64%. Report is 1 commits behind head on master.

:exclamation: Current head 25939e5 differs from pull request most recent head d2dbea6. Consider uploading reports for the commit d2dbea6 to get more accurate results

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2489      +/-   ##
==========================================
- Coverage   95.71%   95.64%   -0.08%     
==========================================
  Files         458      460       +2     
  Lines        4531     4543      +12     
  Branches      506      506              
==========================================
+ Hits         4337     4345       +8     
- Misses        127      131       +4     
  Partials       67       67              
Files Changed Coverage Δ
packages/client/lib/commands/ZRANK_WITHSCORE.ts 80.00% <80.00%> (ø)
packages/client/lib/commands/ZREVRANK_WITHSCORE.ts 80.00% <80.00%> (ø)
packages/client/lib/cluster/commands.ts 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Apr 30 '23 21:04 codecov-commenter

I think the coverage missing is due to the redis version from the testing cluster. The tests have the min version 7.2 and as a result I suspect that the tests are skipped for the new functions

codrin-ch avatar May 01 '23 07:05 codrin-ch

@codrin-ch this is exactly what is happening. I'll add Redis 7.2 to the tests matrix soon.

leibale avatar May 01 '23 07:05 leibale

@codrin-ch sorry for the long delay, but looks like the tests are failing (you can ignore the "ACL GETUSER" test, but:

  1. "client.zRankWithScore empty response"
  2. "client.zRankWithScore"
  3. "client.zRevRankWithScore empty response"
  4. "client.zRevRankWithScore" are all failing...

https://github.com/redis/node-redis/actions/runs/5037516252/jobs/9034411168?pr=2489#step:7:2430

If you don't have time to work on it, I'll take it from here and finish it, just let me know.. :)

leibale avatar May 24 '23 10:05 leibale

Can something be done to finish this?

TarSzator avatar Feb 14 '24 09:02 TarSzator