Skip to content

chore: make scripts more consistent#1033

Merged
cedoor merged 8 commits into
mainfrom
chore/testing-scripts
Nov 20, 2025
Merged

chore: make scripts more consistent#1033
cedoor merged 8 commits into
mainfrom
chore/testing-scripts

Conversation

@cedoor

@cedoor cedoor commented Nov 20, 2025

Copy link
Copy Markdown
Contributor

Closes #809

Summary by CodeRabbit

  • Documentation

    • Added a comprehensive "Testing" section to README with pnpm-based instructions and examples for running language-specific and integration test suites.
  • Chores

    • Reorganized build/lint/test scripts into language- and package-scoped pipelines (introducing Rust and Noir script targets).
    • Updated CI lint steps to use the new Rust lint check.
    • Consolidated package prebuild steps to use pnpm-driven cross-package builds.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel

vercel Bot commented Nov 20, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
crisp Ready Ready Preview Comment Nov 20, 2025 0:19am
enclave-docs Ready Ready Preview Comment Nov 20, 2025 0:19am

@coderabbitai

coderabbitai Bot commented Nov 20, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Updated CI and npm scripts to replace legacy ciphernode/circuit targets with language-specific targets (Rust/Noir/EVM); added Testing documentation to README; adjusted package prebuild to use pnpm -C invocations.

Changes

Cohort / File(s) Summary
CI workflow updates
.github/workflows/ci.yml
Renamed CI lint steps from "Checking code format ciphernode" to "Checking code format rust" and changed commands from pnpm ciphernode:lint to pnpm rust:lint in Rust-focused jobs.
Root package scripts
package.json
Reworked top-level scripts to language-scoped targets: compile now runs pnpm build:ts && pnpm rust:build; lint/test split into evm, rust, noir, sdk targets; added rust:lint, rust:test, rust:build, prerust:build, noir:lint, noir:test; removed ciphernode-specific scripts and converted many commands to pnpm -C <path> ....
SDK package prebuild
packages/enclave-sdk/package.json
Replaced cd-based chained prebuild with pnpm-driven invocation: pnpm -C ../enclave-contracts build && pnpm -C ../../ wasm:build.
Testing documentation
README.md
Added a "Testing" section describing recommended pnpm test scripts (pnpm test, pnpm rust:test, pnpm evm:test, pnpm sdk:test, pnpm noir:test, pnpm test:integration) and examples for running suites.

Sequence Diagram(s)

sequenceDiagram
  participant Dev as Developer / CI
  participant PNPM as pnpm
  participant EVM as packages/enclave-contracts
  participant RUST as crates/... (Rust)
  participant NOIR as noir-projects

  rect `#f3f4f6`
  Dev->>PNPM: trigger CI job or run `pnpm test` / `pnpm rust:lint`
  end

  alt Top-level test flow
    PNPM->>PNPM: resolve `test` -> run per-target scripts
    PNPM->>EVM: `pnpm -C packages/enclave-contracts test`
    PNPM->>RUST: `pnpm rust:test` / `pnpm -C crates/... build`
    PNPM->>NOIR: `pnpm noir:test`
  else CI lint update
    PNPM->>RUST: `pnpm rust:lint`  -- replaces `pnpm ciphernode:lint`
  end

  Note over PNPM,Dev: Results reported back to CI / Developer
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify CI job names and step labels align with the new script names.
  • Check pnpm -C paths for correctness (root, packages/enclave-contracts, crates/wasm, packages/enclave-sdk).
  • Search repository for leftover references to ciphernode:* or old circuit script names.

Possibly related PRs

Suggested labels

chore, documentation

Suggested reviewers

  • ryardley
  • ctrlc03

Poem

🐰 I hopped through scripts and swapped an old command,
pnpm in paw, I tidied up the land.
CI now chants "rust:lint" in place of cipher lore,
tests neatly named — I jig and thump for more! 🥕

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore: make scripts more consistent' accurately describes the main change: reorganizing and clarifying pnpm scripts across the monorepo by replacing ciphernode scripts with language-specific equivalents (rust, noir, evm) and updating CI workflows.
Linked Issues check ✅ Passed The PR successfully addresses issue #809 requirements: scripts are renamed to reflect actual behavior (ciphernode→rust/noir/evm), documentation is improved (README testing section), all operations route through pnpm, and script names now clarify scope and reduce confusion.
Out of Scope Changes check ✅ Passed All changes are directly aligned with issue #809 objectives: CI workflow updates, script reorganization, documentation additions, and package.json restructuring all support the goal of clarifying and making scripts more consistent without introducing unrelated functionality.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/testing-scripts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)

49-49: Remove extraneous blank line.

