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

ci: test on stable rust, not nightly #115

Merged
merged 3 commits into from
Nov 27, 2024
Merged

ci: test on stable rust, not nightly #115

merged 3 commits into from
Nov 27, 2024

Conversation

lklimek
Copy link
Collaborator

@lklimek lklimek commented Nov 27, 2024

Issue being fixed or feature implemented

Github Actions run tests on rust nightly, which fails.
See https://github.com/dashpay/rs-tenderdash-abci/actions/runs/12050788549

What was done?

Switched to stable

How Has This Been Tested?

Pass GH Actions

Breaking Changes

None

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

Summary by CodeRabbit

  • Chores
    • Updated testing workflow to use stable toolchain and simplified test commands.
    • Streamlined GitHub Pages workflow by removing unnecessary comments and clarifying job structure.

Copy link
Contributor

coderabbitai bot commented Nov 27, 2024

Walkthrough

The pull request modifies the GitHub Actions workflow configurations in .github/workflows/test.yml and .github/workflows/github-pages.yml. In test.yml, the toolchain parameter is updated from nightly to stable, and test commands for tenderdash-proto and tenderdash-abci are simplified by removing specific flags. In github-pages.yml, unnecessary commented lines are removed, streamlining the workflow without changing job functionality.

Changes

File Change Summary
.github/workflows/test.yml Updated toolchain from nightly to stable; simplified cargo test commands for tenderdash-proto and tenderdash-abci by removing flags.
.github/workflows/github-pages.yml Removed commented lines related to the push event and environment configuration; no changes to job functionality.

Poem

In the garden of code, where the rabbits play,
The toolchain now stable, brightens the day.
With tests running smooth, flags tossed aside,
A simpler path forward, with joy we abide.
Hops of delight in the CI's embrace,
Let's celebrate changes, a swift, happy pace! 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between ffa3158 and 88a9973.

📒 Files selected for processing (1)
  • .github/workflows/github-pages.yml (1 hunks)
🔇 Additional comments (1)
.github/workflows/github-pages.yml (1)

Line range hint 1-58: LGTM! The GitHub Pages workflow remains well-structured.

The workflow maintains all essential components for proper documentation generation and deployment. The removal of commented lines helps improve readability without affecting functionality.

Let's verify that the documentation generation step works with stable Rust:

✅ Verification successful

The previous attempt didn't yield results, so let's examine the broader context by:

  1. Checking Rust configuration files for any toolchain specifications
  2. Looking at all workflow files to understand the Rust setup
  3. Searching for documentation-specific configuration files

This will help us verify if the documentation generation is compatible with stable Rust.


The GitHub Pages workflow is compatible with stable Rust

Based on the analysis of the codebase:

  1. The workspace's rust-version is set to "1.80" (stable) in Cargo.toml
  2. The test workflow explicitly specifies toolchain: stable
  3. The documentation generation uses --cfg docsrs flag which is supported in stable Rust
  4. No nightly-specific features or configurations were found in the codebase

The workflow will work correctly with stable Rust as all the documentation generation tools and flags used are supported in the stable toolchain.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the documentation generation commands are compatible with stable Rust

# Check if there are any nightly-specific features or attributes in the documentation
rg -l '#!\[feature\(' 

# Check for any doc comments that might reference nightly-only features
rg -l '//!.*nightly|///.*nightly'

# Look for any conditional compilation that might depend on nightly
ast-grep --pattern 'cfg(nightly)'

Length of output: 95


Script:

#!/bin/bash
# Let's check for any Rust-specific configuration or toolchain files
fd -e toml -x cat {}

# Check if there are any other workflow files that might specify Rust toolchain
fd -g '*.yml' -g '*.yaml' .github/workflows -x cat {}

# Look for any documentation-specific configuration
fd -g 'rustdoc*' -g 'doc*' -x cat {}

Length of output: 15897


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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 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
Contributor

@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

🧹 Outside diff range and nitpick comments (1)
.github/workflows/test.yml (1)

