Skip to content

chore: refactor tests and simplify ci#1423

Merged
ctrlc03 merged 3 commits into
mainfrom
chore/test-refactoring
Mar 16, 2026
Merged

chore: refactor tests and simplify ci#1423
ctrlc03 merged 3 commits into
mainfrom
chore/test-refactoring

Conversation

@ctrlc03

@ctrlc03 ctrlc03 commented Mar 13, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

Release Notes

  • Chores
    • Optimized CI workflows with improved build caching, job parallelization, and timeout management across test suites and integration tests.
    • Consolidated test helper functions and fixtures for better maintainability and code reuse.
    • Updated enclave contracts script command from e3:enable to enclave:enableE3.
    • Enhanced test infrastructure for circuit compilation and artifact validation.

@ctrlc03 ctrlc03 requested a review from cedoor March 13, 2026 15:49
@vercel

vercel Bot commented Mar 13, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
crisp Ready Ready Preview, Comment Mar 16, 2026 3:25pm
enclave-docs Ready Ready Preview, Comment Mar 16, 2026 3:25pm

Request Review

@coderabbitai

coderabbitai Bot commented Mar 13, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This PR consolidates duplicated test helper functions across Rust and TypeScript test suites into centralized modules, and restructures CI workflows by splitting rust_tests into unit and integration variants, adding per-job timeout budgets, and enhancing setup steps with caching and artifact management.

Changes

Cohort / File(s) Summary
CI Workflow Restructuring
.github/workflows/ci.yml
Split rust_tests into rust_unit_tests and rust_integration_tests with dedicated outputs and jobs; added build_enclave_cli job; expanded timeout-minutes across 18+ jobs (rust_unit_tests, rust_integration_tests, zk_prover_integration, test_contracts, template_integration, etc.); added comprehensive setup steps (Rust/Foundry/solc/pnpm/node installation, Barretenberg caching) and artifact upload/download flows with verification steps.
Rust Test Helpers Consolidation
crates/test-helpers/src/lib.rs, crates/tests/tests/integration.rs, crates/zk-prover/Cargo.toml, crates/zk-prover/tests/common/helpers.rs
Centralized find_bb() and find_anvil() helper discovery logic into e3_test_helpers module; added async functions to locate bb and anvil binaries via PATH and HOME-based fallback locations; removed local implementations from integration.rs and zk-prover helpers.rs; added e3-test-helpers dev-dependency to zk-prover Cargo.toml; introduced setup_compiled_circuit() helper for artifact validation and copying.
TypeScript Contract Test Fixtures Consolidation
packages/enclave-contracts/test/fixtures/attestation.ts, packages/enclave-contracts/test/fixtures/operators.ts, packages/enclave-contracts/test/fixtures/index.ts
Created new fixture modules exporting VOTE_TYPEHASH constant and signAndEncodeAttestation() (handles message hashing, sorting, signing for attestations) and setupOperatorForSortition() (handles on-chain operator registration); centralized re-exports via index.ts.
TypeScript Test File Updates
packages/enclave-contracts/test/E3Integration.spec.ts, packages/enclave-contracts/test/Enclave.spec.ts, packages/enclave-contracts/test/Registry/CiphernodeRegistryOwnable.spec.ts, packages/enclave-contracts/test/Slashing/CommitteeExpulsion.spec.ts, packages/enclave-contracts/test/Slashing/SlashingManager.spec.ts
Removed in-file duplicate implementations of VOTE_TYPEHASH, signAndEncodeAttestation, and setupOperatorForSortition; added imports from centralized fixtures module.
Contract Configuration
packages/enclave-contracts/package.json
Updated e3:enable script command from hardhat e3:enable to hardhat enclave:enableE3.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • cedoor
  • ryardley
  • hmzakhalid

Poem

🐰 Duplicates scattered? Fear not, friend—
Helpers consolidated, chaos to end!
From test to fixture, imports aligned,
One source of truth, a garden refined.
CI flows faster, timeouts defined,
A burrow of tests, so well-designed! 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 70.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes: refactoring test helpers by consolidating duplicated code (find_bb, find_anvil, signAndEncodeAttestation, setupOperatorForSortition) into shared fixtures, and improving CI workflow with timeout budgets and explicit job dependencies.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/test-refactoring
📝 Coding Plan
  • Generate coding plan for human review comments

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.

🧹 Nitpick comments (1)
packages/enclave-contracts/test/fixtures/operators.ts (1)

48-48: Redundant addCiphernode call — safe but unnecessary.