Line 49 introduces an unnecessary blank line after the solc installation step. This appears to be unintended formatting.

      - name: Install solc
        run: |
          sudo add-apt-repository ppa:ethereum/ethereum \
          && sudo apt-get update -y \
          && sudo apt-get install -y solc
-
      - name: Run CRISP Unit Tests
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 56e089e and 8f38dd3.

📒 Files selected for processing (4)
  • .github/workflows/ci.yml (3 hunks)
  • README.md (1 hunks)
  • package.json (1 hunks)
  • packages/enclave-sdk/package.json (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2024-10-23T01:59:42.967Z
Learnt from: ryardley
Repo: gnosisguild/enclave PR: 156
File: packages/ciphernode/tests/tests/test_aggregation_and_decryption.rs:274-274
Timestamp: 2024-10-23T01:59:42.967Z
Learning: In the `packages/ciphernode/tests/tests/test_aggregation_and_decryption.rs` file and other test files within this project, hardcoding `CIPHERNODE_SECRET` is acceptable for testing purposes.

Applied to files:

  • README.md
📚 Learning: 2025-08-25T10:28:56.174Z
Learnt from: ctrlc03
Repo: gnosisguild/enclave PR: 657
File: Cargo.toml:32-34
Timestamp: 2025-08-25T10:28:56.174Z
Learning: The examples/CRISP directory has its own Cargo.toml workspace configuration with members like "server", "wasm-crypto", "program/core", "program/client", etc. The root workspace intentionally excludes "examples/CRISP/server", "examples/CRISP/program", and "examples/CRISP/wasm-crypto" to prevent double workspace membership, which is the correct approach for self-contained example workspaces.

Applied to files:

  • .github/workflows/ci.yml
📚 Learning: 2024-10-22T02:36:01.448Z
Learnt from: ryardley
Repo: gnosisguild/enclave PR: 145
File: packages/ciphernode/data/Cargo.toml:0-0
Timestamp: 2024-10-22T02:36:01.448Z
Learning: In `packages/ciphernode/data/Cargo.toml`, `actix-rt` is only used in tests and should remain in `[dev-dependencies]`.

Applied to files:

  • .github/workflows/ci.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: build_e3_support_dev
  • GitHub Check: test_contracts
  • GitHub Check: build_enclave_cli
  • GitHub Check: build_e3_support_risc0
  • GitHub Check: build_sdk
  • GitHub Check: rust_unit
  • GitHub Check: crisp_rust_unit
  • GitHub Check: rust_integration
🔇 Additional comments (8)
README.md (1)

46-91: Documentation is comprehensive and well-structured.

The new Testing section clearly documents the available test commands and provides helpful examples. The warning about using pnpm scripts is appropriate and the --no-prebuild flag for integration tests adds practical guidance.

Verify that all documented scripts (lines 54–87) are correctly defined in the root package.json and that the test:integration script actually supports the --no-prebuild flag.

package.json (4)

55-57: Verify build and wasm:build script order and existence.

Line 55 defines build: "pnpm compile" and line 57 adds wasm:build: "pnpm -C ./crates/wasm build". The main build script references compile (line 14), which runs pnpm build:ts && pnpm rust:build. However, wasm:build is not directly invoked by the root build script. Verify whether:

  1. The WASM build is intentionally separate from the root build process
  2. Or if wasm:build should be integrated into the build:ts or main build chain

Clarify the relationship between build, compile, build:ts, rust:build, and wasm:build.


25-29: Fix broken evm:install script delegation in package.json.

The verification found that evm:install (line 37) targets packages/enclave-contracts and attempts to delegate to an install script, but that script does not exist in the target package's package.json. All other pnpm delegations in lines 25–56 are valid.

Correct the script target for evm:install or add the missing install script to packages/enclave-contracts/package.json.

⛔ Skipped due to learnings
Learnt from: ryardley
Repo: gnosisguild/enclave PR: 145
File: packages/ciphernode/data/Cargo.toml:0-0
Timestamp: 2024-10-22T02:36:01.448Z
Learning: In `packages/ciphernode/data/Cargo.toml`, `actix-rt` is only used in tests and should remain in `[dev-dependencies]`.
Learnt from: ryardley
Repo: gnosisguild/enclave PR: 156
File: packages/ciphernode/tests/tests/test_aggregation_and_decryption.rs:274-274
Timestamp: 2024-10-23T01:59:42.967Z
Learning: In the `packages/ciphernode/tests/tests/test_aggregation_and_decryption.rs` file and other test files within this project, hardcoding `CIPHERNODE_SECRET` is acceptable for testing purposes.

14-20: Script delegation and paths are correctly configured.

All verification checks passed:

  • tests/integration/test.sh exists
  • scripts/test-circuits.sh and scripts/lint-circuits.sh exist
  • All pnpm -C delegation targets (packages/enclave-contracts, packages/enclave-sdk, packages/enclave-react, crates/wasm, packages/enclave-config) have valid package.json files with corresponding scripts
  • The prerust:build lifecycle hook is properly configured to run pnpm evm:build before rust:build
  • No old ciphernode script references remain in package.json
  • Root lint command (pnpm evm:lint && pnpm rust:lint && pnpm noir:lint) references only existing, properly delegated targets

The refactoring successfully modularizes the build system without breaking any script dependencies.


30-31: No build dependency issues found—review comment is incorrect.

The prerust:build lifecycle hook is working as intended. Verification confirms:

  • prerust:build correctly executes pnpm evm:build before rust:build
  • evm:build has no Rust artifact dependencies (Solidity + TypeScript compilation only)
  • rust:build has no dependency on EVM outputs (Cargo.toml contains only Rust crates)
  • No circular dependencies exist—the build systems are independent and properly orchestrated

Likely an incorrect or invalid review comment.

.github/workflows/ci.yml (3)

91-92: Lint command naming and implementation are now consistent with language-specific scripts.

The step label and command have been updated from ciphernode to rust (lines 91–92), aligning with the new pnpm rust:lint script defined in the root package.json (line 24). This change correctly reflects the shift to language-specific tooling.


134-135: Lint command naming and implementation are now consistent with language-specific scripts.

The step label and command have been updated from ciphernode to rust (lines 134–135), consistent with the rust_unit job (lines 91–92) and the new pnpm rust:lint script. This ensures uniformity across Rust-related CI jobs.


1-750: No remaining ciphernode:lint references found—PR changes verified.

Verification confirms that:

  • No ciphernode:lint command references exist in the CI workflow
  • Lint commands in both rust_unit and rust_integration jobs are properly using pnpm rust:lint
  • The only ciphernode mention is the job name ciphernode_integration_test: on line 305, which is unrelated to lint commands

The PR has successfully removed all legacy lint command references.

Comment thread packages/enclave-sdk/package.json Outdated
@vercel vercel Bot temporarily deployed to Preview – crisp November 20, 2025 10:45 Inactive
@vercel vercel Bot temporarily deployed to Preview – enclave-docs November 20, 2025 10:45 Inactive
ctrlc03
ctrlc03 previously approved these changes Nov 20, 2025

@ctrlc03 ctrlc03 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

utACK

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
README.md (1)

49-94: Documentation clearly addresses PR objectives and provides helpful guidance.

The new Testing section properly emphasizes the requirement to use pnpm scripts over direct tool invocation, and comprehensively documents the available test scripts. The note on line 51 about required setup steps aligns well with the PR's stated objective to "require all crate operations to run via pnpm."

However, a few minor clarifications would improve clarity:

  • Line 64: Could specify what types of tests rust:test runs (e.g., "unit, integration, and doc tests")
  • Line 51: Could briefly mention examples of setup (e.g., "e.g., compiling smart contracts, building binaries")

Consider expanding the setup explanation in the warning to make it more concrete and actionable for contributors unfamiliar with the build process.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 652a269 and 4de027d.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml (2 hunks)
  • README.md (1 hunks)
  • package.json (2 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2024-10-22T02:36:01.448Z
Learnt from: ryardley
Repo: gnosisguild/enclave PR: 145
File: packages/ciphernode/data/Cargo.toml:0-0
Timestamp: 2024-10-22T02:36:01.448Z
Learning: In `packages/ciphernode/data/Cargo.toml`, `actix-rt` is only used in tests and should remain in `[dev-dependencies]`.

Applied to files:

  • .github/workflows/ci.yml
  • README.md
📚 Learning: 2024-10-23T01:59:42.967Z
Learnt from: ryardley
Repo: gnosisguild/enclave PR: 156
File: packages/ciphernode/tests/tests/test_aggregation_and_decryption.rs:274-274
Timestamp: 2024-10-23T01:59:42.967Z
Learning: In the `packages/ciphernode/tests/tests/test_aggregation_and_decryption.rs` file and other test files within this project, hardcoding `CIPHERNODE_SECRET` is acceptable for testing purposes.

Applied to files:

  • README.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: build_enclave_cli
  • GitHub Check: build_e3_support_dev
  • GitHub Check: build_sdk
  • GitHub Check: integration_prebuild
  • GitHub Check: test_net
  • GitHub Check: rust_integration
  • GitHub Check: test_contracts
  • GitHub Check: crisp_rust_unit
  • GitHub Check: rust_unit
🔇 Additional comments (5)
.github/workflows/ci.yml (1)

91-92: Confirm rust:lint script is correctly defined in package.json.

The CI workflow has been updated to call pnpm rust:lint in both rust_unit and rust_integration jobs. Ensure this script is properly defined and tested before merging, as CI failures from missing scripts could be costly.

The dependency on the package.json script definition should be verified via the earlier review comment's verification script.

Also applies to: 134-135

README.md (1)

90-93: No issues found—--no-prebuild flag is properly supported and documented.

Verification confirms that tests/integration/test.sh accepts the --no-prebuild flag (line 7), and the README documentation on lines 92-93 accurately reflects the supported implementation. The flag is parsed by the script and documentation is consistent.

package.json (3)

14-15: Verify ecosystem coverage in lint and compile commands.

Analysis of the orchestrator scripts reveals:

  1. compile ordering is correct: The build:ts script (pnpm evm:build && pnpm sdk:build && pnpm react:build) runs before rust:build using sequential execution (&&), ensuring proper dependency ordering. ✓

  2. lint command has gaps: The lint command omits sdk:lint—while sdk has sdk:build and sdk:test defined, there is no corresponding sdk:lint script. Additionally, wasm ecosystem (which has wasm:build and wasm:release) has no wasm:lint or wasm:test defined or invoked.

  3. test command: All referenced test scripts (evm:test, rust:test, sdk:test, noir:test) are properly defined. Cannot verify from current state whether noir:test was previously omitted.

Action needed: Confirm whether sdk:lint should be added to the lint orchestrator, and whether wasm ecosystem should have lint/test scripts and corresponding orchestrator entries, or if those ecosystems intentionally lack testing/linting.


58-58: No breaking changes—aligns with existing patterns.

The path change from "./crates/wasm" to "crates/wasm" is safe and establishes consistency with existing patterns already in the codebase. CI workflows (.github/workflows/ci.yml) and documentation (scripts/README.md) both reference the workspace using the crates/wasm format without ./ prefix, confirming this change improves uniformity. The pnpm -C pattern operates identically with or without the ./ prefix, and no conflicts arise.


26-26: Style inconsistency in rust scripts: rust:test uses cd crates && pattern while rust:build and rust:lint invoke cargo directly.

All referenced script paths exist and the scripts function correctly. However, there's a minor pattern inconsistency: rust:test uses cd crates && ./scripts/test.sh while rust:build and rust:lint run cargo commands directly from the root directory. Since evm:* and sdk:* scripts follow the cd <path> && pnpm <task> pattern consistently, consider aligning rust:build and rust:lint with cd crates && for uniformity—e.g., cd crates && cargo build --locked --release and cd crates && cargo fmt -- --check.

Note: The scripts function identically in either form since the root Cargo.toml defines the workspace scope; this is a style consistency suggestion, not a functional issue.

⛔ Skipped due to learnings
Learnt from: ryardley
Repo: gnosisguild/enclave PR: 184
File: packages/ciphernode/net/tests/entrypoint.sh:4-8
Timestamp: 2024-11-25T09:47:48.863Z
Learning: When reviewing test scripts like `packages/ciphernode/net/tests/entrypoint.sh`, avoid suggesting additional error handling and cleanup for `iptables` commands, as it may not be necessary.
Learnt from: ryardley
Repo: gnosisguild/enclave PR: 145
File: packages/ciphernode/tests/tests/test_aggregation_and_decryption.rs:82-83
Timestamp: 2024-10-22T02:10:34.864Z
Learning: In the file `packages/ciphernode/tests/tests/test_aggregation_and_decryption.rs`, when reviewing test functions like `generate_pk_share`, minor performance optimizations (e.g., minimizing mutex locks) are not a priority.
Learnt from: ryardley
Repo: gnosisguild/enclave PR: 145
File: packages/ciphernode/evm/src/enclave_sol_reader.rs:87-89
Timestamp: 2024-10-22T03:39:29.448Z
Learning: In the `ciphernode` project, specifically in `packages/ciphernode/evm/src/enclave_sol_reader.rs`, the method `EnclaveSolReader::attach` should be retained even if it directly calls `EvmEventReader::attach` without additional processing. Avoid suggesting its removal in future reviews.
Learnt from: ryardley
Repo: gnosisguild/enclave PR: 145
File: packages/ciphernode/data/Cargo.toml:0-0
Timestamp: 2024-10-22T02:36:01.448Z
Learning: In `packages/ciphernode/data/Cargo.toml`, `actix-rt` is only used in tests and should remain in `[dev-dependencies]`.

@cedoor cedoor merged commit dc83321 into main Nov 20, 2025
24 checks passed
@ctrlc03 ctrlc03 deleted the chore/testing-scripts branch November 20, 2025 13:08
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.

Clarify and rename scripts to avoid confusion

2 participants