Skip to content

Conversation

@chenquan
Copy link
Collaborator

@chenquan chenquan commented Apr 30, 2025

close #286

Summary by CodeRabbit

  • New Features

    • Added support for WebSocket input sources with asynchronous connection, message handling, and graceful shutdown.
    • Introduced example configuration demonstrating WebSocket input integration with SQL processing and console output.
    • Enhanced value handling, compilation, and standard library capabilities through new dependencies.
  • Chores

    • Updated dependencies to explicit versions with additional features for improved compatibility and functionality.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 30, 2025

Warning

Rate limit exceeded

@chenquan has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 21 minutes and 28 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 2b99da7 and 2d36e3f.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • crates/arkflow-plugin/Cargo.toml (1 hunks)
  • crates/arkflow-plugin/src/input/mod.rs (2 hunks)
  • crates/arkflow-plugin/src/input/websocket.rs (1 hunks)
  • crates/arkflow-plugin/src/processor/vrl.rs (1 hunks)
  • examples/websocket_input_example.yaml (1 hunks)

Walkthrough

The changes update dependency management for the Rust project. Several dependencies, including rumqttc, Kafka-related crates, redis, and vrl, are removed from the workspace-level dependency list in Cargo.toml. In the arkflow-plugin crate, these dependencies are reintroduced as explicit, versioned dependencies with specific features enabled. Additionally, the vrl and tokio-tungstenite dependencies are added to arkflow-plugin, with the latter providing websocket support. The websocket input source is implemented and integrated into the input module initialization. A new example configuration for websocket input is added. Minor code cleanup is done in the VRL processor. No changes are made to the codebase's public APIs or exported entities beyond the new websocket input.

Changes

File(s) Change Summary
Cargo.toml Removed workspace-level dependencies for rumqttc, vrl, Kafka-related crates, and redis. Updated local crate references to omit version constraints.
crates/arkflow-plugin/Cargo.toml Changed several dependencies from workspace to explicit versioned dependencies, added vrl and tokio-tungstenite with specific features.
crates/arkflow-plugin/src/input/mod.rs Added websocket as a new public submodule and updated init function to initialize websocket input.
crates/arkflow-plugin/src/input/websocket.rs Added new websocket input implementation with async connection, reading, closing, and builder registration.
crates/arkflow-plugin/src/processor/vrl.rs Minor code cleanup: replaced unused pattern bindings with ignored variables in timestamp match arm.
examples/websocket_input_example.yaml Added example configuration for websocket input streaming through SQL processor to stdout.

Sequence Diagram(s)

sequenceDiagram
    participant ArkflowPlugin
    participant TokioTungstenite
    participant WebsocketServer

    ArkflowPlugin->>TokioTungstenite: Initiate websocket connection (URL, headers, timeout)
    TokioTungstenite->>WebsocketServer: Connect to websocket URL
    WebsocketServer-->>TokioTungstenite: Send streaming data (text/binary messages)
    TokioTungstenite-->>ArkflowPlugin: Forward received messages via channel
    ArkflowPlugin->>ArkflowPlugin: Process incoming messages as MessageBatch
Loading

Assessment against linked issues

Objective Addressed Explanation
Add websocket support using Tokio Tungstenite (#286)
Provide general WSS support with URL and data reception (#286)

Possibly related PRs

Suggested labels

enhancement

Poem

A hop and a skip, dependencies rearranged,
With websockets now, our streams are exchanged!
Tungstenite joins the warren, ready for the race,
Kafka and Redis take a quieter place.
The code hops forward, connections anew—
Streaming data for all, from me and from you!
🐇💻🌐

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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
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

🧹 Nitpick comments (1)
crates/arkflow-plugin/Cargo.toml (1)

46-70: Suggest gating optional dependencies with Cargo features
Crates like rumqttc, the Kafka stack, redis, vrl, and tokio-tungstenite are sizable and may not be needed by all users. Consider defining feature flags to make them optional:

+# In Cargo.toml
+[features]
+default = []
+mqtt = ["rumqttc"]
+kafka = ["aws-msk-iam-sasl-signer", "rdkafka", "rdkafka-sys", "sasl2-sys"]
+redis = ["redis"]
+vrl = ["vrl"]
+websocket = ["tokio-tungstenite"]

And mark each dependency as optional:

-[dependencies]
-rumqttc = "0.24.0"
+rumqttc = { version = "0.24.0", optional = true }

Repeat for the other protocol-specific crates. This approach improves build times and allows downstream consumers to opt into only the functionality they need.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0057f3a and 2b99da7.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • Cargo.toml (1 hunks)
  • crates/arkflow-plugin/Cargo.toml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: build
  • GitHub Check: build
🔇 Additional comments (6)
Cargo.toml (1)

45-46: Verify version inheritance for local crates
You removed explicit version numbers for arkflow-core and arkflow-plugin, relying solely on their path dependencies. Ensure that both crates declare version.workspace = true in their own Cargo.toml (as arkflow-plugin already does) so the workspace version propagates correctly.

crates/arkflow-plugin/Cargo.toml (5)

46-46: Approve explicit version pin for rumqttc
Pinning rumqttc to "0.24.0" ensures reproducible builds and avoids ambiguous workspace resolutions.


49-58: Approve Kafka ecosystem dependencies with explicit versioning
Introducing aws-msk-iam-sasl-signer, rdkafka (v0.37 with cmake-build, tracing, sasl, ssl-vendored, zstd), rdkafka-sys (v4.8.0), and sasl2-sys (v0.1.22 with vendored) provides a fully specified Kafka client stack and prevents workspace mismatches.


59-59: Approve explicit version and features for Redis
Pinning redis to "0.24" with tokio-comp and aio features aligns with the plugin’s async requirements.


62-63: Approve VRL dependency addition
Adding vrl v0.23.0 with value, compiler, and stdlib features readies the plugin for VRL-based transformations.


69-70: Approve WebSocket support via tokio-tungstenite
Introducing tokio-tungstenite v0.24 with the native-tls feature directly enables the requested WebSocket input capability.

@chenquan chenquan marked this pull request as draft April 30, 2025 16:56
@chenquan chenquan marked this pull request as ready for review May 2, 2025 15:53
@chenquan chenquan merged commit eb5c0f9 into main May 2, 2025
3 checks passed
@chenquan chenquan deleted the feat/websocket branch May 3, 2025 02:25
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.

Websocket support

2 participants