Skip to content

example of Arbitrary for fuzzing,#19

Merged
isdaniel merged 4 commits intomainfrom
arbitrary-example
Feb 15, 2026
Merged

example of Arbitrary for fuzzing,#19
isdaniel merged 4 commits intomainfrom
arbitrary-example

Conversation

@isdaniel
Copy link
Owner

example for #14

@gemini-code-assist
Copy link

Summary of Changes

Hello @isdaniel, 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 dedicated fuzzing tool for the pg_walstream library. Its primary purpose is to enhance the robustness and reliability of pg_walstream by enabling comprehensive testing with a wide range of automatically generated, potentially malformed, inputs. This external tool allows for effective fuzz testing of the library's data structures and message parsing logic without adding the arbitrary crate as a direct dependency to the main library.

Highlights

  • New Fuzzing Tool Added: A new Rust project, pg-walstream-arbitrary-fuzzing, has been introduced under tools/arbitrary-fuzzing. This tool is designed to generate arbitrary instances of pg_walstream types for fuzzing purposes.
  • External Arbitrary Data Generation: The new tool provides a generators module with functions to create random MessageType, ReplicaIdentity, ColumnData, ColumnInfo, TupleData, RelationInfo, and LogicalReplicationMessage instances, leveraging the arbitrary crate without modifying the core pg_walstream library.
  • Demonstration Binary Included: A main.rs binary is included to demonstrate the usage of these arbitrary generators, showcasing how various pg_walstream data structures can be fuzzed and asserting diversity in generated outputs.

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

Changelog
  • tools/arbitrary-fuzzing/Cargo.lock
    • Added Cargo lock file, detailing all resolved dependencies for the new arbitrary fuzzing tool.
  • tools/arbitrary-fuzzing/Cargo.toml
    • Added Cargo manifest for the new pg-walstream-arbitrary-fuzzing package, defining its metadata and dependencies on pg_walstream and arbitrary.
  • tools/arbitrary-fuzzing/src/lib.rs
    • Implemented a generators module containing functions to produce arbitrary instances of various pg_walstream protocol types for fuzzing.
  • tools/arbitrary-fuzzing/src/main.rs
    • Created a demonstration binary that utilizes the arbitrary generators to print and verify the generation of diverse pg_walstream types.
Activity
  • No human activity has been recorded on this pull request yet.
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.

@codecov
Copy link

codecov bot commented Feb 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.97%. Comparing base (8cfe1eb) to head (de1d82a).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #19   +/-   ##
=======================================
  Coverage   87.97%   87.97%           
=======================================
  Files           8        8           
  Lines        7019     7019           
=======================================
  Hits         6175     6175           
  Misses        844      844           

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

Copy link

@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 introduces a standalone tool for generating arbitrary pg_walstream types, which is highly beneficial for fuzzing the library without requiring internal modifications. The implementation correctly leverages the arbitrary crate and covers all major protocol message variants. My feedback focuses on improving the quality of the generated data by restricting certain fields to valid protocol characters and increasing the limits on collection sizes to enhance fuzzing coverage. I also suggested a minor refactoring to reduce code duplication in the message generators.

@isdaniel isdaniel merged commit be92966 into main Feb 15, 2026
10 checks passed
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.

1 participant