Skip to content

valkey - feat: adding in getMany, setMany, deleteMany, etc#1877

Merged
jaredwray merged 8 commits into
mainfrom
valkey---feat-adding-in-getMany,-setMany,-deleteMany,-etc
Mar 3, 2026
Merged

valkey - feat: adding in getMany, setMany, deleteMany, etc#1877
jaredwray merged 8 commits into
mainfrom
valkey---feat-adding-in-getMany,-setMany,-deleteMany,-etc

Conversation

@jaredwray

@jaredwray jaredwray commented Mar 3, 2026

Copy link
Copy Markdown
Owner

Please check if the PR fulfills these requirements

  • Followed the Contributing and Code of Conduct guidelines.
  • Tests for the changes have been added (for bug fixes/features) with 100% code coverage.

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
valkey - feat: adding in getMany, setMany, deleteMany, etc

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the KeyvValkey adapter by introducing new batch processing capabilities. These additions allow users to perform multiple set, delete, or existence checks in a single operation, leading to more efficient interactions with the Valkey store. The changes include both the implementation of these methods and comprehensive testing to ensure their reliability and correctness.

Highlights

  • New Batch Operations: Introduced setMany, deleteMany, and hasMany methods to allow for efficient batch operations on the Valkey store.
  • Optimized deleteMany: The deleteMany method was refactored to leverage Valkey's multi and unlink commands for improved performance during batch deletions.
  • Comprehensive Testing: Added extensive test cases for the new batch methods, covering various scenarios including TTLs, empty inputs, undefined values, and useSets functionality.
  • Documentation Updates: The README.md was updated to include documentation and examples for the newly added setMany and hasMany methods, and the deleteMany description was refined.
Changelog
  • storage/valkey/README.md
    • Added setMany and hasMany methods to the list of available methods.
    • Updated the description for deleteMany to clarify its batch operation and return value.
    • Included detailed documentation and code examples for setMany and hasMany.
    • Reordered the clear() method entry for better logical flow.
  • storage/valkey/src/index.ts
    • Implemented the setMany method for batch setting of key-value pairs, supporting optional TTLs and useSets.
    • Refactored the deleteMany method to use Valkey's multi and unlink commands for atomic batch deletion.
    • Implemented the hasMany method for batch checking the existence of multiple keys, returning an array of booleans.
  • storage/valkey/test/test.ts
    • Added new test suites for setMany, including tests for setting multiple keys, TTL expiration, empty input, and skipping undefined values.
    • Included tests for setMany functionality when useSets is enabled.
    • Added new test suites for hasMany, covering checks for existing and non-existing keys, and handling empty input.
    • Added new test suites for deleteMany, verifying batch deletion, handling non-existent keys, empty input, and useSets integration.
Activity
  • No specific human activity (comments, reviews) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d79be472e7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread storage/valkey/src/index.ts Outdated
Comment thread storage/valkey/src/index.ts Outdated
Comment thread storage/valkey/src/index.ts Outdated
@codecov

codecov Bot commented Mar 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.96%. Comparing base (d7419cf) to head (a9add3e).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #1877    +/-   ##
========================================
  Coverage   99.96%   99.96%            
========================================
  Files          32       32            
  Lines        2817     2918   +101     
  Branches      493      516    +23     
========================================
+ Hits         2816     2917   +101     
  Misses          1        1            

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces batch operations like setMany, deleteMany, and hasMany to the Valkey storage adapter, along with corresponding documentation and tests. However, a critical security vulnerability was identified: the implementation of namespace isolation is broken when the useSets option is enabled, potentially leading to cross-tenant data leakage. Additionally, the hasMany method lacks proper error handling for transaction results, which can result in false positives for key existence checks. Beyond security, there are also opportunities to improve the performance of deleteMany and hasMany by using more efficient Redis commands for batch operations.

Comment thread storage/valkey/src/index.ts Outdated
Comment thread storage/valkey/src/index.ts Outdated
Comment thread storage/valkey/src/index.ts Outdated
Comment thread storage/valkey/src/index.ts Outdated
@jaredwray jaredwray merged commit e5d0f03 into main Mar 3, 2026
8 checks passed
@jaredwray jaredwray deleted the valkey---feat-adding-in-getMany,-setMany,-deleteMany,-etc branch March 3, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant