Skip to content

Conversation

DengY11
Copy link
Contributor

@DengY11 DengY11 commented Sep 23, 2025

This change implements the missing Pipeline , TxPipelined , and Command methods on the redis.Redis type. This ensures that *redis.Redis satisfies the redisNode interface.

close #5175

Copy link

codecov bot commented Sep 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@kevwan kevwan added this to the v1.9.2 milestone Sep 27, 2025
@kevwan kevwan requested review from kevwan and Copilot September 27, 2025 14:23
Copy link
Contributor

@Copilot 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

This PR implements the missing Pipeline, TxPipelined, and Command methods on the redis.Redis type to ensure it fully satisfies the redisNode interface, addressing issue #5175.

Key changes:

  • Added three new methods (Pipeline, TxPipelined, Command) to the Redis struct
  • Added a new type alias CommandsInfoCmd for the redis command info result
  • Updated and expanded test coverage for the new pipeline and command functionality

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
core/stores/redis/redis.go Implements the three missing interface methods and adds CommandsInfoCmd type alias
core/stores/redis/redis_test.go Replaces old TxPipeline test with comprehensive tests for all three new methods including error cases

}

// Command is the implementation of redis command command.
func (s *Redis) Command(ctx context.Context) *CommandsInfoCmd {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any scenario that we need to run command in services?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there any scenario that we need to run command in services?

Maybe we don't have a specific use case for this method, it was added to fully implement the required interface.

Copy link
Contributor

Choose a reason for hiding this comment

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

What if we remove this method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What if we remove this method?

then Redis doesn't fully implement the RedisNode interface, methods like Blpop , BlpopCtx , and BlpopEx cannot accept Redis as parameters.

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.

redis.Redis didn't implement redisNode interface
2 participants