Skip to content

Conversation

@joshlf
Copy link
Member

@joshlf joshlf commented Jan 21, 2026

  • Move most top-level derive code into modules under a new top-level
    derive module
  • Move some utilities into util
  • Leave the root module to primarily perform routing and scaffolding

Latest Update: v7 — Compare vs v6

📚 Full Patch History

Links show the diff between the row version and the column version.

Version v6 v5 v4 v3 v2 v1 Base
v7 vs v6 vs v5 vs v4 vs v3 vs v2 vs v1 vs Base
v6 vs v5 vs v4 vs v3 vs v2 vs v1 vs Base
v5 vs v4 vs v3 vs v2 vs v1 vs Base
v4 vs v3 vs v2 vs v1 vs Base
v3 vs v2 vs v1 vs Base
v2 vs v1 vs Base
v1 vs Base

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @joshlf, 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 undertakes a substantial internal refactoring of the zerocopy-derive crate. The primary goal is to improve the codebase's modularity and maintainability by organizing derive macro implementations into a more structured hierarchy. This change centralizes shared utilities and simplifies the main entry point, making the project easier to navigate and extend in the future.

Highlights

  • Module Restructuring: The zerocopy-derive crate has been significantly refactored, moving most top-level derive code into a new derive module with dedicated sub-modules for each trait implementation.
  • Utility Consolidation: Common utility functions, enums, and helper structs (like PaddingCheck, Trait, and ImplBlockBuilder) have been moved and consolidated into src/util.rs for better organization.
  • Centralized Routing: The main lib.rs file now primarily handles routing and scaffolding for the derive macros, delegating the core logic to the newly created derive sub-modules.
  • Renamed File: The src/enum.rs file has been renamed to src/derive/try_from_bytes.rs, reflecting its new focus and location within the refactored structure.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

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

  1. 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.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 is a work-in-progress that refactors the zerocopy-derive crate by moving derive logic into a new derive module. This is a great step towards better organization and maintainability. The code has been moved logically into different files under the new module. My main feedback is to improve the naming consistency of the newly created derive functions for better long-term maintenance.

@codecov-commenter
Copy link

codecov-commenter commented Jan 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.90%. Comparing base (1a44860) to head (9363bd4).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2901   +/-   ##
=======================================
  Coverage   91.90%   91.90%           
=======================================
  Files          20       20           
  Lines        5877     5877           
=======================================
  Hits         5401     5401           
  Misses        476      476           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@joshlf joshlf force-pushed the G9c0c3d07b59c78d561a16ab42bfe6eacaadd7156 branch from c97f53b to f8434d8 Compare January 21, 2026 18:28
@joshlf joshlf force-pushed the Gf40a4d73de475b2aae089e5e2d4cea53dd3c868c branch 3 times, most recently from 70f0813 to e903413 Compare January 21, 2026 18:43
@joshlf
Copy link
Member Author

joshlf commented Jan 21, 2026

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 is a large but well-executed refactoring of the zerocopy-derive crate. It moves derive logic from lib.rs into a new derive module with a clearer structure, which significantly improves code organization and maintainability. The logic appears to be preserved correctly throughout the move. I've found one issue in the test setup where function paths were not fully updated to reflect the new structure, which will cause test compilation to fail. Overall, this is a great improvement to the codebase.

@joshlf joshlf force-pushed the Gf40a4d73de475b2aae089e5e2d4cea53dd3c868c branch from e903413 to fa043cb Compare January 21, 2026 18:49
@joshlf joshlf changed the title [WIP][derive] Refactor into more modules [derive] Refactor into more modules Jan 21, 2026
@joshlf joshlf force-pushed the Gf40a4d73de475b2aae089e5e2d4cea53dd3c868c branch from fa043cb to 316d9ef Compare January 21, 2026 18:55
Base automatically changed from G9c0c3d07b59c78d561a16ab42bfe6eacaadd7156 to main January 21, 2026 19:26
- Move most top-level derive code into modules under a new top-level
  `derive` module
- Move some utilities into `util`
- Leave the root module to primarily perform routing and scaffolding

gherrit-pr-id: Gf40a4d73de475b2aae089e5e2d4cea53dd3c868c
@joshlf joshlf force-pushed the Gf40a4d73de475b2aae089e5e2d4cea53dd3c868c branch from 316d9ef to 9363bd4 Compare January 21, 2026 19:31
@joshlf joshlf requested a review from jswrenn January 21, 2026 20:08
@joshlf joshlf enabled auto-merge January 21, 2026 20:08
@joshlf joshlf added this pull request to the merge queue Jan 22, 2026
Merged via the queue into main with commit 021e802 Jan 22, 2026
107 of 205 checks passed
@joshlf joshlf deleted the Gf40a4d73de475b2aae089e5e2d4cea53dd3c868c branch January 22, 2026 12:58
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.

3 participants