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

feat: exclude scripts with import errors #3285

Merged
merged 7 commits into from
Oct 26, 2024

Conversation

vishvamsinh28
Copy link
Contributor

@vishvamsinh28 vishvamsinh28 commented Oct 11, 2024

This PR excludes 2 scripts from Jest code coverage until the import issue in them has been fixed.

Summary by CodeRabbit

  • Chores
    • Updated coverage configuration to exclude specific files from coverage reporting.

Copy link

coderabbitai bot commented Oct 11, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

The changes involve the modification of the jest.config.js configuration file to include a new property called coveragePathIgnorePatterns. This property specifies a pattern for files that should be excluded from coverage reporting, specifically targeting 'scripts/compose.js'. The other existing properties in the configuration remain unchanged.

Changes

File Change Summary
jest.config.js Added coveragePathIgnorePatterns to exclude 'scripts/compose.js' from coverage reporting. Existing properties remain unchanged.

Possibly related PRs

  • feat: exclude scripts with import errors #3285: This PR is directly related as it also modifies jest.config.js to include the coveragePathIgnorePatterns property, specifically adding the same pattern 'scripts/compose.js' along with another pattern.

Suggested reviewers

  • derberg
  • magicmatatjahu
  • akshatnema
  • sambhavgupta0705
  • devilkiller-ag

Poem

In the garden where bunnies play,
Coverage paths now keep woes at bay.
With patterns set, we hop with glee,
Ignoring files, just let us be!
A joyful leap, a bounding cheer,
For clean reports, we hold so dear! 🐇✨


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

netlify bot commented Oct 11, 2024

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 34c2f1e
🔍 Latest deploy log https://app.netlify.com/sites/asyncapi-website/deploys/671d365ee9615100084b15c4
😎 Deploy Preview https://deploy-preview-3285--asyncapi-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

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

🧹 Outside diff range and nitpick comments (1)
jest.config.js (1)

5-7: Approve changes with suggestions for improvement

The addition of coveragePathIgnorePatterns correctly implements the PR objective to exclude scripts with import errors from Jest coverage. However, consider the following suggestions:

  1. The 'scripts/dashboard' path might be too broad. If you intend to exclude a specific file, consider using a more specific path (e.g., 'scripts/dashboard/specific-file.js').

  2. Add a comment explaining why these files are excluded. This will help with future maintenance.

  3. Since this is a temporary measure, consider adding a TODO comment to remind about resolving the import errors in the future.

Here's a suggested improvement:

 module.exports = {
   verbose: true,
   collectCoverage: true,
   collectCoverageFrom: ['scripts/**/*.js'],
+  // TODO: Remove these exclusions once import errors are resolved
   coveragePathIgnorePatterns: [
-    'scripts/compose.js','scripts/dashboard'
+    'scripts/compose.js',
+    'scripts/dashboard/specific-file.js' // Replace with the specific file if applicable
   ],
   // To disallow netlify edge function tests from running
   testMatch: ['**/tests/**/*.test.*', '!**/netlify/**/*.test.*'],
 };
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 2e31739 and 89c29fb.

📒 Files selected for processing (1)
  • jest.config.js (1 hunks)
🧰 Additional context used

@asyncapi-bot
Copy link
Contributor

asyncapi-bot commented Oct 11, 2024

⚡️ Lighthouse report for the changes in this PR:

Category Score
🔴 Performance 43
🟢 Accessibility 98
🟢 Best practices 92
🟢 SEO 100
🔴 PWA 33

Lighthouse ran on https://deploy-preview-3285--asyncapi-website.netlify.app/

@anshgoyalevil anshgoyalevil added the gsoc This label should be used for issues or discussions related to ideas for Google Summer of Code label Oct 13, 2024
Copy link

codecov bot commented Oct 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 49.14%. Comparing base (0cc300d) to head (34c2f1e).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3285      +/-   ##
==========================================
+ Coverage   47.32%   49.14%   +1.82%     
==========================================
  Files          22       21       -1     
  Lines         672      647      -25     
==========================================
  Hits          318      318              
+ Misses        354      329      -25     

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

@devilkiller-ag
Copy link
Member

@vishvamsinh28 What issue are you facing with import statements in those files, and why can it not be resolved now?

@vishvamsinh28
Copy link
Contributor Author

vishvamsinh28 commented Oct 16, 2024

@devilkiller-ag that issue comes under bounty program and @akshatnema told me not to write tests for them until someone fixes it

@anshgoyalevil
Copy link
Member

/rtm

@asyncapi-bot asyncapi-bot merged commit 90caba9 into asyncapi:master Oct 26, 2024
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gsoc This label should be used for issues or discussions related to ideas for Google Summer of Code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants