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: slither ignore foundry compilation #221

Merged
merged 4 commits into from
Jul 12, 2024
Merged

ci: slither ignore foundry compilation #221

merged 4 commits into from
Jul 12, 2024

Conversation

fbac
Copy link
Contributor

@fbac fbac commented Jul 12, 2024

Ignore foundry compilation when running slither as a CLI and in CI.

Summary by CodeRabbit

  • Chores
    • Updated GitHub workflows to use yarn build instead of yarn compile for consistency in build processes.
    • Added configurations to improve workflow execution for Slither and testing.
  • Refactor
    • Modified package.json scripts to streamline testing by removing redundant compile steps.
  • Configuration
    • Added and adjusted Mocha timeout settings to enhance test reliability.

Copy link
Contributor

coderabbitai bot commented Jul 12, 2024

Walkthrough

Recent updates focus on enhancing the build and testing workflows for the project. The main changes include substituting yarn compile with yarn build in various scripts and configurations, adjusting Slither's execution settings, and introducing a new Mocha timeout configuration. These modifications streamline the build process, improve testing efficiency, and make the workflows more robust and adaptable.

Changes

File Change Summary
.github/workflows/slither.yaml Replaced yarn compile with yarn build in the Install dependencies job and added ignore-compile: true to the slither job.
hardhat.config.ts Added a new Mocha configuration with a timeout value of 100000.
slither.config.json Updated the setting to "foundry_ignore_compile": true.
package.json Modified the test:prototypes script to run tests directly without yarn compile.
.github/workflows/test.yaml Added a new step to build the project using yarn build.

Poem

In the realm of code, a change took place,
With yarn build now setting the pace,
Mocha's timeout, a longer grace,
Slither's tweaks, a sleeker face.
Improved workflows, a worthy embrace,
Our code marches forth, in steady trace.
🌟🚀


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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, codebase verification and nitpick comments (1)
.github/workflows/slither.yaml (1)

36-36: Add a comment to clarify why Foundry is being installed.

Adding a comment explaining the purpose of installing Foundry would improve the maintainability and readability of the workflow.

      - name: Install Foundry
        uses: foundry-rs/foundry-toolchain@v1
        # Foundry is installed to support contract compilation and testing
Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 961c059 and 6ad1fb1.

Files selected for processing (2)
  • .github/workflows/slither.yaml (2 hunks)
  • slither.config.json (1 hunks)
Files skipped from review due to trivial changes (1)
  • slither.config.json
Additional comments not posted (1)
.github/workflows/slither.yaml (1)

48-48: LGTM! The ignore-compile setting aligns with the PR objective.

The addition of ignore-compile: true in the with block instructs Slither to skip compilation, which is consistent with the PR's goal.

@fbac fbac force-pushed the fix-slither branch 2 times, most recently from 848b483 to 1dc1c9c Compare July 12, 2024 09:05
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

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6ad1fb1 and 848b483.

Files selected for processing (2)
  • .github/workflows/slither.yaml (2 hunks)
  • slither.config.json (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/slither.yaml
  • slither.config.json

Signed-off-by: Francisco de Borja Aranda Castillejo <[email protected]>
Copy link
Member

@lumtis lumtis left a comment

Choose a reason for hiding this comment

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

LGTM

Tests are failing but it doesn't seem to be related to this change

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

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 848b483 and 53dd172.

Files selected for processing (3)
  • .github/workflows/slither.yaml (1 hunks)
  • hardhat.config.ts (1 hunks)
  • slither.config.json (1 hunks)
Files skipped from review due to trivial changes (1)
  • hardhat.config.ts
Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/slither.yaml
  • slither.config.json

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

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 53dd172 and 516fc64.

Files selected for processing (3)
  • .github/workflows/test.yaml (2 hunks)
  • package.json (1 hunks)
  • slither.config.json (1 hunks)
Files skipped from review due to trivial changes (2)
  • .github/workflows/test.yaml
  • package.json
Files skipped from review as they are similar to previous changes (1)
  • slither.config.json

Signed-off-by: Francisco de Borja Aranda Castillejo <[email protected]>
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, codebase verification and nitpick comments (1)
package.json (1)

93-93: Reintroduce the yarn compile step in the test:prototypes script.

The removal of yarn compile from the test:prototypes script might lead to issues as there are no other scripts or workflows ensuring the compilation step before running tests. It is essential to reintroduce the yarn compile step to avoid potential problems.

  • Location: package.json
  • Script: test:prototypes
Analysis chain

Verify if the compilation is handled elsewhere.

The yarn compile step was removed from the test:prototypes script. Ensure that the compilation is handled elsewhere to avoid any issues.


Verify if the generate script or any other compilation step is executed before running test:prototypes.

The compile command is used in the generate script. We need to ensure that the generate script or any other compilation step is executed before running test:prototypes.


Verify if there are pre-test or pre-build scripts that handle compilation before running test:prototypes.

We need to ensure that the compile step is not skipped by checking if there are any pre-test or pre-build scripts that handle the compilation.


Verify if there are any test-related scripts that handle compilation before running test:prototypes.

We need to ensure that the compile step is included in any test-related scripts to avoid issues.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify if the compilation is handled elsewhere in the project.

# Test: Search for the compilation commands. Expect: Compilation handled by other scripts or steps.
rg --type json -A 5 $'"compile"'

Length of output: 611


Script:

#!/bin/bash
# Search for references to the `generate` script to ensure it is executed before running tests.
rg --type json '"generate"'

# Search for references to the `test:prototypes` script to understand its usage in the project.
rg --type json '"test:prototypes"'

Length of output: 273


Script:

#!/bin/bash
# Search for lifecycle scripts such as `pretest` or `prebuild` in the package.json to verify if compilation is handled.
rg --type json -A 5 '"pretest"'
rg --type json -A 5 '"prebuild"'

Length of output: 68


Script:

#!/bin/bash
# Search for all test-related scripts in the package.json to verify if any of them include the `compile` step.
rg --type json -A 5 '"test"'

Length of output: 630

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 516fc64 and 0ad9471.

Files selected for processing (3)
  • .github/workflows/test.yaml (3 hunks)
  • package.json (1 hunks)
  • slither.config.json (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • slither.config.json
Additional comments not posted (1)
.github/workflows/test.yaml (1)

38-40: LGTM! The new step for building the project is correctly added.

The addition of the Build project step ensures that the project is built before running tests.

@skosito
Copy link
Contributor

skosito commented Jul 12, 2024

@fbac @lumtis nodejs is bumped to 20 and i removed test:prototypes step because it is inlcuded with yarn test and i removed yarn forge from test workflow for now, when we add more tests we should add it as separate job

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

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 0ad9471 and 9035080.

Files selected for processing (1)
  • .github/workflows/test.yaml (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/test.yaml

@fbac
Copy link
Contributor Author

fbac commented Jul 12, 2024

@fbac @lumtis nodejs is bumped to 20 and i removed test:prototypes step because it is inlcuded with yarn test and i removed yarn forge from test workflow for now, when we add more tests we should add it as separate job

LGTM!

@skosito
Copy link
Contributor

skosito commented Jul 12, 2024

@fbac @lumtis nodejs is bumped to 20 and i removed test:prototypes step because it is inlcuded with yarn test and i removed yarn forge from test workflow for now, when we add more tests we should add it as separate job

LGTM!

i think we can merge this one

@fbac fbac merged commit 180b8c8 into main Jul 12, 2024
11 checks passed
@fbac fbac deleted the fix-slither branch July 12, 2024 16:19
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