-
Notifications
You must be signed in to change notification settings - Fork 4
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
[Bugfix] IndexInfo API moved from Agent Client to Vald Client #30
Conversation
Signed-off-by: hlts2 <[email protected]>
WalkthroughWalkthroughThe recent changes introduce a GitHub Actions workflow to automate synchronization tasks for the Vald project. Key modifications include enhanced gRPC service definitions with parameterized paths, the removal of specific RPC methods, and the addition of new message types in protocol buffers. These updates improve the API's usability and streamline service interactions, ensuring the project remains up-to-date and functional. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Server as Vald Service
Client->>Server: Request CreateIndex with pool_size
Server-->>Client: Respond with success/failure
sequenceDiagram
participant Client
participant Server as Vald Service
Client->>Server: Request GetTimestamp
Server-->>Client: Respond with NotImplementedError
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
Signed-off-by: hlts2 <[email protected]>
Signed-off-by: hlts2 <[email protected]>
Signed-off-by: hlts2 <[email protected]>
Signed-off-by: Vdaas CI <[email protected]>
Signed-off-by: hlts2 <[email protected]>
Signed-off-by: Vdaas CI <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (7)
- .github/workflows/tmp-sync.yaml (1 hunks)
- VALD_SHA (1 hunks)
- src/vald/v1/agent/core/agent_pb2.py (2 hunks)
- src/vald/v1/agent/core/agent_pb2_grpc.py (4 hunks)
- src/vald/v1/payload/payload_pb2.py (5 hunks)
- src/vald/v1/vald/object_pb2.py (2 hunks)
- src/vald/v1/vald/object_pb2_grpc.py (4 hunks)
Additional comments not posted (23)
VALD_SHA (1)
1-1
: Hash value update approved.The hash value has been updated, indicating a change in the file's content. This change is straightforward and doesn't require further analysis.
.github/workflows/tmp-sync.yaml (5)
1-24
: Header and environment variables approved.The header includes the necessary license information, and the environment variables are securely referenced.
25-46
: Job setup section approved.The steps to check out the repository, set Git config, import GPG keys, and set up the language environment are correctly defined and follow best practices.
47-53
: Repository cloning and dependency installation approved.The steps to clone the Vald repository and install dependencies are correctly defined and follow best practices.
54-62
: Proto build and SHA update section approved.The steps to build proto files and update SHA and client version are correctly defined and follow best practices.
63-76
: Commit and push section approved.The steps to commit the changes and push them to the repository are correctly defined and follow best practices.
src/vald/v1/agent/core/agent_pb2.py (3)
Line range hint
29-38
:
CreateIndex method path update approved.The
CreateIndex
method path has been updated to include a{pool_size}
variable, enhancing its flexibility. The serialized options have been updated accordingly.Tools
Ruff
26-26:
vald.v1.payload.payload_pb2
imported but unusedRemove unused import:
vald.v1.payload.payload_pb2
(F401)
42-42
: CreateAndSaveIndex method path update approved.The
CreateAndSaveIndex
method path has been updated to include a{pool_size}
variable, enhancing its flexibility. The serialized options have been updated accordingly.
44-44
: Serialized options and module scope update approved.The updates to the serialized options and module scope are consistent with the changes in the method paths.
src/vald/v1/vald/object_pb2.py (3)
43-44
: Ensure the serialized options forGetTimestamp
are correct.The serialized options for the new method
GetTimestamp
should be consistent with the existing structure.Verification successful
Serialized options for
GetTimestamp
are correct.The serialized options for the new method
GetTimestamp
are consistent with the existing structure and follow the same format as other methods within the same file and across different files.
- Verified in
src/vald/v1/vald/object_pb2.py
:
_globals['_OBJECT'].methods_by_name['GetTimestamp']._serialized_options = b'\202\323\344\223\002\026\022\024/object/meta/{id.id}'
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the serialized options for the new method `GetTimestamp`. # Test: Search for the serialized options. Expect: Only occurrences of the new method's options. rg --type python -A 5 $'_serialized_options'Length of output: 74
Script:
#!/bin/bash # Description: Verify the serialized options for the new method `GetTimestamp`. # Test: Search for the serialized options. Expect: Only occurrences of the new method's options. rg '_serialized_options' --glob '*.py' -A 5Length of output: 103207
29-29
: Ensure the new methodGetTimestamp
is correctly integrated.The new method
GetTimestamp
has been added to theObject
service. Ensure that the method is correctly integrated and follows the existing structure.Verification successful
Ensure the new method
GetTimestamp
is correctly integrated.The new method
GetTimestamp
has been added to theObject
service and is correctly defined insrc/vald/v1/vald/object_pb2_grpc.py
. However, it is currently not implemented, which is consistent with the initial stages of adding a new method.
src/vald/v1/vald/object_pb2_grpc.py
:GetTimestamp
method is defined but not yet implemented.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the integration of the new method `GetTimestamp` in the `Object` service. # Test: Search for the method definition and usage. Expect: Only occurrences of the new method. rg --type python -A 5 $'def GetTimestamp'Length of output: 73
Script:
#!/bin/bash # Description: Verify the integration of the new method `GetTimestamp` in the `Object` service. # Step 1: Find all Python files in the repository. fd --type f --extension py > python_files.txt # Step 2: Search for the `GetTimestamp` method definition within the found Python files. xargs rg 'def GetTimestamp' < python_files.txtLength of output: 206
Script:
#!/bin/bash # Description: Review the context around the `GetTimestamp` method definitions. # Step 1: Display the context around the first occurrence of `GetTimestamp`. rg 'def GetTimestamp' -A 5 src/vald/v1/vald/object_pb2_grpc.pyLength of output: 582
46-46
: Update the serialized descriptor size.The serialized descriptor size has been updated to 601 bytes. Ensure that this change is consistent with the addition of the new method.
src/vald/v1/agent/core/agent_pb2_grpc.py (1)
Line range hint
1-1
:
Ensure the removal ofIndexInfo
andGetTimestamp
is correct.The methods
IndexInfo
andGetTimestamp
have been removed. Ensure that the removal is consistent and does not affect other parts of the codebase.src/vald/v1/vald/object_pb2_grpc.py (4)
231-257
: Ensure the new methodGetTimestamp
is correctly integrated in the static methods.The new method
GetTimestamp
has been added to the static methods. Ensure that the method is correctly integrated and follows the existing structure.Verification successful
The new static method
GetTimestamp
appears to be correctly integrated in thesrc/vald/v1/vald/object_pb2_grpc.py
file. The method follows the existing structure and conventions of other static methods.
Instance Method Definition:
def GetTimestamp(self, request, context): """Represent the RPC to get the vector metadata. This RPC is mainly used for index correction process """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')Static Method Definition:
def GetTimestamp(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary( request, target, '/vald.v1.Object/GetTimestamp', vald_dot_v1_dot_payload_dot_payload__pb2.Object.TimestampRequest.SerializeToString, vald_dot_v1_dot_payload_dot_payload__pb2.Object.Timestamp.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True)The static method is consistent with the existing structure of other static methods in the file.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the integration of the new method `GetTimestamp` in the static methods. # Test: Search for the method definition and usage. Expect: Only occurrences of the new method. rg --type python -A 5 $'def GetTimestamp'Length of output: 73
Script:
#!/bin/bash # Description: Verify the integration of the new method `GetTimestamp` in the static methods. # Test: Search for the method definition and usage. Expect: Only occurrences of the new method. rg -A 5 'def GetTimestamp'Length of output: 978
38-42
: Ensure the new methodGetTimestamp
is correctly integrated in the client stub.The new method
GetTimestamp
has been added to the client stub. Ensure that the method is correctly integrated and follows the existing structure.Verification successful
The new method
GetTimestamp
is correctly integrated in the client stub.The method
GetTimestamp
has been added to the client stub and follows the existing structure and conventions.
src/vald/v1/vald/object_pb2_grpc.py
: Line 38-42, 48-52Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the integration of the new method `GetTimestamp` in the client stub. # Test: Search for the method definition and usage. Expect: Only occurrences of the new method. rg --type python -A 5 $'def GetTimestamp'Length of output: 73
Script:
#!/bin/bash # Description: Verify the integration of the new method `GetTimestamp` in the client stub. # Test: Search for the method definition and usage. Expect: Only occurrences of the new method. rg --glob '*.py' -A 5 'def GetTimestamp'Length of output: 992
107-111
: Ensure the new methodGetTimestamp
is correctly registered in the RPC method handlers.The new method
GetTimestamp
has been registered in the RPC method handlers. Ensure that the method is correctly registered and follows the existing structure.Verification successful
The new method
GetTimestamp
is correctly registered in the RPC method handlers.The method
GetTimestamp
has been registered in multiple contexts, including the RPC method handlers, method definition, and serialization/deserialization processes, confirming that it follows the existing structure.
src/vald/v1/vald/object_pb2_grpc.py
: Lines 107-111- Other relevant occurrences in the codebase
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the registration of the new method `GetTimestamp` in the RPC method handlers. # Test: Search for the method registration. Expect: Only occurrences of the new method. rg --type python -A 5 $'GetTimestamp'Length of output: 67
Script:
#!/bin/bash # Description: Verify the registration of the new method `GetTimestamp` in the RPC method handlers. # Find all Python files and search for the method registration. Expect: Only occurrences of the new method. fd -e py -x rg 'GetTimestamp' -A 5 {}Length of output: 3222
77-83
: Ensure the new methodGetTimestamp
is correctly implemented in the server.The new method
GetTimestamp
has been added to the server. Ensure that the method is correctly implemented and follows the existing structure.src/vald/v1/payload/payload_pb2.py (6)
167-167
: Verify the correct usage of the new serialized options.Ensure that the new serialized options for
_OBJECT
are correctly reflected throughout the codebase.Verification successful
The new serialized options for
_OBJECT
are correctly reflected throughout the codebase.
- The serialized options for
_OBJECT
and related message types are present and consistent in thesrc/vald/v1/payload/payload_pb2.py
file.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the correct usage of the new serialized options. # Test: Search for the usage of the new serialized options in the codebase. # Expect: Only occurrences of the new serialized options for `_OBJECT`. rg --type python -A 5 $'_OBJECT'Length of output: 62
Script:
#!/bin/bash # Description: Verify the correct usage of the new serialized options. # Test: Search for the usage of the new serialized options in the codebase. # Expect: Only occurrences of the new serialized options for `_OBJECT`. rg -t py -A 5 '_OBJECT'Length of output: 10226
58-59
: Verify the correct usage of the new message type name and options.Ensure that the new name
_OBJECT_TIMESTAMPREQUEST
and its options are correctly reflected throughout the codebase.Verification successful
The new message type name
_OBJECT_TIMESTAMPREQUEST
and its options are correctly reflected throughout the codebase.
- The occurrences of
_OBJECT_TIMESTAMPREQUEST
are consistent and correctly reference its fields and serialized options.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the correct usage of the new message type name and options. # Test: Search for the usage of the new message type name in the codebase. # Expect: Only occurrences of the new message type name `_OBJECT_TIMESTAMPREQUEST`. rg --type python -A 5 $'_OBJECT_TIMESTAMPREQUEST'Length of output: 79
Script:
#!/bin/bash # Description: Verify the correct usage of the new message type name and options. # Find all Python files and search for the usage of the new message type name `_OBJECT_TIMESTAMPREQUEST`. fd -e py -x rg '_OBJECT_TIMESTAMPREQUEST' {}Length of output: 366
204-205
: Verify the correct usage of the new serialized options.Ensure that the new serialized options for
_OBJECT_LIST_RESPONSE
are correctly reflected throughout the codebase.Verification successful
The new serialized options for
_OBJECT_LIST_RESPONSE
are correctly reflected in the codebase.The search results indicate that the new serialized options are only set in
src/vald/v1/payload/payload_pb2.py
and are not used elsewhere.
src/vald/v1/payload/payload_pb2.py
: Lines 204-205Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the correct usage of the new serialized options. # Test: Search for the usage of the new serialized options in the codebase. # Expect: Only occurrences of the new serialized options for `_OBJECT_LIST_RESPONSE`. rg --type python -A 5 $'_OBJECT_LIST_RESPONSE'Length of output: 76
Script:
#!/bin/bash # Description: Verify the correct usage of the new serialized options. # Test: Search for the usage of the new serialized options in the codebase. # Expect: Only occurrences of the new serialized options for `_OBJECT_LIST_RESPONSE`. rg -A 5 '_OBJECT_LIST_RESPONSE'Length of output: 659
68-69
: Verify the correct usage of the new serialized options.Ensure that the new serialized options for
_INFO_INDEX_DETAIL_COUNTSENTRY
are correctly reflected throughout the codebase.Verification successful
The new serialized options for
_INFO_INDEX_DETAIL_COUNTSENTRY
are correctly reflected in the codebase.The updates are localized to the
src/vald/v1/payload/payload_pb2.py
file and no further issues were found.
src/vald/v1/payload/payload_pb2.py
: Lines 68-69Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the correct usage of the new serialized options. # Test: Search for the usage of the new serialized options in the codebase. # Expect: Only occurrences of the new serialized options for `_INFO_INDEX_DETAIL_COUNTSENTRY`. rg --type python -A 5 $'_INFO_INDEX_DETAIL_COUNTSENTRY'Length of output: 85
Script:
#!/bin/bash # Description: Verify the correct usage of the new serialized options. # Test: Search for the usage of the new serialized options in the codebase. # Expect: Only occurrences of the new serialized options for `_INFO_INDEX_DETAIL_COUNTSENTRY`. rg -A 5 '_INFO_INDEX_DETAIL_COUNTSENTRY'Length of output: 1471
180-183
: Verify the correct usage of the new serialized options.Ensure that the new serialized options for
_OBJECT_TIMESTAMPREQUEST
and_OBJECT_TIMESTAMP
are correctly reflected throughout the codebase.Verification successful
The new serialized options for
_OBJECT_TIMESTAMPREQUEST
and_OBJECT_TIMESTAMP
are correctly reflected in the codebase.The updated serialized options are present in the
src/vald/v1/payload/payload_pb2.py
file, confirming that the changes have been correctly applied.
src/vald/v1/payload/payload_pb2.py
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the correct usage of the new serialized options. # Test: Search for the usage of the new serialized options in the codebase. # Expect: Only occurrences of the new serialized options for `_OBJECT_TIMESTAMPREQUEST` and `_OBJECT_TIMESTAMP`. rg --type python -A 5 $'_OBJECT_TIMESTAMPREQUEST' rg --type python -A 5 $'_OBJECT_TIMESTAMP'Length of output: 152
Script:
#!/bin/bash # Description: Verify the correct usage of the new serialized options. # Test: Search for the usage of the new serialized options in the codebase. # Expect: Only occurrences of the new serialized options for `_OBJECT_TIMESTAMPREQUEST` and `_OBJECT_TIMESTAMP`. rg -t py -A 5 '_OBJECT_TIMESTAMPREQUEST' rg -t py -A 5 '_OBJECT_TIMESTAMP'Length of output: 3564
30-30
: Verify the correctness of the serialized data.Ensure that the serialized data aligns with the new message types and their corresponding serialized options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Outside diff range, codebase verification and nitpick comments (1)
src/tests/test_e2e.py (1)
Inconsistent Stub Usage:
The
test_index_info
function has been correctly updated to useindex_pb2_grpc.IndexStub
. However, there are still references toAgentStub
in the codebase that need to be updated:
src/tests/test_e2e.py:
- Line 83:
stub = agent_pb2_grpc.AgentStub(self.channel)
- Line 89:
stub = agent_pb2_grpc.AgentStub(self.channel)
Please update these references to ensure consistency.
Analysis chain
Line range hint
83-89
:
Function update looks good.The
test_index_info
function correctly usesindex_pb2_grpc.IndexStub
instead ofagent_pb2_grpc.AgentStub
. Ensure that all references toAgentStub
are updated accordingly.However, verify the function usage in the codebase to ensure consistency.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `test_index_info` match the new stub usage. # Test: Search for the function usage. Expect: Only occurrences of the new stub usage. rg --type python -A 5 $'test_index_info'Length of output: 70
Script:
#!/bin/bash # Description: Verify all function calls to `test_index_info` match the new stub usage. # Test: Search for the function usage. Expect: Only occurrences of the new stub usage. rg -t py -A 5 $'test_index_info'Length of output: 461
Script:
#!/bin/bash # Description: Verify that all references to `AgentStub` have been updated to `IndexStub`. # Test: Search for any remaining references to `AgentStub`. rg -t py 'AgentStub'Length of output: 238
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- Makefile (1 hunks)
- src/tests/test_e2e.py (2 hunks)
- src/vald/v1/vald/index_pb2.py (1 hunks)
- src/vald/v1/vald/index_pb2_grpc.py (1 hunks)
Additional context used
Ruff
src/vald/v1/vald/index_pb2.py
25-25:
google.api.annotations_pb2
imported but unusedRemove unused import:
google.api.annotations_pb2
(F401)
26-26:
vald.v1.payload.payload_pb2
imported but unusedRemove unused import:
vald.v1.payload.payload_pb2
(F401)
Additional comments not posted (11)
src/vald/v1/vald/index_pb2.py (4)
29-29
: LGTM!The descriptor pool setup is standard for generated protobuf files.
32-33
: LGTM!The message and enum descriptor building is standard for generated protobuf files.
34-42
: LGTM!The conditional block for handling descriptor options is standard for generated protobuf files.
43-43
: LGTM!The module scope insertion point comment is standard for generated protobuf files.
src/vald/v1/vald/index_pb2_grpc.py (5)
1-6
: LGTM!The file header and imports are standard for generated gRPC Python files.
8-27
: LGTM!The
IndexStub
class and its methods are standard for generated gRPC Python files.
30-46
: LGTM!The
IndexServicer
class and its methods are standard for generated gRPC Python files.
49-65
: LGTM!The
add_IndexServicer_to_server
function is standard for generated gRPC Python files.
68-125
: LGTM!The
Index
class and its methods are standard for generated gRPC Python files.Makefile (1)
52-52
: LGTM!The new entry for
v1/vald/index.proto
has been correctly added to the list of protocol buffer definitions.src/tests/test_e2e.py (1)
13-13
: Import statement looks good.The import statement for
index_pb2_grpc
is correctly added and necessary for the functionality.
Signed-off-by: hlts2 <[email protected]>
As titled
Summary by CodeRabbit
New Features
GetTimestamp
method in the Object service, allowing retrieval of timestamp metadata associated with objects.Index
gRPC service, including methods forIndexInfo
andIndexDetail
.Bug Fixes
IndexInfo
andGetTimestamp
RPC methods from the Agent service, streamlining functionality.Refactor
CreateIndex
andCreateAndSaveIndex
methods to include a dynamic{pool_size}
parameter.