Conversation
There was a problem hiding this comment.
Summary of Changes
Hello @tac0turtle, 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!
I've implemented a fix to address an issue with protobuf file inclusion within the crate. The primary goal of this change is to ensure that the crate can be built reliably, whether from source with .proto files present or from a published version where only pre-generated Rust files are available. This involves updating the crate's name in documentation and enhancing the build script to intelligently manage the generation and inclusion of protobuf-derived Rust code, making the build process more resilient and user-friendly.
Highlights
- Crate Renaming and Documentation Update: I've updated the
README.mdfile to reflect the new crate nameev-types(formerlyrollkit-types) and adjusted all related documentation, including dependency examples and descriptions, to align withEv-node. - Optimized Protobuf Generation Logic: I've modified the
build.rsscript to intelligently handle protobuf file generation. It now first checks for pre-generated.rsfiles insrc/proto. If they exist and theEV_TYPES_FORCE_PROTO_GENenvironment variable is not set, it will use these existing files, avoiding unnecessary regeneration. - Improved Proto File Inclusion Robustness: The
build.rsscript now includes robust error handling for theproto_rootpath. If the original.protosource files are not found (e.g., when building from a published crate where only generated files are needed), but the pre-generated.rsfiles are present, the build will proceed successfully, ensuring better portability and build reliability.
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 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 or fill out our survey 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. ↩
|
The latest Buf updates on your PR. Results from workflow CI and Release / buf-check (pull_request).
|
There was a problem hiding this comment.
Code Review
This pull request refactors the protobuf generation process to use pre-generated files by default, which is a good improvement for downstream users of the crate. It also adds an environment variable to force regeneration for developers. The documentation in README.md has been updated to reflect these changes. My review identified a logic flaw in the build script where the force-regeneration flag is ignored in an error-handling path. I've provided a specific suggestion to fix this to ensure the build script behaves as expected.
|
Claude finished @tac0turtle's task —— View job Code Review for Proto Inclusion FixI've analyzed the changes and here's my comprehensive review: Todo List:
OverviewThis PR implements a robust solution for proto file inclusion that allows the crate to work both from source (with .proto files) and when published to crates.io (with pre-generated files). The approach is sound and addresses a real packaging problem. Code Quality & Best Practices ✅Strengths:
Areas for improvement:
Critical Bug 🚨Issue in build.rs:28-38 - Logic flaw with force regeneration flag The Gemini Code Assist review correctly identified a significant logic bug. When Current problematic flow:
Recommended fix: Err(e) => {
if force_regen {
return Err(format!("EV_TYPES_FORCE_PROTO_GEN is set, but proto source files not found at ../../../proto: {}", e).into());
}
// If proto files don't exist but generated files do, that's ok
if messages_file.exists() && services_file.exists() {
println!("cargo:warning=Proto source files not found at ../../../proto, using pre-generated files");
return Ok(());
}
// Otherwise, this is a real error
return Err(format!("Proto files not found and no pre-generated files available: {}", e).into());
}Additional Issues1. Potential File Collision in build.rs:60-64, 74-78 Both Safer approach: // Use different output directories or filenames initially
prost_config.out_dir(&proto_dir.join("messages"));
// ... then move to final location2. Missing Error Handling for File Renames The Performance Considerations ✅
Security Considerations ✅
Test Coverage Assessment
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2515 +/- ##
=======================================
Coverage ? 73.61%
=======================================
Files ? 72
Lines ? 6716
Branches ? 0
=======================================
Hits ? 4944
Misses ? 1371
Partials ? 401
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:
|
|
tested and this works |
38dcdb0 to
9caf9e6
Compare
* main: fix: docs deployment (#2528) chore: merge docs repo into this repo (#2526) optimize: implement head index for BatchQueue.Next() to avoid O(n) slice re-slicing (#2519) build(deps): Bump github.com/rs/zerolog from 1.33.0 to 1.34.0 (#2525) chore: migrate from ipfs/go-log to zerolog across codebase (#2516) fix: proto inclusion (#2515) build(deps): Bump github.com/docker/docker from 28.2.2+incompatible to 28.3.3+incompatible in /test/docker-e2e in the go_modules group across 1 directory (#2503) refactor: replace Split in loops with more efficient SplitSeq (#2502) feat: expose ev-node P2P and RPC ports in docker compose (#2513) feat: create grpc execution environemnt (#2490)
Overview
Due to how we have the repo setup, there is an issue about including the proto files in the crate, this is a solution to fix this