The registerOperator() call on line 40 already invokes registry.addCiphernode(operatorAddress) internally (via BondingRegistry.registerOperator at line 309 of the contract). The explicit call here is redundant since CiphernodeRegistryOwnable.addCiphernode has an early-return guard when the node is already enabled.

This doesn't cause issues, but removing it would clarify the setup sequence.

♻️ Suggested simplification
   await bondingRegistry.connect(operator).addTicketBalance(ticketAmount);
-
-  await registry.addCiphernode(operatorAddress);
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/enclave-contracts/test/fixtures/operators.ts` at line 48, Remove the
redundant explicit call to registry.addCiphernode(operatorAddress) in the
fixture setup: registerOperator() already calls BondingRegistry.registerOperator
which in turn invokes CiphernodeRegistryOwnable.addCiphernode, so simply delete
the await registry.addCiphernode(operatorAddress); line and rely on
registerOperator() to perform the registration to keep the setup sequence clear.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@packages/enclave-contracts/test/fixtures/operators.ts`:
- Line 48: Remove the redundant explicit call to
registry.addCiphernode(operatorAddress) in the fixture setup: registerOperator()
already calls BondingRegistry.registerOperator which in turn invokes
CiphernodeRegistryOwnable.addCiphernode, so simply delete the await
registry.addCiphernode(operatorAddress); line and rely on registerOperator() to
perform the registration to keep the setup sequence clear.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7f1c7e80-9fa7-4504-b304-db9a30c947f9

📥 Commits

Reviewing files that changed from the base of the PR and between 6bcf88c and 0f3392c.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (16)
  • .github/workflows/ci.yml
  • crates/test-helpers/src/lib.rs
  • crates/tests/tests/integration.rs
  • crates/zk-prover/Cargo.toml
  • crates/zk-prover/tests/common/helpers.rs
  • packages/enclave-contracts/artifacts/contracts/verifier/DkgPkVerifier.sol/DkgPkVerifier.json
  • packages/enclave-contracts/artifacts/contracts/verifier/DkgPkVerifier.sol/ZKTranscriptLib.json
  • packages/enclave-contracts/package.json
  • packages/enclave-contracts/test/E3Lifecycle/E3Integration.spec.ts
  • packages/enclave-contracts/test/Enclave.spec.ts
  • packages/enclave-contracts/test/Registry/CiphernodeRegistryOwnable.spec.ts
  • packages/enclave-contracts/test/Slashing/CommitteeExpulsion.spec.ts
  • packages/enclave-contracts/test/Slashing/SlashingManager.spec.ts
  • packages/enclave-contracts/test/fixtures/attestation.ts
  • packages/enclave-contracts/test/fixtures/index.ts
  • packages/enclave-contracts/test/fixtures/operators.ts

@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: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/ci.yml (1)

107-118: ⚠️ Potential issue | 🟠 Major

Don't let SDK/runtime changes bypass the template E2E job.

template_integration consumes freshly built SDK/support-script/CLI artifacts, but templates is now derived from $TEMPLATES/$CI only and build_enclave_cli still omits $SDK. A PR that only changes the SDK, contracts, circuits, or Rust runtime can now skip the one job that exercises templates/default against those new artifacts.

Suggested filter adjustment
-          echo "templates=$(any $FORCE $TEMPLATES $CI)" >> $GITHUB_OUTPUT
+          echo "templates=$(any $FORCE $TEMPLATES $SDK $RUST $CONTRACTS $CIRCUITS $CI)" >> $GITHUB_OUTPUT
...
-          echo "build_enclave_cli=$(any $FORCE $RUST $CONTRACTS $CIRCUITS $INTEGRATION $TEMPLATES $CRISP $CI)" >> $GITHUB_OUTPUT
+          echo "build_enclave_cli=$(any $FORCE $RUST $CONTRACTS $CIRCUITS $INTEGRATION $TEMPLATES $SDK $CRISP $CI)" >> $GITHUB_OUTPUT
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml around lines 107 - 118, The templates output
currently only depends on $TEMPLATES and $CI so SDK/runtime changes can skip
template E2E; update the echo that sets "templates=" to include the SDK and
runtime-related flags (e.g., add $SDK $RUST $CONTRACTS $CIRCUITS, and
$INTEGRATION if relevant) so it reads something like any $FORCE $TEMPLATES $SDK
$RUST $CONTRACTS $CIRCUITS $CI, and also add $SDK to the "build_enclave_cli="
any(...) invocation so build_enclave_cli includes SDK artifacts; modify the
lines that set the templates and build_enclave_cli outputs accordingly.
🧹 Nitpick comments (2)
crates/zk-prover/tests/common/helpers.rs (1)

50-56: Consider adding error context to unwrap() calls for easier debugging.

Multiple .unwrap() calls throughout setup_compiled_circuit will panic without context if any fs operation fails. For test helpers, expect() with a brief message improves failure diagnostics:

fs::create_dir_all(&evm_dir).await.expect("failed to create evm circuit dir");

This is optional given the test-helper context, but helpful when debugging CI failures. Based on learnings: test utilities can use simpler error handling, so this is not blocking.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/zk-prover/tests/common/helpers.rs` around lines 50 - 56, The unwrap()
calls in setup_compiled_circuit (specifically on fs::create_dir_all and the two
fs::copy calls) provide no failure context; replace them with expect() (or use
.await.expect(...)) and add short descriptive messages like "failed to create
evm circuit dir", "failed to copy circuit json", and "failed to copy vk file" so
test failures surface actionable diagnostics when those async fs operations
fail.
crates/test-helpers/src/lib.rs (1)

73-90: Consider returning Option<PathBuf> for API consistency.

find_bb() returns Option<PathBuf> while find_anvil() returns bool. If callers ever need the resolved anvil path (e.g., to spawn a custom instance), they'd need a separate lookup. Returning Option<PathBuf> would unify the API and allow callers to use .is_some() for existence checks.

That said, if current usage only requires a boolean check, this is fine as-is.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/test-helpers/src/lib.rs` around lines 73 - 90, Change find_anvil() to
return Option<PathBuf> instead of bool: attempt to resolve the anvil executable
path from the "which" command (use output.stdout trimmed and converted to
PathBuf) and return Some(path) if it exists and is executable; if that fails,
check the HOME fallback path "{HOME}/.foundry/bin/anvil" and return
Some(PathBuf) when found; otherwise return None. Update the function signature
and callers accordingly, preserving async tokio::process::Command use and
referencing the find_anvil function and the HOME fallback logic in the body.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 1020-1023: The workflow's timeout-minutes is set to 30 which is
shorter than the integration test budget
(templates/default/tests/integration.spec.ts runs pnpm test:integration and can
wait three sequential 700s which alone is ~35 minutes plus setup/compile), so
update the timeout-minutes in the CI job (change the timeout-minutes entry in
.github/workflows/ci.yml for the job containing needs/if/runs-on) to a value >=
60 (or at least >35, recommended 60) so legitimate slow-but-valid runs are not
killed.
- Around line 749-766: The cache step identified by id "cache-bb" is writing to
/usr/local/bin/bb which causes permission errors on restore; change the cache
path to a user-writable location like ~/.cache/barretenberg/${{ env.BB_VERSION
}} and update the cache key to include env.BB_VERSION, update the "Install
Barretenberg (bb)" logic to extract the bb binary into that cache directory
(create it if missing) instead of /usr/local/bin, and ensure the job exports or
prepends that directory to PATH (e.g., export
PATH="${HOME}/.cache/barretenberg/${{ env.BB_VERSION }}:$PATH") before the
"Verify bb" step so bb --version can run; apply the same changes to both job
instances that contain the cache-bb/Install/Verify sequence.

---

Outside diff comments:
In @.github/workflows/ci.yml:
- Around line 107-118: The templates output currently only depends on $TEMPLATES
and $CI so SDK/runtime changes can skip template E2E; update the echo that sets
"templates=" to include the SDK and runtime-related flags (e.g., add $SDK $RUST
$CONTRACTS $CIRCUITS, and $INTEGRATION if relevant) so it reads something like
any $FORCE $TEMPLATES $SDK $RUST $CONTRACTS $CIRCUITS $CI, and also add $SDK to
the "build_enclave_cli=" any(...) invocation so build_enclave_cli includes SDK
artifacts; modify the lines that set the templates and build_enclave_cli outputs
accordingly.

---

Nitpick comments:
In `@crates/test-helpers/src/lib.rs`:
- Around line 73-90: Change find_anvil() to return Option<PathBuf> instead of
bool: attempt to resolve the anvil executable path from the "which" command (use
output.stdout trimmed and converted to PathBuf) and return Some(path) if it
exists and is executable; if that fails, check the HOME fallback path
"{HOME}/.foundry/bin/anvil" and return Some(PathBuf) when found; otherwise
return None. Update the function signature and callers accordingly, preserving
async tokio::process::Command use and referencing the find_anvil function and
the HOME fallback logic in the body.