Line range hint 34-48: Well-structured CI configuration with good practices.

The CI setup demonstrates good practices:

  1. Uses stable toolchain for reliability
  2. Maintains proper test timeouts via environment variables
  3. Preserves coverage reporting with grcov
  4. Includes proper error handling with docker logs archival

Consider adding a comment in the workflow file explaining why stable toolchain is preferred to help future maintainers.

      - uses: ./.github/actions/deps
        with:
+         # Using stable toolchain for reliable CI builds
          toolchain: stable
🧰 Tools
🪛 actionlint (1.7.4)

31-31: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 9745cf3 and ffa3158.

📒 Files selected for processing (1)
  • .github/workflows/test.yml (2 hunks)
🔇 Additional comments (2)
.github/workflows/test.yml (2)

39-39: LGTM! Test command simplification maintains functionality.

Removing the nightly-specific -Zunstable-options --ensure-time flags is appropriate since test timeouts are already properly managed through the RUST_TEST_TIME_* environment variables defined at the job level.

Let's verify the test timeout configuration:

Also applies to: 48-48

✅ Verification successful

Test timeout configuration is properly maintained

The verification confirms that:

  1. Test timeouts are correctly configured through environment variables (RUST_TEST_TIME_*) at the job level
  2. Individual test steps have their own timeout-minutes settings
  3. No conflicting timeout configurations exist in Cargo.toml files
  4. The removal of -Zunstable-options --ensure-time flags doesn't impact the timeout functionality

The test timeout behavior is maintained through a robust combination of workflow-level timeouts (15 minutes), step-level timeouts (6 minutes), and granular test timeouts via environment variables (5s warning, 10s kill).

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify test timeout configuration consistency
# Check if there are any other test timeout configurations that might conflict

# Look for any other test timeout configurations
rg -g '!.git' 'test.*time|timeout' 

# Check for any cargo config files that might override test settings
fd -g 'config.toml' -g '.cargo/config*'

Length of output: 708


Script:

#!/bin/bash
# Let's check the workflow file to understand the test timeout configuration
cat .github/workflows/test.yml

# Also check for any test-related configuration in Cargo.toml files
fd Cargo.toml --exec grep -l "test" {} \; --exec cat {}

Length of output: 4681


34-34: LGTM! Switching to stable toolchain is a good practice.

Using the stable toolchain instead of nightly is generally preferred for CI as it provides more consistent and reliable builds.

Let's verify there are no nightly-only features being used:

✅ Verification successful

Switching to stable toolchain is safe and recommended

The verification confirms that the codebase doesn't use any nightly-only Rust features. The only feature-related findings are:

  • Standard conditional feature flags (#![cfg_attr(...)] and #![cfg(feature = "grpc")])
  • A minimum rust-version of 1.80 specified in Cargo.toml
  • No usage of unstable features in the Rust code

The .rustfmt.toml contains unstable_features = true, but this only affects code formatting and doesn't impact the build process.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for potential nightly-only feature usage
# Look for #![feature(...)] attributes which typically indicate nightly features

# Search for feature attributes in rust files
rg '#!\[feature' 

# Search for specific nightly feature gates in Cargo.toml files
rg '^\s*features\s*=' -t toml

Length of output: 50


Script:

#!/bin/bash
# Let's try a more comprehensive search for nightly features

# Look for any Rust files first to confirm we have access to them
fd -e rs

# Search for unstable features in a case-insensitive manner
rg -i 'unstable|nightly' -g '*.rs' -g '*.toml'

# Look for feature gates with more flexible pattern
rg '#!\[.*feature' -g '*.rs'

# Check Cargo.toml for rust-version specification
fd -g 'Cargo.toml' --exec cat {}

Length of output: 7301

@lklimek lklimek merged commit 4fba1f8 into develop Nov 27, 2024
11 checks passed
@lklimek lklimek deleted the ci/rust-stable branch November 27, 2024 14:19
@lklimek lklimek added this to the 1.3 milestone Nov 28, 2024
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.

2 participants