Skip to content
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

Backport PR #2778 to release/v1.7 for Fix format of proto files #2783

Conversation

vdaas-ci
Copy link
Collaborator

@vdaas-ci vdaas-ci commented Dec 17, 2024

Description

SSIA

Related Issue

Versions

  • Vald Version: v1.7.15
  • Go Version: v1.23.4
  • Rust Version: v1.83.0
  • Docker Version: v27.4.0
  • Kubernetes Version: v1.31.4
  • Helm Version: v3.16.3
  • NGT Version: v2.3.5
  • Faiss Version: v1.9.0

Checklist

Special notes for your reviewer

Summary by CodeRabbit

  • Documentation
    • Enhanced readability of comments and troubleshooting sections across various services, including Filter, Index, Insert, Object, Remove, Search, Update, and Upsert.
    • Added structured tables for error scenarios and resolutions in the Insert, Remove, and Upsert services.
    • Included notices regarding gRPC message size limitations in multiple methods to guide users effectively.

Copy link

cloudflare-workers-and-pages bot commented Dec 17, 2024

Deploying vald with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5f8aca7
Status: ✅  Deploy successful!
Preview URL: https://922f6a76.vald.pages.dev
Branch Preview URL: https://backport-release-v1-7-refact-vjnl.vald.pages.dev

View logs

Copy link
Contributor

coderabbitai bot commented Dec 17, 2024

📝 Walkthrough

Walkthrough

This pull request focuses on documentation improvements across multiple Protobuf files in the apis/proto/v1/vald directory. The changes primarily involve enhancing comments, adding HTML notices about gRPC message size limitations, and improving the clarity of troubleshooting sections for various service methods. The modifications are purely documentation-related and do not alter the functionality or signatures of any RPC methods across filter, index, insert, object, remove, search, update, and upsert services.

Changes

File Change Summary
apis/proto/v1/vald/filter.proto Added HTML notices and refined comments for RPC methods
apis/proto/v1/vald/index.proto Removed unnecessary blank lines between service method definitions
apis/proto/v1/vald/insert.proto Enhanced troubleshooting comments with structured error explanations
apis/proto/v1/vald/object.proto Improved formatting and clarity of method comments
apis/proto/v1/vald/remove.proto Added detailed error handling and troubleshooting comments
apis/proto/v1/vald/search.proto Added gRPC message size limitation notices and improved error documentation
apis/proto/v1/vald/update.proto Enhanced comments with formatting and clarifications
apis/proto/v1/vald/upsert.proto Improved documentation with clearer error handling explanations

Possibly related PRs

Suggested labels

priority/low, type/refactoring, size/S, area/tools/cli/loadtest, area/gateway/lb, area/gateway/filter, actions/backport/release/v1.7, area/gateway/mirror, area/index/job/correction, area/index/job/creation, area/index/job/save, area/index/job/readreplica

Suggested reviewers

  • vankichi
  • kpango

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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@vdaas-ci
Copy link
Collaborator Author

[CHATOPS:HELP] ChatOps commands.

  • 🙆‍♀️ /approve - approve
  • 🍱 /format - format codes and add licenses
  • /gen-test - generate test codes
  • 🏷️ /label - add labels
  • 🔚 2️⃣ 🔚 /label actions/e2e-deploy - run E2E deploy & integration test

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

🧹 Nitpick comments (5)
apis/proto/v1/vald/index.proto (1)

Line range hint 1-62: Note regarding static analysis suggestions

The static analysis tool suggests using more specific request/response message types instead of Empty. However, since:

  1. This is a backport PR
  2. The use of Empty message is an established pattern in this codebase
  3. Changing message types would be a breaking change

We should maintain consistency with the existing codebase structure.

🧰 Tools
🪛 buf (1.47.2)

34-36: "payload.v1.Empty" is used as the request or response type for multiple RPCs.

(RPC_REQUEST_RESPONSE_UNIQUE)


34-34: RPC request type "Empty" should be named "IndexInfoRequest" or "IndexIndexInfoRequest".

(RPC_REQUEST_STANDARD_NAME)


34-34: RPC response type "Count" should be named "IndexInfoResponse" or "IndexIndexInfoResponse".

(RPC_RESPONSE_STANDARD_NAME)


40-42: "payload.v1.Empty" is used as the request or response type for multiple RPCs.

(RPC_REQUEST_RESPONSE_UNIQUE)


40-40: RPC request type "Empty" should be named "IndexDetailRequest" or "IndexIndexDetailRequest".

(RPC_REQUEST_STANDARD_NAME)


40-40: RPC response type "Detail" should be named "IndexDetailResponse" or "IndexIndexDetailResponse".

(RPC_RESPONSE_STANDARD_NAME)


46-46: RPC request type "Empty" should be named "IndexStatisticsRequest" or "IndexIndexStatisticsRequest".

(RPC_REQUEST_STANDARD_NAME)


46-46: RPC response type "Statistics" should be named "IndexStatisticsResponse" or "IndexIndexStatisticsResponse".

(RPC_RESPONSE_STANDARD_NAME)

apis/proto/v1/vald/update.proto (1)

Line range hint 137-146: TODO placeholders need to be addressed in UpdateTimestamp method.

The Status Code and Troubleshooting sections contain TODO placeholders. This affects the completeness of the API documentation.

Would you like me to help generate the missing documentation sections for the UpdateTimestamp method? I can create a new GitHub issue to track this task.

apis/proto/v1/vald/search.proto (1)

Line range hint 387-387: Remove extra forward slash in comment.

There's an extra forward slash in the comment that could affect documentation rendering.

-  // // ---
+  // ---
apis/proto/v1/vald/remove.proto (2)

