-
Notifications
You must be signed in to change notification settings - Fork 249
chore: Query blobs in batches #2480
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
Conversation
|
The latest Buf updates on your PR. Results from workflow CI and Release / buf-check (pull_request).
|
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.
Summary of Changes
Hello @alpe, 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 introduces a significant optimization to the blob retrieval process by implementing batched queries. This change aims to enhance the efficiency and robustness of data access, particularly when handling numerous blob IDs, and also improves the clarity of error messages related to these operations.
Highlights
- Blob Retrieval Optimization: The
RetrieveWithHelpersfunction has been refactored to fetch blobs in batches of 100 IDs. This change replaces a single large query with multiple smaller, batched queries, which can improve performance and stability when dealing with a large number of blob identifiers. - Enhanced Error Reporting: Error messages generated during blob retrieval now include the specific batch range (e.g.,
batch 0-1) that failed. This provides more granular information for debugging issues related to partial blob retrieval failures.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| 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 issue 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 is currently in preview and 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 to provide feedback.
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
-
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. ↩
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.
Code Review
This pull request introduces batching for blob retrieval to improve efficiency when handling a large number of blobs. I've identified a few areas for improvement, including addressing a potential compilation issue with the min function on older Go versions, using a named constant for the batch size, and correcting a typo in a test case.
| } | ||
| } | ||
| // 2. Get Blobs using the retrieved IDs in batches | ||
| batchSize := 100 |
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.
types/da_test.go
Outdated
| getBlobsErr: errors.New("network error during blob retrieval"), | ||
| expectedCode: coreda.StatusError, | ||
| expectedErrMsg: "failed to get blobs: network error during blob retrieval", | ||
| expectedErrMsg: "ailed to get blobs for batch 0-1: network error during blob retrieval", |
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.
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.
not sure how the test currently passes with this typo, worth looking into
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2480 +/- ##
==========================================
- Coverage 73.05% 73.04% -0.01%
==========================================
Files 68 68
Lines 6542 6548 +6
==========================================
+ Hits 4779 4783 +4
- Misses 1364 1366 +2
Partials 399 399
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Manav-Aggarwal
left a comment
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.
LGTM mostly, just a small typo that needs fixing
types/da_test.go
Outdated
| getBlobsErr: errors.New("network error during blob retrieval"), | ||
| expectedCode: coreda.StatusError, | ||
| expectedErrMsg: "failed to get blobs: network error during blob retrieval", | ||
| expectedErrMsg: "ailed to get blobs for batch 0-1: network error during blob retrieval", |
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.
not sure how the test currently passes with this typo, worth looking into
|
Claude finished @alpe's task —— View job Code Review CompleteReviewing PR: "Query blobs in batches" Todo List:
OverviewThis PR implements blob retrieval batching in the Issues Identified🚨 Critical Issues
|
|
The test passed because it was a |
tac0turtle
left a comment
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.
utACK
|
Claude finished @alpe's task —— View job Code Review CompleteReviewing PR: "Query blobs in batches" Todo List:
OverviewThis PR implements blob retrieval batching in the Issues Identified🚨 Critical Issues
|
max 100
Overview