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

Fix for Deno v2 #426

Merged
merged 4 commits into from
Nov 8, 2024
Merged

Fix for Deno v2 #426

merged 4 commits into from
Nov 8, 2024

Conversation

lambdalisue
Copy link
Member

@lambdalisue lambdalisue commented Nov 8, 2024

  • rid is no longer exist in Deno v2
  • err is unknown in Deno v2

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced testing capabilities with support for Deno version "2.x".
  • Bug Fixes

    • Improved error handling in plugin function calls for more robust error reporting.
  • Documentation

    • Updated formatting in the README for better readability, particularly in the YouTube video section.
  • Tests

    • Adjusted test assertions to reflect the removal of the rid property from fake TCP listener and connection objects.

Copy link

coderabbitai bot commented Nov 8, 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 17 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 as a PR comment. 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

Reviewing files that changed from the base of the PR and between 7169cf4 and 5b23d4d.

Walkthrough

The pull request introduces updates to the GitHub Actions workflow configuration, enhancing testing capabilities by adding support for a new Deno version and adjusting input descriptions. The README.md file has been reformatted for better readability, particularly in the YouTube video section. Additionally, modifications to error handling in the Plugin class improve the robustness of error reporting. Changes in the test utilities involve the removal of the rid property from fake TCP listener and connection instances, accompanied by corresponding updates in the test suite to reflect these alterations.

Changes

File Change Summary
.github/workflows/test.yml - Updated pull_request trigger to specify paths for TypeScript, Vim, Markdown, and JSON files.
- Changed verbose input description from single to double quotes.
- Added "2.x" to version matrix in check job and deno_version matrix in test job.
README.md - Reformatted YouTube video section for improved readability.
denops/@denops-private/service.ts - Enhanced error handling in call method of Plugin class to uniformly handle error messages.
- Minor adjustments to comments and formatting.
tests/denops/testutil/mock.ts - Removed rid getter from TcpListener and TcpConn instances.
tests/denops/testutil/mock_test.ts - Updated tests to remove assertions related to the rid property for TcpListener and TcpConn.

Possibly related PRs

Poem

🐰 In the garden where code does bloom,
Changes sprout, dispelling gloom.
With tests that dance and errors that sing,
A workflow fresh, let the updates ring!
From rid to clarity, our paths align,
In the world of code, all will be fine! 🌼


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

@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 31-73: Consider workflow optimization opportunities

The current workflow structure is robust, testing across multiple dimensions:

  • Multiple Deno versions (1.45.0, 1.x, 2.x)
  • Multiple OS environments
  • Both Vim and Neovim

To potentially optimize CI time and resources:

  1. Consider using matrix includes/excludes to run certain combinations only when necessary
  2. Consider running Deno v2.x tests first, as they're most relevant to this PR

Would you like me to provide an example of how to optimize the matrix configuration?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 3a38e08 and 7169cf4.

📒 Files selected for processing (5)
  • .github/workflows/test.yml (3 hunks)
  • README.md (1 hunks)
  • denops/@denops-private/service.ts (1 hunks)
  • tests/denops/testutil/mock.ts (0 hunks)
  • tests/denops/testutil/mock_test.ts (0 hunks)
💤 Files with no reviewable changes (2)
  • tests/denops/testutil/mock.ts
  • tests/denops/testutil/mock_test.ts
✅ Files skipped from review due to trivial changes (1)
  • README.md
🔇 Additional comments (4)
.github/workflows/test.yml (3)

19-19: LGTM: Description format improvement

The change from single to double quotes in the description is a minor improvement for consistency.


37-37: LGTM: Addition of Deno v2.x support in check job

The addition of Deno v2.x to the version matrix is essential for ensuring compatibility with the new version, which aligns perfectly with the PR's objective of fixing Deno v2 compatibility issues.


72-72: Verify test coverage across Deno versions

The addition of Deno v2.x to the test matrix is crucial. However, let's ensure we're testing the specific scenarios mentioned in the PR objectives.

Let's verify the test coverage for the specific Deno v2 changes:

Consider adding specific test cases in the test suite that verify:

  1. Functionality without the rid variable
  2. Proper handling of unknown type errors
✅ Verification successful

Test coverage for Deno v2.x is comprehensive and well-structured

The test matrix is properly configured with extensive coverage:

  • Tests run across multiple Deno versions (1.45.0, 1.x, 2.x)
  • Comprehensive error handling tests are present (30+ test files with error handling patterns)
  • Tests are executed across different OS environments (Windows, macOS, Ubuntu)
  • Both type checking and runtime tests are included in the workflow
  • Code coverage reporting is enabled to track test effectiveness
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if tests cover the specific Deno v2 changes mentioned in PR
# 1. Check for tests related to 'rid' removal
# 2. Check for tests related to 'err' type changes

# Search for test cases involving 'rid'
echo "Checking for 'rid' related tests:"
rg -l 'rid' tests/

# Search for test cases involving error handling
echo "Checking for error handling tests:"
rg -l 'err.*unknown' tests/

Length of output: 210


Script:

#!/bin/bash
# Let's try a broader search to understand test coverage and Deno version handling

# Check test files for Deno version specific tests
echo "Checking for Deno version specific tests:"
rg -l "Deno" tests/

# Look for error handling patterns in tests
echo "Checking for error handling patterns:"
rg -l "throw|catch|Error" tests/

# Check the test configuration and setup
echo "Checking test configuration:"
fd -e test.ts -e test.js -e spec.ts -e spec.js

# Look at the CI workflow file to understand test matrix
echo "Examining test workflow:"
cat .github/workflows/test.yml

Length of output: 6337

denops/@denops-private/service.ts (1)

Line range hint 278-282: LGTM: Proper error handling for Deno v2 compatibility

The changes correctly address the Deno v2 compatibility issue where err is now typed as unknown. The type checking using instanceof Error ensures safe access to the error message property while providing a fallback for non-Error objects.

Copy link

codecov bot commented Nov 8, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 95.55%. Comparing base (ce5d290) to head (5b23d4d).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
denops/@denops-private/service.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #426   +/-   ##
=======================================
  Coverage   95.55%   95.55%           
=======================================
  Files          25       25           
  Lines        1416     1418    +2     
  Branches      180      180           
=======================================
+ Hits         1353     1355    +2     
  Misses         60       60           
  Partials        3        3           

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

@lambdalisue lambdalisue merged commit 0c72261 into main Nov 8, 2024
12 of 13 checks passed
@lambdalisue lambdalisue deleted the fix-for-v2 branch November 8, 2024 02:46
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