Closed kaimen-sano closed 5 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 88.56%. Comparing base (
1aec306
) to head (3be1380
). Report is 1 commits behind head on release/v2_contracts.:exclamation: Current head 3be1380 differs from pull request most recent head 755c4bd. Consider uploading reports for the commit 755c4bd to get more accurate results
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Elected to exclude xtask
from Tarpaulin here. It is not a critical piece of software for us to test.
Schema generation failed. Please run just schemas
locally and upload the generated schemas.
Schema generation had missing jobs:
``${diffSchemas}```` Please run
just schemas` locally and upload the generated schemas.
Schema generation had missing jobs:
contracts/liquidity_hub/fee_collector/schema/raw/query.json
Please run just schemas
locally and upload the generated schemas.
Schema generation had missing jobs:
Please run just schemas
locally and upload the generated schemas.
Schema generation had missing jobs:
contracts/liquidity_hub/pool-manager/schema/raw/execute.json
contracts/liquidity_hub/pool-manager/schema/pool-manager.json
Please run just schemas
locally and upload the generated schemas.
Good to review, finally :)
LGTM great work never heard of xtask until now but looks like its even used by Cargo 🤯
It was a great find to run scripts for the workspace that need access to our Rust interfaces. I was also not aware of how widespread the pattern is in the Rust ecosystem, but it certainly looks like a nice complement to just
for our case.
:shipit: @kaimen-sano
Description and Motivation
We currently generate schemas by having a binary
schema.rs
on each contract which will use thecosmwasm_schema
API to write a schema.While this works, it requires us to maintain the binary for each contract. This is tedious (extra files per contract, including a
.cargo
alias definition), and also requires us to correctly use thecosmwasm_schema
per contract. Additionally, we were getting Cargo binary name collisions:This PR aims to standardize the process of creating a schema for a contract by moving the logic to a new
xtask
:generate_schemas
. This task will generate all the schema files for the entire workspace at once.This is similar work to the previous
just schemas
(which was broken), however we now get the benefit of being able to remove the binary from each contract. This could potentially speed up compile times.This PR also moves the schema PR workflow check to a new workflow file, and aims to add a comment to the PR if the schemas failed.
Checklist:
Update index.md
)cargo fmt --all --
.cargo clippy -- -D warnings
.just schemas
.