Skip to content
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

Pin additional crates for MSRV tests #20

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Pin additional crates for MSRV tests #20

wants to merge 1 commit into from

Conversation

NxPKG
Copy link
Contributor

@NxPKG NxPKG commented Mar 8, 2025

User description

Notes for Reviewers

This PR fixes #

Signed commits

  • Yes, I signed my commits.

PR Type

Enhancement, Tests


Description

  • Added a step to pin specific crate versions for MSRV tests.

  • Ensured compatibility with Rust toolchain version 1.72.0.

  • Updated GitHub Actions workflow to include crate version pinning.


Changes walkthrough 📝

Relevant files
Enhancement
build.yml
Pin specific crate versions for MSRV tests                             

.github/workflows/build.yml

  • Added a step to pin boring, litemap, and zerofrom crates to specific
    versions.
  • Conditional execution for Rust toolchain version 1.72.0.
  • +4/-0     

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • Summary by CodeRabbit

    • Chores
      • Introduced an update to the build process that conditionally manages dependency versions for improved stability with supported toolchain releases.

    Copy link

    sourcery-ai bot commented Mar 8, 2025

    Reviewer's Guide by Sourcery

    This pull request pins specific versions of the boring, litemap, and zerofrom crates in the build.yml workflow file. This change is introduced to ensure compatibility and consistent behavior during MSRV tests, specifically when the toolchain is not 1.72.0.

    No diagrams generated as the changes look simple and do not need a visual representation.

    File-Level Changes

    Change Details Files
    Pinning specific versions of boring, litemap, and zerofrom crates for MSRV (Minimum Supported Rust Version) tests.
    • Added a step to pin boring to version 4.13.0 when the toolchain is not 1.72.0.
    • Added a step to pin litemap to version 0.7.4 when the toolchain is not 1.72.0.
    • Added a step to pin zerofrom to version 0.1.5 when the toolchain is not 1.72.0.
    .github/workflows/build.yml

    Tips and commands

    Interacting with Sourcery

    • Trigger a new review: Comment @sourcery-ai review on the pull request.
    • Continue discussions: Reply directly to Sourcery's review comments.
    • Generate a GitHub issue from a review comment: Ask Sourcery to create an
      issue from a review comment by replying to it. You can also reply to a
      review comment with @sourcery-ai issue to create an issue from it.
    • Generate a pull request title: Write @sourcery-ai anywhere in the pull
      request title to generate a title at any time. You can also comment
      @sourcery-ai title on the pull request to (re-)generate the title at any time.
    • Generate a pull request summary: Write @sourcery-ai summary anywhere in
      the pull request body to generate a PR summary at any time exactly where you
      want it. You can also comment @sourcery-ai summary on the pull request to
      (re-)generate the summary at any time.
    • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
      request to (re-)generate the reviewer's guide at any time.
    • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
      pull request to resolve all Sourcery comments. Useful if you've already
      addressed all the comments and don't want to see them anymore.
    • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
      request to dismiss all existing Sourcery reviews. Especially useful if you
      want to start fresh with a new review - don't forget to comment
      @sourcery-ai review to trigger a new review!
    • Generate a plan of action for an issue: Comment @sourcery-ai plan on
      an issue to generate a plan of action for it.

    Customizing Your Experience

    Access your dashboard to:

    • Enable or disable review features such as the Sourcery-generated pull request
      summary, the reviewer's guide, and others.
    • Change the review language.
    • Add, remove or edit custom review instructions.
    • Adjust other review settings.

    Getting Help

    Copy link

    coderabbitai bot commented Mar 8, 2025

    Walkthrough

    This pull request introduces a new build step in the GitHub Actions workflow. The step conditionally executes when the toolchain version is 1.72.0. When the condition is met, it runs a series of cargo update commands to pin the versions for three specific crates: boring to 4.13.0, litemap to 0.7.4, and zerofrom to 0.1.5. There are no changes to any exported or public entities.

    Changes

    File Change Summary
    .github/workflows/build.yml Added a conditional build step that runs cargo update commands to pin crate versions when using toolchain 1.72.0

    Sequence Diagram(s)

    sequenceDiagram
        participant GA as GitHub Actions
        participant Build as Build Process
        participant Cargo as Cargo Update
        GA->>Build: Trigger build workflow
        Build->>Build: Check if toolchain is 1.72.0
        alt Toolchain is 1.72.0
            Build->>Cargo: Run `cargo update` for [email protected]
            Build->>Cargo: Run `cargo update` for [email protected]
            Build->>Cargo: Run `cargo update` for [email protected]
        else Toolchain is not 1.72.0
            Build->>Build: Skip crate pinning step
        end
    
    Loading

    Suggested labels

    Review effort [1-5]: 1

    Poem

    I'm a hopping rabbit in a code-filled glade,
    Skipping through steps that GitHub made.
    With a toolchain tick at version 1.72,
    I pin crates tight, each command so true.
    Coding with joy, my whiskers dance—
    In every build, I leap at chance!
    🐇✨


    Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

    ❤️ Share
    🪧 Tips

    Chat

    There are 3 ways to chat with CodeRabbit:

    • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
      • I pushed a fix in commit <commit_id>, please review it.
      • Generate unit testing code for this file.
      • Open a follow-up GitHub issue for this discussion.
    • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
      • @coderabbitai generate unit testing code for this file.
      • @coderabbitai modularize this function.
    • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
      • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
      • @coderabbitai read src/utils.ts and generate unit testing code.
      • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
      • @coderabbitai help me debug CodeRabbit configuration file.

    Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

    CodeRabbit Commands (Invoked using PR comments)

    • @coderabbitai pause to pause the reviews on a PR.
    • @coderabbitai resume to resume the paused reviews.
    • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
    • @coderabbitai full review to do a full review from scratch and review all the files again.
    • @coderabbitai summary to regenerate the summary of the PR.
    • @coderabbitai generate docstrings to generate docstrings for this PR.
    • @coderabbitai resolve resolve all the CodeRabbit review comments.
    • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
    • @coderabbitai help to get help.

    Other keywords and placeholders

    • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
    • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
    • Add @coderabbitai anywhere in the PR title to generate the title automatically.

    CodeRabbit Configuration File (.coderabbit.yaml)

    • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
    • Please see the configuration documentation for more information.
    • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

    Documentation and Community

    • Visit our Documentation for detailed information on how to use CodeRabbit.
    • Join our Discord Community to get help, request features, and share feedback.
    • Follow us on X/Twitter for updates and announcements.

    Copy link

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ No major issues detected

    Copy link

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    General
    Improve CI conditional execution

    Use a more reliable shell syntax for the conditional command. The current syntax
    might fail on some CI runners that don't use bash as the default shell. Consider
    using an if-else structure for better readability and reliability.

    .github/workflows/build.yml [37-39]

     - name: Pin crates to versions for MSRV
    +  if: matrix.toolchain == '1.72.0'
       run: |
    -    [[ ${{ matrix.toolchain }} != 1.72.0 ]] || (cargo update -p boring --precise 4.13.0 && cargo update -p litemap --precise 0.7.4 && cargo update -p zerofrom --precise 0.1.5)
    +    cargo update -p boring --precise 4.13.0
    +    cargo update -p litemap --precise 0.7.4
    +    cargo update -p zerofrom --precise 0.1.5
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    __

    Why: The suggestion replaces the bash-specific conditional syntax with GitHub Actions' native conditional execution, which is more reliable across different CI environments. It also improves readability by separating the commands into multiple lines instead of chaining them with &&.

    Medium
    • More

    Copy link

    @sourcery-ai sourcery-ai bot left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Hey @NxPKG - I've reviewed your changes - here's some feedback:

    Overall Comments:

    • Consider adding a comment explaining why these crates are being pinned.
    Here's what I looked at during the review
    • 🟢 General issues: all looks good
    • 🟢 Security: all looks good
    • 🟢 Testing: all looks good
    • 🟢 Complexity: all looks good
    • 🟢 Documentation: all looks good

    Sourcery is free for open source - if you like our reviews please consider sharing them ✨
    Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

    Copy link

    CI Feedback 🧐

    A test triggered by this PR failed. Here is an AI-generated analysis of the failure:

    Action: bongonet (1.72)

    Failed stage: Run cargo test [❌]

    Failure summary:

    The action failed because the Rust package boring v4.15.0 requires a newer version of the Rust
    compiler (rustc 1.80 or newer), but the currently active version is 1.72.1. The build process cannot
    continue until either:

  • The Rust compiler is upgraded to version 1.80 or newer
  • The boring package is downgraded to a version compatible with rustc 1.72.1

  • Relevant error logs:
    1:  ##[group]Operating System
    2:  Ubuntu
    ...
    
    374:  ##[group]Run : set $CARGO_HOME
    375:  �[36;1m: set $CARGO_HOME�[0m
    376:  �[36;1mecho CARGO_HOME=${CARGO_HOME:-$HOME/.cargo} >> $GITHUB_ENV�[0m
    377:  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
    378:  ##[endgroup]
    379:  ##[group]Run : install rustup if needed
    380:  �[36;1m: install rustup if needed�[0m
    381:  �[36;1mif ! command -v rustup &>/dev/null; then�[0m
    382:  �[36;1m  curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused --location --silent --show-error --fail "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y�[0m
    ...
    
    455:  �[36;1m  fi�[0m
    456:  �[36;1mfi�[0m
    457:  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
    458:  env:
    459:  CARGO_HOME: /home/runner/.cargo
    460:  CARGO_INCREMENTAL: 0
    461:  CARGO_TERM_COLOR: always
    462:  ##[endgroup]
    463:  ##[group]Run : work around spurious network errors in curl 8.0
    464:  �[36;1m: work around spurious network errors in curl 8.0�[0m
    ...
    
    609:  �[0m�[0m�[1m�[32m  Downloaded�[0m unicase v2.8.1
    610:  �[0m�[0m�[1m�[32m  Downloaded�[0m typenum v1.18.0
    611:  �[0m�[0m�[1m�[32m  Downloaded�[0m tracing-core v0.1.33
    612:  �[0m�[0m�[1m�[32m  Downloaded�[0m tracing v0.1.41
    613:  �[0m�[0m�[1m�[32m  Downloaded�[0m tokio-util v0.7.13
    614:  �[0m�[0m�[1m�[32m  Downloaded�[0m tokio-macros v2.5.0
    615:  �[0m�[0m�[1m�[32m  Downloaded�[0m tinystr v0.7.6
    616:  �[0m�[0m�[1m�[32m  Downloaded�[0m tiny-keccak v2.0.2
    617:  �[0m�[0m�[1m�[32m  Downloaded�[0m thiserror-impl v1.0.69
    618:  �[0m�[0m�[1m�[32m  Downloaded�[0m thiserror v1.0.69
    ...
    
    690:  �[0m�[0m�[1m�[32m  Downloaded�[0m httpdate v1.0.3
    691:  �[0m�[0m�[1m�[32m  Downloaded�[0m http v1.2.0
    692:  �[0m�[0m�[1m�[32m  Downloaded�[0m hex v0.4.3
    693:  �[0m�[0m�[1m�[32m  Downloaded�[0m heck v0.5.0
    694:  �[0m�[0m�[1m�[32m  Downloaded�[0m h2 v0.4.8
    695:  �[0m�[0m�[1m�[32m  Downloaded�[0m quote v1.0.39
    696:  �[0m�[0m�[1m�[32m  Downloaded�[0m protobuf v2.28.0
    697:  �[0m�[0m�[1m�[32m  Downloaded�[0m proc-macro2 v1.0.94
    698:  �[0m�[0m�[1m�[32m  Downloaded�[0m proc-macro-error v1.0.4
    ...
    
    715:  �[0m�[0m�[1m�[32m  Downloaded�[0m hashbrown v0.12.3
    716:  �[0m�[0m�[1m�[32m  Downloaded�[0m half v2.4.1
    717:  �[0m�[0m�[1m�[32m  Downloaded�[0m glob v0.3.2
    718:  �[0m�[0m�[1m�[32m  Downloaded�[0m zerocopy v0.7.35
    719:  �[0m�[0m�[1m�[32m  Downloaded�[0m yoke-derive v0.7.5
    720:  �[0m�[0m�[1m�[32m  Downloaded�[0m yoke v0.7.5
    721:  �[0m�[0m�[1m�[32m  Downloaded�[0m rand_chacha v0.3.1
    722:  �[0m�[0m�[1m�[32m  Downloaded�[0m rand v0.8.5
    723:  �[0m�[0m�[1m�[32m  Downloaded�[0m proc-macro-error-attr v1.0.4
    ...
    
    830:  �[0m�[0m�[1m�[32m  Downloaded�[0m atty v0.2.14
    831:  �[0m�[0m�[1m�[32m  Downloaded�[0m atomic-waker v1.1.2
    832:  �[0m�[0m�[1m�[32m  Downloaded�[0m async-stream-impl v0.3.6
    833:  �[0m�[0m�[1m�[32m  Downloaded�[0m async-stream v0.3.6
    834:  �[0m�[0m�[1m�[32m  Downloaded�[0m arrayvec v0.7.6
    835:  �[0m�[0m�[1m�[32m  Downloaded�[0m anes v0.1.6
    836:  �[0m�[0m�[1m�[32m  Downloaded�[0m alloc-stdlib v0.2.2
    837:  �[0m�[0m�[1m�[32m  Downloaded�[0m alloc-no-stdlib v2.0.4
    838:  �[0m�[0m�[1m�[31merror�[0m�[1m:�[0m package `boring v4.15.0` cannot be built because it requires rustc 1.80 or newer, while the currently active rustc version is 1.72.1
    839:  Either upgrade to rustc 1.80 or newer, or use
    840:  cargo update -p [email protected] --precise ver
    841:  where `ver` is the latest version of `boring` supporting rustc 1.72.1
    842:  ##[error]Process completed with exit code 101.
    

    Copy link

    @coderabbitai coderabbitai bot left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Actionable comments posted: 0

    🧹 Nitpick comments (1)
    .github/workflows/build.yml (1)

    37-40: Pin Crates for MSRV and Remove Trailing Whitespace

    The new workflow step added in this hunk correctly pins the crate versions when the toolchain is 1.72.0. The conditional expression using

    [[ ${{ matrix.toolchain }} != 1.72.0 ]] || (...)

    ensures these commands execute only for the targeted toolchain, which aligns with the PR objectives.

    Review Points:

    • Logic and Functionality : The approach is clear and meets the requirement to pin specific crate versions for MSRV tests.
    • Readability : Consider adding a brief inline comment explaining the rationale behind pinning these crate versions, which could improve long-term maintainability.
    • Trailing Whitespace : Static analysis flagged trailing spaces on line 40. Removing them will help maintain clean YAML formatting.

    Proposed diff to address the trailing whitespace:

    -          [[ ${{ matrix.toolchain }} != 1.72.0 ]] || (cargo update -p boring --precise 4.13.0 && cargo update -p litemap --precise 0.7.4 && cargo update -p zerofrom --precise 0.1.5)  
    +          [[ ${{ matrix.toolchain }} != 1.72.0 ]] || (cargo update -p boring --precise 4.13.0 && cargo update -p litemap --precise 0.7.4 && cargo update -p zerofrom --precise 0.1.5)
    🧰 Tools
    🪛 YAMLlint (1.35.1)

    [error] 40-40: trailing spaces

    (trailing-spaces)

    📜 Review details

    Configuration used: CodeRabbit UI
    Review profile: CHILL
    Plan: Pro

    📥 Commits

    Reviewing files that changed from the base of the PR and between 5f38923 and 16c3c98.

    📒 Files selected for processing (1)
    • .github/workflows/build.yml (1 hunks)
    🧰 Additional context used
    🪛 YAMLlint (1.35.1)
    .github/workflows/build.yml

    [error] 40-40: trailing spaces

    (trailing-spaces)

    ⏰ Context from checks skipped due to timeout of 90000ms (1)
    • GitHub Check: build

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    1 participant