Skip to content

Conversation

@tuler
Copy link
Member

@tuler tuler commented Jul 21, 2025

This PR allows the use of multiple config files for build, with an override strategy.
This enables something like:

cartesi-dev build -c cartesi.toml -c cartesi.mainnet.toml

Where cartesi.toml contains common configuration, and cartesi.mainnet.toml only contains values that should complement or override values in cartesi.toml. This helps to reduce code duplication, improving maintenance, like in this commit.

This PR also removes 3 properties from the config that I think could lead to confusion: interactive, store and finalHash

@tuler tuler requested a review from endersonmaia July 21, 2025 21:36
@changeset-bot
Copy link

changeset-bot bot commented Jul 21, 2025

🦋 Changeset detected

Latest commit: 9a602ce

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cartesi/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Jul 21, 2025

Coverage Report for ./apps/cli

Status Category Percentage Covered / Total
🔵 Lines 25.29% 280 / 1107
🔵 Statements 25.19% 285 / 1131
🔵 Functions 25.77% 50 / 194
🔵 Branches 21.78% 112 / 514
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
apps/cli/src/base.ts 0% 0% 0% 0% 31-153
apps/cli/src/config.ts 89.26% 77.22% 94.11% 89.08% 66-67, 220, 228, 238, 258, 271, 281, 284, 294, 335, 346-350, 362, 546, 568-573
apps/cli/src/machine.ts 0% 0% 0% 0% 5-124
apps/cli/src/commands/build.ts 0% 0% 0% 0% 26-153
apps/cli/src/commands/shell.ts 0% 0% 0% 0% 8-59
Generated in workflow #638 for commit 9a602ce by the Vitest Coverage Report Action

@endersonmaia
Copy link
Contributor

Using honeypot branch to test, I get the following error but it's not clear what is the problem:

❯ cartesi-dev build -c cartesi.toml -c cartesi.mainnet.toml
✔ Build drives
  ✔ Build drive root
  ✔ Build drive state
✖ Invalid state: WritableStream is locked
Invalid state: WritableStream is locked

Copy link
Contributor

@endersonmaia endersonmaia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tuler tuler force-pushed the feature/use-docker-machine branch from 11a7966 to a2f1448 Compare July 22, 2025 20:39
Base automatically changed from feature/use-docker-machine to prerelease/v2-alpha July 22, 2025 20:39
@tuler tuler force-pushed the feature/merge-multiple-config branch from 26a32ad to 9a602ce Compare July 22, 2025 20:40
@tuler tuler merged commit eee7731 into prerelease/v2-alpha Jul 22, 2025
4 checks passed
@tuler tuler deleted the feature/merge-multiple-config branch July 22, 2025 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants