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

[sozo] feat: sozo migrate commands and new manifest tree #1767

Merged
merged 28 commits into from
Apr 4, 2024

Conversation

glihm
Copy link
Collaborator

@glihm glihm commented Apr 4, 2024

rebased on #1698.

This PR aims at refactoring manifests files generated by sozo and separating sozo migrate commands:

  1. sozo migrate plan will output the manifests files, without the on-chain data (block number, transaction hash, ...).
  2. sozo migrate apply will apply the migration strategy on-chain and update the manifests with on-chain data.

The file tree for manifests is now linked to the profile used to compile. Doing so, the configuration for a specific profile can be clearly commit into the .git + the overlays are not profile specific.

examples/spawn-and-move/manifests
└── dev
    ├── abis
    │   ├── base
    │   │   ├── contracts
    │   │   │   └── dojo_examples::actions::actions.json
    │   │   ├── dojo::world::world.json
    │   │   └── models
    │   │       ├── dojo_examples::actions::actions::moved.json
    │   │       ├── dojo_examples::models::moves.json
    │   │       └── dojo_examples::models::position.json
    │   └── deployments
    │       ├── contracts
    │       │   └── dojo_examples::actions::actions.json
    │       ├── dojo::world::world.json
    │       └── models
    │           ├── dojo_examples::actions::actions::moved.json
    │           ├── dojo_examples::models::moves.json
    │           └── dojo_examples::models::position.json
    ├── base
    │   ├── contracts
    │   │   └── dojo_examples::actions::actions.toml
    │   ├── dojo::base::base.toml
    │   ├── dojo::world::world.toml
    │   └── models
    │       ├── dojo_examples::actions::actions::moved.toml
    │       ├── dojo_examples::models::moves.toml
    │       └── dojo_examples::models::position.toml
    ├── manifest.json
    └── manifest.toml

@glihm
Copy link
Collaborator Author

glihm commented Apr 4, 2024

Windows does not support :: in files into the .git. We need to use something else.
We also use that into the generated files by the compiler. We may want to change that.

Copy link

codecov bot commented Apr 4, 2024

Codecov Report

Attention: Patch coverage is 21.51163% with 135 lines in your changes are missing coverage. Please review.

Project coverage is 66.96%. Comparing base (af7ec6e) to head (b8c8d26).

❗ Current head b8c8d26 differs from pull request most recent head 789f4cb. Consider uploading reports for the commit 789f4cb to get more accurate results

Files Patch % Lines
crates/sozo/ops/src/migration/mod.rs 0.00% 65 Missing ⚠️
bin/sozo/src/commands/migrate.rs 0.00% 40 Missing ⚠️
crates/dojo-world/src/manifest/mod.rs 37.50% 10 Missing ⚠️
crates/dojo-test-utils/src/migration.rs 0.00% 7 Missing ⚠️
crates/dojo-lang/src/compiler.rs 14.28% 6 Missing ⚠️
bin/sozo/src/commands/events.rs 0.00% 3 Missing ⚠️
crates/sozo/ops/src/events.rs 66.66% 3 Missing ⚠️
crates/dojo-lang/src/scarb_internal/mod.rs 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1767      +/-   ##
==========================================
- Coverage   67.21%   66.96%   -0.25%     
==========================================
  Files         305      305              
  Lines       33550    33640      +90     
==========================================
- Hits        22550    22527      -23     
- Misses      11000    11113     +113     

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

@glihm
Copy link
Collaborator Author

glihm commented Apr 4, 2024

Windows CI is for now disabled as we use dojo on WSL currently.

@lambda-0x next cycle we will focus on testing and reworking this part to ensure more robust testing on ops and commands. 👍

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.

2 participants