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: remove dojo plugin dep #2461

Merged
merged 3 commits into from
Sep 22, 2024
Merged

fix: remove dojo plugin dep #2461

merged 3 commits into from
Sep 22, 2024

Conversation

glihm
Copy link
Collaborator

@glihm glihm commented Sep 20, 2024

For historical reasons, we were fetching the dojo plugin with scarb. However, the plugin is actually loaded in sozo binary.

Hence, we don't need to fetch this plugin, which will also allow decoupling of Dojo core in an other repo and ease the fetch of Dojo core by downstream usages in game development.

Summary by CodeRabbit

  • New Features

    • Simplified metadata gathering logic based on package dependencies.
    • Introduced a new pathway for loading metadata from a profile configuration file.
  • Chores

    • Removed the dojo_plugin dependency to streamline project management.

Copy link

coderabbitai bot commented Sep 20, 2024

Walkthrough

Ohayo, sensei! The recent changes involve modifications to the Scarb.toml file and the metadata.rs file in the dojo project. The Scarb.toml file has had the dependency on dojo_plugin removed, simplifying the project's dependency management. In metadata.rs, the logic for gathering metadata has been altered to focus solely on the "dojo" dependency, introducing a new pathway for metadata extraction based on a profile configuration file.

Changes

File Change Summary
crates/dojo-core/Scarb.toml Removed dependency on dojo_plugin, simplifying dependency management.
crates/dojo-world/src/metadata.rs Modified dojo_metadata_from_package function to check only for "dojo" dependency and introduced logic for loading a profile configuration file.

Sequence Diagram(s)

sequenceDiagram
    participant Package
    participant MetadataFunction
    participant ProfileConfig

    Package->>MetadataFunction: Check for "dojo" dependency
    alt Dependency exists
        MetadataFunction->>Package: Gather metadata
    else Dependency does not exist
        MetadataFunction->>ProfileConfig: Attempt to load profile configuration
        alt Profile config found
            ProfileConfig-->>MetadataFunction: Provide default namespace
            MetadataFunction->>Package: Create DojoMetadata with namespace
        else Profile config not found
            MetadataFunction->>Package: Return default DojoMetadata
        end
    end
Loading

Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7ff6593 and 8c30488.

Files ignored due to path filters (2)
  • crates/dojo-core/Scarb.lock is excluded by !**/*.lock
  • examples/spawn-and-move/Scarb.lock is excluded by !**/*.lock
Files selected for processing (2)
  • crates/dojo-core/Scarb.toml (0 hunks)
  • crates/dojo-world/src/metadata.rs (1 hunks)
Files not reviewed due to no reviewable changes (1)
  • crates/dojo-core/Scarb.toml
Additional comments not posted (1)
crates/dojo-world/src/metadata.rs (1)

76-91: Ohayo, sensei! The changes to dojo_metadata_from_package look great!

The simplified check for the "dojo" dependency and the new fallback mechanism to load metadata from the profile configuration file enhance the flexibility and robustness of the metadata gathering process. This ensures that metadata can be collected even in scenarios where the package doesn't have a direct "dojo" dependency, such as in tests.

The trace logging is also a nice touch, providing visibility into cases where neither the "dojo" dependency nor the profile configuration file is found, which aids in debugging and understanding the flow of metadata gathering.


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.

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

codecov bot commented Sep 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.32%. Comparing base (82a23a5) to head (8c30488).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2461      +/-   ##
==========================================
+ Coverage   68.29%   68.32%   +0.02%     
==========================================
  Files         365      365              
  Lines       48034    48040       +6     
==========================================
+ Hits        32805    32821      +16     
+ Misses      15229    15219      -10     

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

@glihm glihm merged commit 86dbd44 into main Sep 22, 2024
15 checks passed
@glihm glihm deleted the fix/rm-plugin-dep branch September 22, 2024 00:12
@coderabbitai coderabbitai bot mentioned this pull request Oct 30, 2024
2 tasks
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