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

Add dummy feature for non supported platforms #39

Merged
merged 3 commits into from
Jan 6, 2024
Merged

Add dummy feature for non supported platforms #39

merged 3 commits into from
Jan 6, 2024

Conversation

lambdalisue
Copy link
Owner

@lambdalisue lambdalisue commented Jan 6, 2024

From #36

Summary by CodeRabbit

Summary by CodeRabbit

  • Chores

    • Updated GitHub Actions versions for checkout and caching in CI workflows to improve reliability and performance.
  • New Features

    • Added a new build-dummy job in the build workflow to enhance the build process and testing for specific targets.
  • Documentation

    • Updated the README.md to reflect the latest changes and usage instructions.
  • Tests

    • Introduced new test cases in collector.rs to ensure compatibility and correctness across different operating systems and feature flags.

Copy link

coderabbitai bot commented Jan 6, 2024

Warning

Rate Limit Exceeded

@lambdalisue has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 8 minutes and 50 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between b061be6 and 7aa56ab.

Walkthrough

The project's CI/CD pipeline has been updated with newer versions of GitHub Actions for checking out code and caching. A new job for building a dummy target has been introduced, likely for testing or CI purposes. The source code has been modified to include conditional compilation, enhancing support for different operating systems and feature flags.

Changes

File Path Change Summary
.github/workflows/*.yml Updated actions to v4 for checkout and caching
src/collector.rs Added conditional compilation for collect function and new tests
README.md Introduces a new feature dummy and its usage with the dummy feature flag
src/collector/dummy.rs Added a new file dummy.rs with a function collect returning a default Metrics instance

🐇✨
In the realm of code, the changes are sown,
Actions updated, and a new job is grown.
With conditions compiled, and tests anew,
The CI garden flourishes, as versions accrue. 🌱🚀

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's AI:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • 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 tests 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 from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @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.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

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.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between b061be6 and bd23c40.
Files ignored due to filter (1)
  • Cargo.toml
Files selected for processing (5)
  • .github/workflows/audit.yml (1 hunks)
  • .github/workflows/build.yml (2 hunks)
  • .github/workflows/test.yml (3 hunks)
  • README.md (2 hunks)
  • src/collector.rs (3 hunks)
Files skipped from review due to trivial changes (2)
  • .github/workflows/audit.yml
  • .github/workflows/test.yml
Additional comments: 6
.github/workflows/build.yml (1)
  • 12-13: The update of the GitHub Actions versions for checkout and caching is noted and aligns with the PR objectives to use the latest tools.
src/collector.rs (3)
  • 44-50: The conditional compilation directives added to the collect function for the dummy feature are correct and follow Rust's standard practices for feature flags.

  • 65-67: The test test_collect_internal_ok is correctly configured for macOS, Linux, and Windows platforms. However, ensure that the test is not accidentally excluded on any platform due to the cfg attributes.

  • 85-102: The test test_collect_internal_ok_dummy is correctly set up to test the dummy feature. It checks that all metrics are None, which is the expected behavior for the dummy collector.

README.md (2)
  • 51-53: The README has been updated to include information about the dummy feature, which is helpful for users who need to compile on non-supported platforms.

  • 124-128: The feature table in the README clearly explains the dummy feature, which aligns with the changes made in the source code.

.github/workflows/build.yml Outdated Show resolved Hide resolved
@lambdalisue lambdalisue force-pushed the dummy branch 2 times, most recently from 4bf4a72 to 284f608 Compare January 6, 2024 08:17
Copy link

codecov bot commented Jan 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b061be6) 57.75% compared to head (7aa56ab) 57.75%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #39   +/-   ##
=======================================
  Coverage   57.75%   57.75%           
=======================================
  Files           5        5           
  Lines         258      258           
=======================================
  Hits          149      149           
  Misses        109      109           

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

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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between b061be6 and f7d1053.
Files ignored due to filter (1)
  • Cargo.toml
Files selected for processing (6)
  • .github/workflows/audit.yml (1 hunks)
  • .github/workflows/build.yml (2 hunks)
  • .github/workflows/test.yml (3 hunks)
  • README.md (2 hunks)
  • src/collector.rs (4 hunks)
  • src/collector/dummy.rs (1 hunks)
Files skipped from review as they are similar to previous changes (5)
  • .github/workflows/audit.yml
  • .github/workflows/build.yml
  • .github/workflows/test.yml
  • README.md
  • src/collector.rs
Additional comments: 1
src/collector/dummy.rs (1)
  • 3-5: The implementation of the collect function, which returns a default Metrics object, appears to be correct and straightforward.

Based on the discussion in #36, we decided to add a `dummy` feature
that always return an empty `Metrics` for non supported platforms.
@lambdalisue lambdalisue merged commit cae5793 into main Jan 6, 2024
12 checks passed
@lambdalisue lambdalisue deleted the dummy branch January 6, 2024 08:42
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.

1 participant