bolt icon indicating copy to clipboard operation
bolt copied to clipboard

:adhesive_bandage: Making bolt-cli buildable again

Open notdanilo opened this issue 2 months ago • 1 comments

Status Type ⚠️ Core Change Issue
Ready Hotfix No None

Problem

bolt-cli was no longer buildable with Anchor >= 0.32 because it removed solang templates.

Solution

Remove solang templates since we don't support it.

Summary by CodeRabbit

  • Refactor

    • Simplified CLI initialization by removing Solidity-specific options and paths.
    • Unified project creation to a single non-Solidity flow with consistent build, files, and templates.
    • Standardized test/template selection and workspace layout across languages.
    • Component-to-system dependency configuration now always applied.
  • Chores

    • Added/updated Solana-related dependencies and normalized dependency declarations.
    • Minor import and formatting cleanups with no user-facing behavior changes.

notdanilo avatar Oct 15 '25 22:10 notdanilo

Walkthrough

Updated workspace and crate Cargo dependencies (added solana-client and solana-system-interface; simplified solana-program spec), adjusted import paths, and refactored the bolt-cli init flow to remove Solidity-specific branches and the solidity parameter, standardizing on the non‑Solidity programs flow.

Changes

Cohort / File(s) Summary
Workspace root Cargo
Cargo.toml
Simplified solana-program dependency to a plain version string; added solana-client = "^2" and solana-system-interface = "^1". Minor formatting adjustments.
CLI crate Cargo
crates/bolt-cli/Cargo.toml
Added solana-client = "^2" and solana-system-interface = "^1" to crate dependencies; minor reordering/formatting.
Import updates
crates/bolt-cli/src/instructions.rs
Updated imports: RpcSendTransactionConfig now from solana_client::rpc_config; system_program now from solana_system_interface::program as system_program. No control-flow changes.
CLI init refactor
crates/bolt-cli/src/lib.rs
Removed Solidity-specific branches and the solidity: bool parameter from init; always follow non‑Solidity "programs" flow (create component/system, add component as system dependency, generate workspace/templates/tests).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant U as User
  participant CLI as bolt-cli:init
  participant FS as Filesystem
  participant WS as Workspace
  participant T as Templates
  participant P as Programs
  participant PM as PackageManager
  participant G as Git

  U->>CLI: init(name, javascript, no_install, no_git, template, test_template, force)
  rect rgba(200,230,255,0.35)
    note right of CLI: Standardized non‑Solidity flow
    CLI->>FS: create project dirs (programs, tests)
    CLI->>P: create_component() and create_system()
    CLI->>WS: write Cargo workspace, register component/system
    CLI->>T: generate program and test templates
  end

  alt install unless no_install
    CLI->>PM: install dependencies
  end

  alt git unless no_git
    CLI->>G: git init
  end

  CLI-->>U: Result (project initialized)

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title Check ❓ Inconclusive The pull request title "Making bolt-cli buildable again" is related to the main change in the PR, which is removing solang templates to fix the build issue caused by Anchor >= 0.32. However, the title is somewhat vague and generic—a teammate scanning commit history would understand that a build issue was fixed, but would not know the specific nature of the change (removal of solang support) without reading the full description. The emoji adds minor noise to an otherwise clear message. The title conveys the outcome but lacks specificity about what was actually changed.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed The pull request description follows the template structure and includes all required core sections: the metadata table clearly marks this as a Ready Hotfix with no core change and no linked issue, the Problem section explains that bolt-cli became unbuildable due to Anchor >= 0.32 removing solang templates, and the Solution section states that solang templates were removed since they are not supported. The description is concise and provides sufficient context for understanding the change. Optional sections like Before & After Screenshots and Deploy Notes are not filled in, but these are non-critical for this type of hotfix.
✨ 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 fix/buildable-bolt-cli

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 06ba018396e940d54349c29af76ba597a0fa00e7 and 9c89cd474a8fcfc5a98578f777a5a34307b5fa0b.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • Cargo.toml (1 hunks)
  • crates/bolt-cli/Cargo.toml (2 hunks)
  • crates/bolt-cli/src/instructions.rs (1 hunks)
  • crates/bolt-cli/src/lib.rs (5 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
crates/bolt-cli/src/lib.rs (2)
crates/bolt-cli/src/rust_template.rs (3)
  • create_system (31-44)
  • create_component (15-28)
  • create_program (47-61)
crates/bolt-cli/src/templates/workspace/mod.rs (3)
  • jest (28-30)
  • mocha (24-26)
  • ts_mocha (32-34)
⏰ 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). (3)
  • GitHub Check: lint (clippy)
  • GitHub Check: lint (yarn)
  • GitHub Check: test
🔇 Additional comments (5)
crates/bolt-cli/Cargo.toml (1)

22-22: LGTM!

The workspace dependency additions for solana-client and solana-system-interface are correct and align with the import path changes in instructions.rs.

Also applies to: 34-35

crates/bolt-cli/src/instructions.rs (1)

8-9: LGTM!

The import path updates correctly reflect the new direct dependencies on solana-client and solana-system-interface, eliminating the need to access them transitively through anchor-client. No functional changes.

crates/bolt-cli/src/lib.rs (3)

289-313: LGTM!

The workspace configuration correctly registers component and system program IDs and adds the necessary workspace members. This standardizes the initialization flow to always include ECS components and systems.


368-371: LGTM!

The program, component, and system creation calls correctly follow the non-Solidity initialization flow, using rust_template::create_program, create_component, and create_system.


423-423: LGTM!

The test file generation correctly uses workspace-provided templates (templates::workspace::jest, templates::workspace::mocha, templates::workspace::ts_mocha) for all test frameworks, standardizing on the non-Solidity approach.

Also applies to: 426-426, 444-444


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

coderabbitai[bot] avatar Oct 15 '25 22:10 coderabbitai[bot]