Skip to content

Conversation

@Vishalkulkarni45
Copy link
Collaborator

@Vishalkulkarni45 Vishalkulkarni45 commented Oct 8, 2025

Summary by CodeRabbit

  • Chores
    • Enhanced build workflow to allow on-demand builds of specific circuits by name or type via manual triggers, with input validation and safe artifact retrieval.
    • Preserved default behavior to build all circuits when no inputs are provided.
    • Added a script to build a single circuit with robust validation and clearer error messaging.
    • Adjusted permissions and steps to support the new build flow.
    • Updated CI actions to align with the new artifact handling and build process while maintaining final artifact uploads.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 8, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Adds parameterized CI workflow inputs to selectively build circuits by type or name, with validation and artifact handling. Introduces a new Bash script to build a single circuit by name, deriving type, validating presence, compiling Circom to C++, and building the generated code, preserving artifact upload.

Changes

Cohort / File(s) Summary
CI workflow: selective circuit builds
.github/workflows/circuits-build.yml
Adds workflow_dispatch inputs (circuit-type, circuit-name) with mutual exclusivity check; conditional artifact download; conditional build paths for type or name; defaults to building all circuits when no input; retains artifact upload; adjusts permissions and chmod for scripts.
Build tooling: single-circuit script
circuits/scripts/build/build_single_circuit.sh
New script to build a single circuit by name: validates args, infers circuit type, checks lists/paths, runs circom with includes, compiles C++ in cpp dir, and provides structured error handling and status output.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Dev as Developer
  participant GH as GitHub Actions
  participant WF as circuits-build.yml
  participant SH as build_single_circuit.sh
  participant Circom as circom
  participant CPP as g++/make
  participant Art as Artifacts

  Dev->>GH: workflow_dispatch (circuit-name or circuit-type)
  GH->>WF: Run workflow
  WF->>WF: Validate inputs (mutual exclusivity)
  alt circuit-name provided
    WF->>Art: Download previous artifacts (best-effort)
    loop for each name
      WF->>SH: ./build_single_circuit.sh <name>
      SH->>SH: Derive type, resolve paths, validate existence
      SH->>Circom: Compile .circom -> C++ (with includes)
      SH->>CPP: Build generated C++ (cpp dir)
      CPP-->>SH: Build result
      SH-->>WF: Exit code
    end
  else circuit-type provided
    WF->>Art: Download previous artifacts (best-effort)
    WF->>WF: Invoke existing type-based build (build_cpp.sh)
  else no inputs
    WF->>WF: Build all circuits (default set)
  end
  WF->>Art: Upload build artifacts
  note over WF,Art: Preserve final artifact upload regardless of path
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Feat/build aadhaar #1044 — Adjusts build_cpp.sh to support register_aadhaar; related to this PR’s workflow/type/name build pathways and circuit coverage.

Poem

Switches flipped in CI’s light,
Names or types now guide the night.
Bash scripts march with circom’s beat,
C++ wakes, the builds complete.
Artifacts stack, a tidy sight—
One circuit’s path, precisely right.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/custom-circuit-build

📜 Recent 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 bbf340c and 1701226.

📒 Files selected for processing (2)
  • .github/workflows/circuits-build.yml (2 hunks)
  • circuits/scripts/build/build_single_circuit.sh (1 hunks)

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.

Copy link
Collaborator

@Nesopie Nesopie left a comment

Choose a reason for hiding this comment

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

lgtm

@Nesopie Nesopie merged commit a23bdc4 into dev Oct 8, 2025
13 of 14 checks passed
@Nesopie Nesopie deleted the feat/custom-circuit-build branch October 8, 2025 10:35
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.

3 participants