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: matrix package exclude #3257

Merged
merged 3 commits into from
Oct 9, 2024
Merged

ci: matrix package exclude #3257

merged 3 commits into from
Oct 9, 2024

Conversation

ChiTimesChi
Copy link
Collaborator

@ChiTimesChi ChiTimesChi commented Oct 9, 2024

Description
A clear and concise description of the features you're adding in this pull request.

Additional context
Add any other context about the problem you're solving.

Metadata

  • Fixes #[Link to Issue]

Summary by CodeRabbit

  • Chores
    • Updated conditions for job execution in the workflow to exclude the solidity-devops package from specific analysis jobs.
    • Maintained the overall structure and logic flow of the workflow.

Copy link
Contributor

coderabbitai bot commented Oct 9, 2024

Walkthrough

The changes in the .github/workflows/solidity.yml file involve updating the conditions for executing specific jobs related to the solidity-devops package. The slither, gas-diff, and size-check jobs will now be excluded from running if the only changes pertain to the solidity-devops package. This is achieved by modifying the conditional checks to ensure that the package list does not solely contain solidity-devops. The overall structure of the workflow remains unchanged.

Changes

File Change Summary
.github/workflows/solidity.yml Updated job execution conditions to exclude slither, gas-diff, and size-check jobs for changes only in the solidity-devops package.

Possibly related PRs

  • ci: Solidity gas diff [SLT-259] #3181: This PR modifies the .github/workflows/solidity.yml file to enhance the CI workflow for Solidity, including exclusions for the solidity-devops package, which directly relates to the changes made in the main PR regarding job execution conditions for the same package.
  • ci: fix matrix exclude for solidity packages #3255: This PR also addresses the exclusion of the solidity-devops package in the CI workflow, clarifying the logic for job exclusions in the .github/workflows/solidity.yml file, aligning closely with the main PR's focus on modifying job conditions.

Suggested reviewers

  • traian0x
  • aureliusbtc

🐇 In the meadow, changes bloom,
Jobs now skip the devops gloom.
With Slither, gas, and size in sight,
Only relevant paths take flight!
Hooray for workflows, clear and bright! 🌼


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.

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.

@github-actions github-actions bot added M-ci Module: CI size/xs labels Oct 9, 2024
Copy link

cloudflare-workers-and-pages bot commented Oct 9, 2024

Deploying sanguine-fe with  Cloudflare Pages  Cloudflare Pages

Latest commit: f75ee1e
Status: ✅  Deploy successful!
Preview URL: https://40642c24.sanguine-fe.pages.dev
Branch Preview URL: https://ci-matrix-package-exclude-2.sanguine-fe.pages.dev

View logs

Copy link

codecov bot commented Oct 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.43902%. Comparing base (768209d) to head (f75ee1e).
Report is 2 commits behind head on master.

Additional details and impacted files
@@                 Coverage Diff                 @@
##              master       #3257         +/-   ##
===================================================
- Coverage   93.10658%   90.43902%   -2.66756%     
===================================================
  Files             89          54         -35     
  Lines           2205        1025       -1180     
  Branches         278          82        -196     
===================================================
- Hits            2053         927       -1126     
+ Misses           143          95         -48     
+ Partials           9           3          -6     
Flag Coverage Δ
packages 90.43902% <ø> (ø)
solidity ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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 (4)
.github/workflows/solidity.yml (4)

124-124: LGTM! Consider a minor readability improvement.

The change correctly excludes the slither job when only the solidity-devops package is modified, which aligns with the PR objective and the comment about Slither's irrelevance for solidity-devops.

For improved readability, consider using the contains function:

if: ${{ needs.changes.outputs.package_count > 0 && !contains(fromJson(needs.changes.outputs.packages), 'solidity-devops') }}

This change would make the condition more explicit about checking for the presence of solidity-devops in the list of changed packages.


242-242: LGTM! Consider the same readability improvement.

The change correctly excludes the gas-diff job when only the solidity-devops package is modified, which is consistent with the PR objective and the comment about gas diff being irrelevant for solidity-devops.

For consistency with the previous suggestion and improved readability, consider using the contains function:

if: ${{ needs.changes.outputs.package_count > 0 && !contains(fromJson(needs.changes.outputs.packages), 'solidity-devops') }}

This change would make the condition more explicit and maintain consistency across job definitions.


293-293: LGTM! Consider readability improvement and refactoring.

The change correctly excludes the size-check job when only the solidity-devops package is modified, which is consistent with the PR objective and the comment about size check being irrelevant for solidity-devops.

For consistency and improved readability, consider using the contains function:

if: ${{ needs.changes.outputs.package_count > 0 && !contains(fromJson(needs.changes.outputs.packages), 'solidity-devops') }}

Given that this condition is now identical across multiple jobs (slither, gas-diff, and size-check), consider refactoring to reduce duplication. You could define a reusable condition at the workflow level:

env:
  SOLIDITY_JOBS_CONDITION: ${{ needs.changes.outputs.package_count > 0 && !contains(fromJson(needs.changes.outputs.packages), 'solidity-devops') }}

jobs:
  # ... other jobs ...

  slither:
    if: ${{ env.SOLIDITY_JOBS_CONDITION }}
    # ... rest of the job definition ...

  gas-diff:
    if: ${{ env.SOLIDITY_JOBS_CONDITION }}
    # ... rest of the job definition ...

  size-check:
    if: ${{ env.SOLIDITY_JOBS_CONDITION }}
    # ... rest of the job definition ...

This refactoring would improve maintainability by centralizing the condition logic.


Line range hint 1-324: Overall assessment: Changes are correct and align with PR objectives.

The modifications consistently implement the exclusion of the solidity-devops package from the slither, gas-diff, and size-check jobs. This aligns well with the PR objective of excluding the matrix package for these specific jobs.

Key points:

  1. The changes are logically correct and consistent across all affected jobs.
  2. The exclusion is properly justified by comments indicating that these jobs are irrelevant for the solidity-devops package.
  3. The workflow structure remains intact, with only the job execution conditions being modified.

To further improve the workflow:

  1. Consider implementing the suggested readability improvements using the contains function for clearer condition checks.
  2. Evaluate the proposed refactoring to reduce duplication of the condition across multiple jobs, which would enhance maintainability.

These changes will make the workflow more robust and easier to maintain in the future.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 05857f4 and f75ee1e.

📒 Files selected for processing (1)
  • .github/workflows/solidity.yml (3 hunks)
🧰 Additional context used

@ChiTimesChi ChiTimesChi merged commit aecc24c into master Oct 9, 2024
46 checks passed
@ChiTimesChi ChiTimesChi deleted the ci/matrix-package-exclude-2 branch October 9, 2024 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
M-ci Module: CI size/xs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant