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(torii): sync from master torii #2851

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Larkooo
Copy link
Collaborator

@Larkooo Larkooo commented Dec 31, 2024

Summary by CodeRabbit

  • New Features

    • Added configuration options for replica settings, including master Torii URL, entity synchronization, and event message synchronization
    • Introduced default settings for replica entities and event messages
  • Chores

    • Updated import dependencies to include WorldClient from torii_grpc

@Larkooo Larkooo marked this pull request as draft December 31, 2024 09:42
Copy link

coderabbitai bot commented Dec 31, 2024

Walkthrough

Ohayo, sensei! This pull request introduces configuration enhancements for replica options and a new import for WorldClient in the Torii CLI. The changes focus on expanding the flexibility of replica synchronization settings, adding new constants and a ReplicaOptions struct to define default behaviors for entity and event message replication.

Changes

File Changes
bin/torii/src/main.rs - Added import for WorldClient from torii_grpc::client
crates/torii/cli/src/options.rs - Added constants DEFAULT_REPLICA_ENTITIES and DEFAULT_REPLICA_EVENT_MESSAGES
- Introduced ReplicaOptions struct with fields:
- master_torii: Option<Url>
- entities: bool
- event_messages: bool
- Implemented Default trait for ReplicaOptions

Possibly related PRs

Suggested reviewers

  • ponderingdemocritus

Sensei, the changes look like they're setting up some exciting groundwork for more flexible replica configurations! 🌍🔧


🪧 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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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.

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

🧹 Nitpick comments (1)
crates/torii/cli/src/options.rs (1)

325-350: Ohayo sensei! The new ReplicaOptions struct is a neat addition.

  1. Great approach to using clap to parse CLI arguments.
  2. The default implementation is consistent with the newly introduced constants.

Overall, this extends the configuration flexibility without clutter. Just ensure code coverage with tests, especially for scenarios where users override these defaults.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1c3ff08 and 4a906c1.

📒 Files selected for processing (2)
  • bin/torii/src/main.rs (1 hunks)
  • crates/torii/cli/src/options.rs (3 hunks)
🔇 Additional comments (4)
bin/torii/src/main.rs (1)

42-42: Ohayo sensei! This import looks good.

The addition of WorldClient import sets the stage for gRPC interactions with the world. No issues spotted here.

crates/torii/cli/src/options.rs (3)

5-5: Ohayo sensei! This import broadens parse utilities.

Importing parse_url appears consistent with new usage in ReplicaOptions. Good to keep code DRY by reusing an existing parse function.


10-10: Ohayo sensei! The Url import is necessary to validate external endpoints.

This ensures robust URL parsing for the new config struct. No concerns spotted.


25-26: Ohayo sensei! Defining new default constants for replica behavior.

The default true values are likely safe for most scenarios, ensuring entity and event replication by default. Just confirm if this aligns with user expectations.

Copy link

codecov bot commented Dec 31, 2024

Codecov Report

Attention: Patch coverage is 0% with 12 lines in your changes missing coverage. Please review.

Project coverage is 56.16%. Comparing base (1c3ff08) to head (4a906c1).

Files with missing lines Patch % Lines
crates/torii/cli/src/options.rs 0.00% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2851      +/-   ##
==========================================
- Coverage   56.16%   56.16%   -0.01%     
==========================================
  Files         440      440              
  Lines       56635    56647      +12     
==========================================
+ Hits        31810    31815       +5     
- Misses      24825    24832       +7     

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

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