In `@crates/zk-prover/tests/common/helpers.rs`:
- Around line 50-56: The unwrap() calls in setup_compiled_circuit (specifically
on fs::create_dir_all and the two fs::copy calls) provide no failure context;
replace them with expect() (or use .await.expect(...)) and add short descriptive
messages like "failed to create evm circuit dir", "failed to copy circuit json",
and "failed to copy vk file" so test failures surface actionable diagnostics
when those async fs operations fail.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 04a486f8-4041-4f6d-9b9c-4e57f4dd44a3

📥 Commits

Reviewing files that changed from the base of the PR and between 0f3392c and bfb17c2.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (15)
  • .github/workflows/ci.yml
  • crates/test-helpers/src/lib.rs
  • crates/tests/tests/integration.rs
  • crates/zk-prover/Cargo.toml
  • crates/zk-prover/tests/common/helpers.rs
  • packages/enclave-contracts/package.json
  • packages/enclave-contracts/test/E3Lifecycle/E3Integration.spec.ts
  • packages/enclave-contracts/test/Enclave.spec.ts
  • packages/enclave-contracts/test/Registry/CiphernodeRegistryOwnable.spec.ts
  • packages/enclave-contracts/test/Slashing/CommitteeExpulsion.spec.ts
  • packages/enclave-contracts/test/Slashing/SlashingManager.spec.ts
  • packages/enclave-contracts/test/fixtures/attestation.ts
  • packages/enclave-contracts/test/fixtures/index.ts
  • packages/enclave-contracts/test/fixtures/operators.ts
  • templates/default/tests/integration.spec.ts
🚧 Files skipped from review as they are similar to previous changes (9)
  • crates/zk-prover/Cargo.toml
  • packages/enclave-contracts/package.json
  • packages/enclave-contracts/test/fixtures/operators.ts
  • packages/enclave-contracts/test/E3Lifecycle/E3Integration.spec.ts
  • crates/tests/tests/integration.rs
  • packages/enclave-contracts/test/fixtures/index.ts
  • packages/enclave-contracts/test/fixtures/attestation.ts
  • packages/enclave-contracts/test/Enclave.spec.ts
  • packages/enclave-contracts/test/Slashing/CommitteeExpulsion.spec.ts

Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/ci.yml

@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.

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

1113-1116: Inconsistent pnpm version pinning.

This job pins pnpm to 10.7.1, but other jobs (e.g., rust_unit_tests, rust_integration_tests) use pnpm/action-setup@v4 without a version pin. Consider aligning version handling across jobs—either pin everywhere or let the action resolve the version from packageManager in package.json.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml around lines 1113 - 1116, The workflow contains
inconsistent pnpm version handling: the "Install pnpm" step uses
pnpm/action-setup@v4 with version: 10.7.1 while other jobs (e.g.,
rust_unit_tests, rust_integration_tests) call pnpm/action-setup@v4 without a
pinned version; pick one approach and make all jobs consistent—either remove the
explicit version: 10.7.1 from the "Install pnpm" step so every
pnpm/action-setup@v4 invocation will resolve the pnpm version from package.json
(packageManager), or add version: 10.7.1 to the pnpm/action-setup@v4 steps in
rust_unit_tests and rust_integration_tests to pin them all to the same version;
update the "Install pnpm" step or the rust_* job steps accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 1113-1116: The workflow contains inconsistent pnpm version
handling: the "Install pnpm" step uses pnpm/action-setup@v4 with version: 10.7.1
while other jobs (e.g., rust_unit_tests, rust_integration_tests) call
pnpm/action-setup@v4 without a pinned version; pick one approach and make all
jobs consistent—either remove the explicit version: 10.7.1 from the "Install
pnpm" step so every pnpm/action-setup@v4 invocation will resolve the pnpm
version from package.json (packageManager), or add version: 10.7.1 to the
pnpm/action-setup@v4 steps in rust_unit_tests and rust_integration_tests to pin
them all to the same version; update the "Install pnpm" step or the rust_* job
steps accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 684ef42a-2e20-4020-9517-a2bfbcd550fb

📥 Commits

Reviewing files that changed from the base of the PR and between bfb17c2 and 2b309c5.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

@ctrlc03 ctrlc03 requested a review from 0xjei March 16, 2026 14:11

@0xjei 0xjei 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.

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: 1

♻️ Duplicate comments (2)
.github/workflows/ci.yml (2)

1036-1036: ⚠️ Potential issue | 🟠 Major

template_integration timeout is likely too low for valid slow runs.

Line 1036 sets 30 minutes, but this job includes compile + integration waits and can exceed that on slower runners.

Timeout bump
-    timeout-minutes: 30
+    timeout-minutes: 60
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml at line 1036, The CI job timeout for
template_integration is set too low (timeout-minutes: 30) and can expire during
compile + integration waits; update the workflow to raise the timeout-minutes
for the template_integration job (or the job-level/default timeout) to a higher
value (e.g., 60 or 90) so slow runners can finish, by modifying the
timeout-minutes field for the template_integration job in
.github/workflows/ci.yml.

