Skip to content

Fix typo in store_valkey.go: stingsSliceResults to stringSliceResults#357

Open
zlong928 wants to merge 1 commit into
volcano-sh:mainfrom
zlong928:fix-typos-store-valkey
Open

Fix typo in store_valkey.go: stingsSliceResults to stringSliceResults#357
zlong928 wants to merge 1 commit into
volcano-sh:mainfrom
zlong928:fix-typos-store-valkey

Conversation

@zlong928
Copy link
Copy Markdown

…alkey.go

What type of PR is this?

/kind cleanup
What this PR does / why we need it:
Fix typo stingsSliceResults to stringSliceResults in store_valkey.go.
Which issue(s) this PR fixes:
Fixes #345

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

Copilot AI review requested due to automatic review settings May 21, 2026 17:11
@volcano-sh-bot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign yaozengzeng for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@volcano-sh-bot
Copy link
Copy Markdown
Contributor

Welcome @zlong928! It looks like this is your first PR to volcano-sh/agentcube 🎉

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a variable name typo in the Valkey store implementation (pkg/store/store_valkey.go) to improve code clarity and avoid confusion when working with MGET string slice results.

Changes:

  • Rename stingSliceResults to stringSliceResults in loadSandboxesBySessionIDs.

Copy link
Copy Markdown
Contributor

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

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 corrects a typo by renaming the variable "stingSliceResults" to "stringSliceResults" within the loadSandboxesBySessionIDs function in pkg/store/store_valkey.go. A review comment suggests improving the validation logic for the Valkey MGet operation by checking for an exact match between the number of results and the number of keys requested, rather than just checking if the result count is greater than the key count.

Comment thread pkg/store/store_valkey.go
Comment on lines +119 to +120
if len(stringSliceResults) > len(sessionIDKeys) {
return nil, fmt.Errorf("unexpected MGet result size: %d, param size: %d", len(stringSliceResults), len(sessionIDKeys))
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.

medium

The condition len(stringSliceResults) > len(sessionIDKeys) is insufficient. In Valkey/Redis, the MGET command always returns exactly one result for each key provided, including nil for non-existent keys. Therefore, the length of the result slice should be exactly equal to the number of keys requested. Any discrepancy (either more or fewer results) indicates an unexpected state or protocol error. Using != ensures that the mapping between results and session IDs remains consistent.

Suggested change
if len(stringSliceResults) > len(sessionIDKeys) {
return nil, fmt.Errorf("unexpected MGet result size: %d, param size: %d", len(stringSliceResults), len(sessionIDKeys))
if len(stringSliceResults) != len(sessionIDKeys) {
return nil, fmt.Errorf("unexpected MGet result size: %d, param size: %d", len(stringSliceResults), len(sessionIDKeys))

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 21, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.60%. Comparing base (524e55e) to head (b82625c).
⚠️ Report is 75 commits behind head on main.

Files with missing lines Patch % Lines
pkg/store/store_valkey.go 60.00% 1 Missing and 1 partial ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #357      +/-   ##
==========================================
+ Coverage   47.57%   49.60%   +2.03%     
==========================================
  Files          30       30              
  Lines        2819     2885      +66     
==========================================
+ Hits         1341     1431      +90     
+ Misses       1338     1301      -37     
- Partials      140      153      +13     
Flag Coverage Δ
unittests 49.60% <60.00%> (+2.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@FAUST-BENCHOU
Copy link
Copy Markdown
Contributor

@zlong928 Pls add your DCO when commit

@FAUST-BENCHOU
Copy link
Copy Markdown
Contributor

…alkey.go

Signed-off-by: zlong928 <xihuanwenbaoabo@gmail.com>
@zlong928 zlong928 force-pushed the fix-typos-store-valkey branch from 527c5e0 to b82625c Compare May 22, 2026 02:20
@FAUST-BENCHOU
Copy link
Copy Markdown
Contributor

/lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Typo error stingSliceResults in store_valkey.go

5 participants