Line range hint 65-89: Fix table formatting in troubleshooting section.

The table formatting is inconsistent in line 89. The closing cell marker is missing.

Apply this fix:

- // | INTERNAL          | Target Vald cluster or network route has some critical error.                                   | Check target Vald cluster first and check network route including ingress as second.
+ // | INTERNAL          | Target Vald cluster or network route has some critical error.                                   | Check target Vald cluster first and check network route including ingress as second.     |
🧰 Tools
🪛 buf (1.47.2)

90-90: RPC request type "TimestampRequest" should be named "RemoveByTimestampRequest" or "RemoveRemoveByTimestampRequest".

(RPC_REQUEST_STANDARD_NAME)


90-90: RPC response type "Locations" should be named "RemoveByTimestampResponse" or "RemoveRemoveByTimestampResponse".

(RPC_RESPONSE_STANDARD_NAME)


Line range hint 130-149: Consider enhancing the message size limitation notice.

While the notice about gRPC message size limitations is valuable, it could be more helpful by including specific details.

Consider expanding the notice with:

  • The default message size limit
  • How to configure custom limits
  • Best practices for handling large batch operations

Example enhancement:

  // <div class="notice">
  // gRPC has a message size limitation.<br>
+ // The default maximum message size is 4MB.<br>
+ // For larger batches, consider using StreamRemove instead or configure custom limits using:<br>
+ // - Server-side: grpc.MaxRecvMsgSize()<br>
+ // - Client-side: grpc.WithMaxMsgSize()<br>
  // Please be careful that the size of the request exceeds the limit.
  // </div>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8537f27 and 5f8aca7.

📒 Files selected for processing (8)
  • apis/proto/v1/vald/filter.proto (5 hunks)
  • apis/proto/v1/vald/index.proto (1 hunks)
  • apis/proto/v1/vald/insert.proto (4 hunks)
  • apis/proto/v1/vald/object.proto (3 hunks)
  • apis/proto/v1/vald/remove.proto (7 hunks)
  • apis/proto/v1/vald/search.proto (16 hunks)
  • apis/proto/v1/vald/update.proto (4 hunks)
  • apis/proto/v1/vald/upsert.proto (4 hunks)
✅ Files skipped from review due to trivial changes (2)
  • apis/proto/v1/vald/object.proto
  • apis/proto/v1/vald/filter.proto
🧰 Additional context used
🪛 buf (1.47.2)
apis/proto/v1/vald/index.proto

40-42: "payload.v1.Empty" is used as the request or response type for multiple RPCs.

(RPC_REQUEST_RESPONSE_UNIQUE)


40-40: RPC request type "Empty" should be named "IndexDetailRequest" or "IndexIndexDetailRequest".

(RPC_REQUEST_STANDARD_NAME)


40-40: RPC response type "Detail" should be named "IndexDetailResponse" or "IndexIndexDetailResponse".

(RPC_RESPONSE_STANDARD_NAME)

🔇 Additional comments (10)
apis/proto/v1/vald/index.proto (1)

37-37: LGTM! Consistent spacing between method definitions.

The removal of extra blank lines improves the consistency of the proto file formatting.

Also applies to: 43-43

apis/proto/v1/vald/insert.proto (2)

Line range hint 47-56: LGTM! Well-structured troubleshooting documentation.

The table format provides clear and actionable guidance for error resolution.


Line range hint 93-97: LGTM! Important notice about gRPC message size limitations.

The HTML notice appropriately warns users about potential message size constraints in MultiInsert operations.

apis/proto/v1/vald/upsert.proto (1)

Line range hint 96-101: LGTM! Consistent documentation style.

The HTML notice about gRPC limitations matches the format used in insert.proto, maintaining consistency across services.

apis/proto/v1/vald/update.proto (1)

Line range hint 98-103: LGTM! Consistent documentation style.

The HTML notice about gRPC limitations matches the format used in other proto files, maintaining consistency across services.

apis/proto/v1/vald/search.proto (3)

46-48: LGTM! Well-structured troubleshooting documentation.

The added troubleshooting sections provide clear, consistent, and valuable information about common error scenarios and their resolutions across all RPC methods. The documentation will help developers quickly identify and resolve issues.

Also applies to: 78-80, 111-113, 139-141, 170-172, 206-208, 237-239, 270-272, 303-305, 331-333, 362-364, 398-400


Line range hint 153-157: LGTM! Important warning about gRPC message size limitations.

The added notices appropriately warn users about gRPC message size limitations for multi-request methods. This is crucial for preventing runtime issues when dealing with large batches of vectors.

Also applies to: 189-193, 345-349, 381-385


Line range hint 50-54: LGTM! Accurate and comprehensive error documentation.

The error descriptions and resolution steps are technically accurate, well-differentiated between vector-based and ID-based operations, and provide practical guidance for troubleshooting.

Also applies to: 82-86, 115-119, 143-147, 174-178, 210-214, 241-245, 274-278, 307-311, 335-339, 366-370, 402-406

apis/proto/v1/vald/remove.proto (2)

46-48: LGTM! Well-structured troubleshooting documentation.

The added troubleshooting section provides clear and actionable guidance for handling common error scenarios.


Line range hint 99-118: LGTM! Comprehensive streaming documentation.

The added documentation effectively explains the bidirectional streaming behavior and includes helpful links to gRPC documentation.

@vankichi vankichi merged commit 0e844ba into release/v1.7 Dec 17, 2024
178 checks passed
@vankichi vankichi deleted the backport/release/v1.7/refactor/apis/fix-api-proto-format branch December 17, 2024 06:44
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.

2 participants