757-774: ⚠️ Potential issue | 🟠 Major

bb cache path still targets root-owned location and can fail on restore.

Line 761 and Line 831 cache /usr/local/bin/bb. actions/cache restores as the runner user, so cache hits can fail or produce unusable binaries.

Safer cache/install pattern (apply in both job blocks)
       - name: Cache Barretenberg binary
         id: cache-bb
         uses: actions/cache@v4
         with:
-          path: /usr/local/bin/bb
-          key: bb-bin-${{ env.BB_VERSION }}-amd64-linux
+          path: ~/.cache/barretenberg/${{ env.BB_VERSION }}
+          key: bb-bin-${{ env.BB_VERSION }}-${{ runner.arch }}-linux

+      - name: Add bb to PATH
+        run: echo "$HOME/.cache/barretenberg/${{ env.BB_VERSION }}" >> "$GITHUB_PATH"
+
       - name: Install Barretenberg (bb)
         if: steps.cache-bb.outputs.cache-hit != 'true'
         run: |
           curl -fsSL "https://github.com/AztecProtocol/aztec-packages/releases/download/v${{ env.BB_VERSION }}/barretenberg-amd64-linux.tar.gz" -o bb.tar.gz
           mkdir -p bb_extract && tar -xzf bb.tar.gz -C bb_extract
           BB_BIN=$(find bb_extract -name bb -type f | head -n 1)
-          sudo mv "$BB_BIN" /usr/local/bin/bb
-          chmod +x /usr/local/bin/bb
+          install -Dm755 "$BB_BIN" "$HOME/.cache/barretenberg/${{ env.BB_VERSION }}/bb"

Also applies to: 827-850

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml around lines 757 - 774, The cache step (id
cache-bb) is targeting the root-owned path /usr/local/bin/bb which the runner
cannot safely restore; change the cache path to a runner-writable location (e.g.
$RUNNER_TOOL_CACHE/bb or $HOME/.cache/bb) and update the cache key accordingly,
then in the Install Barretenberg step extract the tar into that writable cache
dir (find BB binary there) and only use sudo to move or install the binary into
/usr/local/bin/bb after a successful cache miss/installation; ensure the Verify
bb step still calls bb --version and apply the same pattern to the other job
block mentioned.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/ci.yml:
- Line 107: The templates trigger is too narrow: update the line that sets the
outputs (the "templates=$(any $FORCE $TEMPLATES $CI)" echo) so it also considers
backend/contract/runtime changes that can break templates (e.g., include
additional CI flags like $RUST, $CONTRACTS, $SDK or replace with a git-diff
check). Modify the echo that defines templates to include those extra variables
(or a boolean computed from a git diff of Rust/contracts/SDK areas) so the
template_integration job runs when underlying code changes, not just when
template files or $CI are set.

---

Duplicate comments:
In @.github/workflows/ci.yml:
- Line 1036: The CI job timeout for template_integration is set too low
(timeout-minutes: 30) and can expire during compile + integration waits; update
the workflow to raise the timeout-minutes for the template_integration job (or
the job-level/default timeout) to a higher value (e.g., 60 or 90) so slow
runners can finish, by modifying the timeout-minutes field for the
template_integration job in .github/workflows/ci.yml.
- Around line 757-774: The cache step (id cache-bb) is targeting the root-owned
path /usr/local/bin/bb which the runner cannot safely restore; change the cache
path to a runner-writable location (e.g. $RUNNER_TOOL_CACHE/bb or
$HOME/.cache/bb) and update the cache key accordingly, then in the Install
Barretenberg step extract the tar into that writable cache dir (find BB binary
there) and only use sudo to move or install the binary into /usr/local/bin/bb
after a successful cache miss/installation; ensure the Verify bb step still
calls bb --version and apply the same pattern to the other job block mentioned.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 39d8de27-94df-4071-b8a6-ab463b3a9be9

📥 Commits

Reviewing files that changed from the base of the PR and between 2b309c5 and eb1ca2b.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • packages/enclave-contracts/test/E3Lifecycle/E3Integration.spec.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/enclave-contracts/test/E3Lifecycle/E3Integration.spec.ts

Comment thread .github/workflows/ci.yml
@ctrlc03 ctrlc03 merged commit e06bcbc into main Mar 16, 2026
28 checks passed
@github-actions github-actions Bot deleted the chore/test-refactoring branch March 24, 2026 03:14
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