Skip to content

[ci] Add MSRV minimality check#2812

Merged
joshlf merged 1 commit intomainfrom
add-msrv-minimal-check
Nov 24, 2025
Merged

[ci] Add MSRV minimality check#2812
joshlf merged 1 commit intomainfrom
add-msrv-minimal-check

Conversation

@joshlf
Copy link
Member

@joshlf joshlf commented Nov 24, 2025

This change adds a new CI script ci/check_msrv_is_minimal.sh that verifies that the package's MSRV is strictly lower than any version specified in package.metadata.build-rs. This ensures that we don't accidentally bump our MSRV unnecessarily.

The check is added to:

  • .github/workflows/ci.yml as a new job.
  • githooks/pre-push to be run locally.

The script implementation uses a Python script embedded via heredoc and a temporary file for better readability and maintainability.

@joshlf joshlf requested a review from jswrenn November 24, 2025 04:09
@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 introduces an automated mechanism to enforce a minimal Minimum Supported Rust Version (MSRV) for the zerocopy package. By adding a new CI script that checks the MSRV against other specified Rust versions, and integrating this check into both the CI pipeline and a local pre-push hook, the change aims to prevent accidental or unnecessary MSRV increases, thereby maintaining broader compatibility for the library.

Highlights

  • New MSRV Minimality Check Script: A new CI script, ci/check_msrv_is_minimal.sh, has been added. This script is designed to verify that the package's Minimum Supported Rust Version (MSRV) is strictly lower than any version specified in package.metadata.build-rs, preventing unnecessary MSRV bumps.
  • CI Integration: The newly introduced MSRV check is integrated into the continuous integration workflow (.github/workflows/ci.yml) as a new job, ensuring automated verification on every build.
  • Pre-push Hook Integration: The githooks/pre-push script has been updated to include the execution of the ci/check_msrv_is_minimal.sh script, allowing developers to catch MSRV violations locally before pushing changes.
  • Python-based Logic: The core logic for the MSRV check is implemented in a Python script embedded within the bash script using a heredoc, improving readability and maintainability of the version parsing and comparison.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/ci.yml
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.

@joshlf joshlf enabled auto-merge November 24, 2025 04:09
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 introduces a new CI script, ci/check_msrv_is_minimal.sh, to ensure the project's MSRV is not unintentionally increased. The script is also integrated into the pre-push git hook. The implementation is well-done, using a Python script to handle the version comparison logic. I have one suggestion to simplify the shell script by avoiding the use of a temporary file. Also, please note that while the description mentions an update to .github/workflows/ci.yml, this file was not part of the changes in this PR.

@codecov-commenter
Copy link

codecov-commenter commented Nov 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.14%. Comparing base (f65c938) to head (71337ff).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2812   +/-   ##
=======================================
  Coverage   88.14%   88.14%           
=======================================
  Files          20       20           
  Lines        5450     5450           
=======================================
  Hits         4804     4804           
  Misses        646      646           

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

This change adds a new CI script `ci/check_msrv_is_minimal.sh` that
verifies that the package's MSRV is strictly lower than any version
specified in `package.metadata.build-rs`. This ensures that we don't
accidentally bump our MSRV unnecessarily.

The check is added to:
- `.github/workflows/ci.yml` as a new job.
- `githooks/pre-push` to be run locally.

The script implementation uses a Python script embedded via heredoc and
executed via `python3 -c` for better readability and maintainability.
@joshlf joshlf force-pushed the add-msrv-minimal-check branch from f3f7ea5 to 71337ff Compare November 24, 2025 15:37
@joshlf joshlf added this pull request to the merge queue Nov 24, 2025
Merged via the queue into main with commit c2e43ce Nov 24, 2025
99 checks passed
@joshlf joshlf deleted the add-msrv-minimal-check branch November 24, 2025 21:03
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