-
Notifications
You must be signed in to change notification settings - Fork 182
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
refactor: update manifest structure #2153
Conversation
WalkthroughThe changes focus on updating directory paths and constants used for storing and organizing manifests and ABIs across various modules. The constants for Changes
Poem
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
d6fa87e
to
9763ffa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (40)
- bin/sozo/src/commands/clean.rs (10 hunks)
- bin/sozo/src/commands/migrate.rs (1 hunks)
- crates/benches/src/deployer.rs (2 hunks)
- crates/dojo-lang/src/compiler.rs (4 hunks)
- crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/ccf-cairo_v240-8d921297.toml (1 hunks)
- crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/ccf-cairo_v260-465ec7fe.toml (1 hunks)
- crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-base.toml (1 hunks)
- crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-world.toml (1 hunks)
- crates/dojo-world/src/manifest/mod.rs (1 hunks)
- crates/dojo-world/src/metadata_test.rs (1 hunks)
- crates/sozo/ops/src/migration/migrate.rs (4 hunks)
- crates/torii/core/src/sql_test.rs (1 hunks)
- examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-actions-40b6994c.toml (1 hunks)
- examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-mock_token-31599eb2.toml (1 hunks)
- examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-others-61de2c18.toml (1 hunks)
- examples/spawn-and-move/manifests/dev/base/dojo-base.toml (1 hunks)
- examples/spawn-and-move/manifests/dev/base/dojo-world.toml (1 hunks)
- examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ContractInitialized-376b7bd6.toml (1 hunks)
- examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Message-1bb1d226.toml (1 hunks)
- examples/spawn-and-move/manifests/dev/base/models/dojo_examples-MockToken-38903c7c.toml (1 hunks)
- examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moved-318ae40d.toml (1 hunks)
- examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moves-2e2accba.toml (1 hunks)
- examples/spawn-and-move/manifests/dev/base/models/dojo_examples-PlayerConfig-3adad785.toml (1 hunks)
- examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Position-1e145e26.toml (1 hunks)
- examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ServerProfile-4caad1e6.toml (1 hunks)
- examples/spawn-and-move/manifests/dev/deployment/manifest.json (1 hunks)
- examples/spawn-and-move/manifests/dev/deployment/manifest.toml (13 hunks)
- examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-actions-40b6994c.toml (1 hunks)
- examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-mock_token-31599eb2.toml (1 hunks)
- examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-others-61de2c18.toml (1 hunks)
- examples/spawn-and-move/manifests/release/base/dojo-base.toml (1 hunks)
- examples/spawn-and-move/manifests/release/base/dojo-world.toml (1 hunks)
- examples/spawn-and-move/manifests/release/base/models/dojo_examples-ContractInitialized-376b7bd6.toml (1 hunks)
- examples/spawn-and-move/manifests/release/base/models/dojo_examples-Message-1bb1d226.toml (1 hunks)
- examples/spawn-and-move/manifests/release/base/models/dojo_examples-MockToken-38903c7c.toml (1 hunks)
- examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moved-318ae40d.toml (1 hunks)
- examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moves-2e2accba.toml (1 hunks)
- examples/spawn-and-move/manifests/release/base/models/dojo_examples-PlayerConfig-3adad785.toml (1 hunks)
- examples/spawn-and-move/manifests/release/base/models/dojo_examples-Position-1e145e26.toml (1 hunks)
- examples/spawn-and-move/manifests/release/base/models/dojo_examples-ServerProfile-4caad1e6.toml (1 hunks)
Files skipped from review due to trivial changes (25)
- crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/ccf-cairo_v260-465ec7fe.toml
- crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-world.toml
- crates/dojo-world/src/metadata_test.rs
- crates/torii/core/src/sql_test.rs
- examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-actions-40b6994c.toml
- examples/spawn-and-move/manifests/dev/base/dojo-base.toml
- examples/spawn-and-move/manifests/dev/base/dojo-world.toml
- examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ContractInitialized-376b7bd6.toml
- examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Message-1bb1d226.toml
- examples/spawn-and-move/manifests/dev/base/models/dojo_examples-MockToken-38903c7c.toml
- examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moves-2e2accba.toml
- examples/spawn-and-move/manifests/dev/base/models/dojo_examples-PlayerConfig-3adad785.toml
- examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ServerProfile-4caad1e6.toml
- examples/spawn-and-move/manifests/dev/deployment/manifest.json
- examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-mock_token-31599eb2.toml
- examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-others-61de2c18.toml
- examples/spawn-and-move/manifests/release/base/dojo-base.toml
- examples/spawn-and-move/manifests/release/base/dojo-world.toml
- examples/spawn-and-move/manifests/release/base/models/dojo_examples-ContractInitialized-376b7bd6.toml
- examples/spawn-and-move/manifests/release/base/models/dojo_examples-Message-1bb1d226.toml
- examples/spawn-and-move/manifests/release/base/models/dojo_examples-MockToken-38903c7c.toml
- examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moved-318ae40d.toml
- examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moves-2e2accba.toml
- examples/spawn-and-move/manifests/release/base/models/dojo_examples-Position-1e145e26.toml
- examples/spawn-and-move/manifests/release/base/models/dojo_examples-ServerProfile-4caad1e6.toml
Additional comments not posted (25)
crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-base.toml (1)
4-4
: Verify the correctness of the new ABI path.Ensure that the new path
manifests/dev/base/abis/dojo-base.json
is correct and consistent with the updated directory structure.Verification successful
The new ABI path is correct and the file exists at the specified location.
crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/abis/dojo-base.json
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of the new ABI path. # Test: Check if the ABI file exists at the new path. if [ ! -f "crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/abis/dojo-base.json" ]; then echo "ABI file not found at the new path." exit 1 else echo "ABI file found at the new path." fiLength of output: 183
crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/ccf-cairo_v240-8d921297.toml (1)
5-5
: Verify the correctness of the new ABI path.Ensure that the new path
manifests/dev/base/abis/contracts/ccf-cairo_v240-8d921297.json
is correct and consistent with the updated directory structure.Verification successful
The new ABI path is correct.
The ABI file exists at the specified path, confirming its correctness.
- Path:
crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/abis/contracts/ccf-cairo_v240-8d921297.json
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of the new ABI path. # Test: Check if the ABI file exists at the new path. if [ ! -f "crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/abis/contracts/ccf-cairo_v240-8d921297.json" ]; then echo "ABI file not found at the new path." exit 1 else echo "ABI file found at the new path." fiLength of output: 207
examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-others-61de2c18.toml (1)
5-5
: Verify the correctness of the new ABI path.Ensure that the new path
manifests/dev/base/abis/contracts/dojo_examples-others-61de2c18.json
is correct and consistent with the updated directory structure.Verification successful
The new ABI path is correct.
The ABI file exists at the specified path
examples/spawn-and-move/manifests/dev/base/abis/contracts/dojo_examples-others-61de2c18.json
.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of the new ABI path. # Test: Check if the ABI file exists at the new path. if [ ! -f "examples/spawn-and-move/manifests/dev/base/abis/contracts/dojo_examples-others-61de2c18.json" ]; then echo "ABI file not found at the new path." exit 1 else echo "ABI file found at the new path." fiLength of output: 182
examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-actions-40b6994c.toml (1)
5-5
: Verify the correctness of the new ABI path.Ensure that the new path
manifests/release/base/abis/contracts/dojo_examples-actions-40b6994c.json
is correct and consistent with the updated directory structure.Verification successful
The new ABI path is correct and consistent with the updated directory structure.
- The ABI file exists at the specified path.
- There are no conflicting references to the ABI path in the codebase.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of the new ABI path. # Test: Check if the ABI file exists at the new path. if [ ! -f "examples/spawn-and-move/manifests/release/base/abis/contracts/dojo_examples-actions-40b6994c.json" ]; then echo "ABI file not found at the new path." exit 1 else echo "ABI file found at the new path." fiLength of output: 187
Script:
#!/bin/bash # Description: Search for references to the ABI path in the codebase to ensure it is correctly used. # Test: Search for the ABI path in the codebase. rg "manifests/release/base/abis/contracts/dojo_examples-actions-40b6994c.json"Length of output: 253
examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-mock_token-31599eb2.toml (1)
5-5
: Verify the new ABI path.Ensure that the new ABI path
manifests/dev/base/abis/contracts/dojo_examples-mock_token-31599eb2.json
is correct and consistent with the updated structure.Verification successful
The new ABI path is verified and correct.
- The ABI path
examples/spawn-and-move/manifests/dev/base/abis/contracts/dojo_examples-mock_token-31599eb2.json
exists and is consistent with the updated structure.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of the new ABI path. # Test: Check if the new ABI path exists. expected_path="examples/spawn-and-move/manifests/dev/base/abis/contracts/dojo_examples-mock_token-31599eb2.json" if [ ! -f "$expected_path" ]; then echo "Error: ABI path $expected_path does not exist." exit 1 fi echo "ABI path $expected_path verified."Length of output: 467
examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moved-318ae40d.toml (1)
4-4
: Verify the new ABI path.Ensure that the new ABI path
manifests/dev/base/abis/models/dojo_examples-Moved-318ae40d.json
is correct and consistent with the updated structure.Verification successful
ABI path verified.
The ABI path
manifests/dev/base/abis/models/dojo_examples-Moved-318ae40d.json
is correct and exists in the updated structure.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of the new ABI path. # Test: Check if the new ABI path exists. expected_path="examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Moved-318ae40d.json" if [ ! -f "$expected_path" ]; then echo "Error: ABI path $expected_path does not exist." exit 1 fi echo "ABI path $expected_path verified."Length of output: 435
examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Position-1e145e26.toml (1)
4-4
: Verify the new ABI path.Ensure that the new ABI path
manifests/dev/base/abis/models/dojo_examples-Position-1e145e26.json
is correct and consistent with the updated structure.Verification successful
The new ABI path has been verified and is correct.
- The file
examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Position-1e145e26.json
exists and is correctly referenced.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of the new ABI path. # Test: Check if the new ABI path exists. expected_path="examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Position-1e145e26.json" if [ ! -f "$expected_path" ]; then echo "Error: ABI path $expected_path does not exist." exit 1 fi echo "ABI path $expected_path verified."Length of output: 447
examples/spawn-and-move/manifests/release/base/models/dojo_examples-PlayerConfig-3adad785.toml (1)
4-4
: Verify the new ABI path.Ensure that the new ABI path
manifests/release/base/abis/models/dojo_examples-PlayerConfig-3adad785.json
is correct and consistent with the updated structure.Verification successful
The new ABI path is correct and has been verified.
- The ABI path
examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-PlayerConfig-3adad785.json
has been confirmed to exist.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of the new ABI path. # Test: Check if the new ABI path exists. expected_path="examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-PlayerConfig-3adad785.json" if [ ! -f "$expected_path" ]; then echo "Error: ABI path $expected_path does not exist." exit 1 fi echo "ABI path $expected_path verified."Length of output: 479
crates/benches/src/deployer.rs (2)
8-8
: LGTM! Import statement changes are correct.The added import statements for
DeploymentManifest
,DEPLOYMENT_DIR
, andMANIFESTS_DIR
are necessary for the updated functionality.
100-100
: Ensure the path manipulation logic is correct.The usage of
DEPLOYMENT_DIR
andMANIFESTS_DIR
in the path manipulation logic appears correct. Verify that the constructed path is valid and the expected file exists.bin/sozo/src/commands/migrate.rs (1)
84-87
: LGTM! Logic changes are correct.The updated logic for checking profile-specific directories is necessary for the new structure.
However, verify that the profile name is correctly obtained and the directory exists.
Verification successful
Verification successful.
The profile name is correctly obtained, and the directory existence check is properly implemented.
bin/sozo/src/commands/migrate.rs
: Profile name retrieval and directory existence check confirmed.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the profile name retrieval and directory existence check in `MigrateArgs`. # Test: Ensure the profile name is correctly obtained and the directory exists. rg --type rust 'ws.current_profile\(\).expect\("Scarb profile expected to be defined."\).to_string\(\)'Length of output: 609
Script:
#!/bin/bash # Description: Verify the directory existence check for profile-specific directories. # Test: Ensure the directory existence check is correctly implemented. rg --type rust 'manifest_dir.join\(MANIFESTS_DIR\).join\(profile_name\).exists\(\)'Length of output: 193
bin/sozo/src/commands/clean.rs (1)
6-6
: LGTM! Directory changes are correct.The updated directories being cleaned align with the new structure.
However, verify that the new directories are correctly handled and cleaned.
Also applies to: 31-31, 99-100, 152-152, 156-156, 166-166, 177-177, 205-214, 228-228, 232-232, 241-241, 252-252
Verification successful
Let's perform a more detailed search to verify if
DEPLOYMENT_DIR
andMANIFESTS_DIR
are being handled correctly in the codebase.
Verified: The new directories are correctly handled and cleaned.
The search results confirm that
DEPLOYMENT_DIR
andMANIFESTS_DIR
are being appropriately used and cleaned in the codebase, including inclean.rs
.
clean.rs
correctly includesDEPLOYMENT_DIR
andMANIFESTS_DIR
in its operations.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the handling and cleaning of new directories in `clean.rs`. # Test: Ensure the new directories are correctly handled and cleaned. rg --type rust 'profile_dir.join\((BASE_DIR|DEPLOYMENT_DIR|MANIFESTS_DIR)\)'Length of output: 162
Script:
#!/bin/bash # Description: Verify the handling and cleaning of DEPLOYMENT_DIR and MANIFESTS_DIR in the codebase. # Search for DEPLOYMENT_DIR and MANIFESTS_DIR usage in the codebase. rg --type rust 'DEPLOYMENT_DIR' rg --type rust 'MANIFESTS_DIR'Length of output: 5196
crates/dojo-lang/src/compiler.rs (4)
229-230
: LGTM! The base directories for manifests and ABI files are correctly set.The new variables
base_manifests_dir
andbase_abis_dir
are correctly initialized with the updated directory paths.
252-253
: LGTM! The new base directories are correctly used in thewrite_manifest_and_abi
function call.The function call to
write_manifest_and_abi
correctly uses the new base directories for manifests and ABI files.
339-340
: LGTM! The new base directories are correctly used in thewrite_manifest_and_abi
function call.The function call to
write_manifest_and_abi
correctly uses the new base directories for manifests and ABI files.
365-366
: LGTM! The new base directories are correctly used in thewrite_manifest_and_abi
function call.The function call to
write_manifest_and_abi
correctly uses the new base directories for manifests and ABI files.crates/dojo-world/src/manifest/mod.rs (1)
44-44
: LGTM! The new constantDEPLOYMENT_DIR
is correctly defined.The new constant
DEPLOYMENT_DIR
aligns with the updated directory structure.crates/sozo/ops/src/migration/migrate.rs (8)
810-811
: LGTM! The deployment directory is correctly set.The variable
deployment_dir
is correctly initialized with the updated directory path.
812-813
: LGTM! The paths for deployed manifests are correctly set.The variables
deployed_path
anddeployed_path_json
are correctly initialized with the updated directory paths.
867-867
: LGTM! The function call toupdate_manifest_abis
correctly uses the updated directory paths.The function call to
update_manifest_abis
correctly uses the updated directory paths.
893-894
: LGTM! The base relative path for ABI files is correctly set.The variable
base_relative_path
is correctly initialized with the updated directory path.
899-899
: LGTM! The base relative path is correctly stripped of the profile name.The variable
base_relative_path
is correctly stripped of the profile name.
901-901
: LGTM! The base relative path is correctly stripped of the base directory.The variable
stripped_path
is correctly initialized with the updated directory path.
904-906
: LGTM! The deployed relative path for ABI files is correctly set.The variable
deployed_relative_path
is correctly initialized with the updated directory path.
908-911
: LGTM! The full paths for base and deployed ABI files are correctly set.The variables
full_base_path
andfull_deployed_path
are correctly initialized with the updated directory paths.
There was a problem hiding this 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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (5)
- crates/dojo-world/src/manifest/mod.rs (2 hunks)
- crates/dojo-world/src/metadata.rs (2 hunks)
- crates/sozo/ops/src/migration/migrate.rs (5 hunks)
- examples/spawn-and-move/manifests/dev/deployment/manifest.json (1 hunks)
- examples/spawn-and-move/manifests/dev/deployment/manifest.toml (13 hunks)
Files skipped from review due to trivial changes (1)
- crates/dojo-world/src/metadata.rs
Files skipped from review as they are similar to previous changes (4)
- crates/dojo-world/src/manifest/mod.rs
- crates/sozo/ops/src/migration/migrate.rs
- examples/spawn-and-move/manifests/dev/deployment/manifest.json
- examples/spawn-and-move/manifests/dev/deployment/manifest.toml
There was a problem hiding this 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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- bin/sozo/src/commands/clean.rs (12 hunks)
- crates/dojo-world/src/metadata.rs (1 hunks)
Files skipped from review as they are similar to previous changes (2)
- bin/sozo/src/commands/clean.rs
- crates/dojo-world/src/metadata.rs
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2153 +/- ##
==========================================
- Coverage 67.75% 67.62% -0.14%
==========================================
Files 336 336
Lines 43152 43219 +67
==========================================
- Hits 29237 29226 -11
- Misses 13915 13993 +78 ☔ View full report in Codecov by Sentry. |
Description
from:
to:
Summary by CodeRabbit
Bug Fixes
Refactor
Tests
Chores