iter-32: consolidate bunny-api-* into one crate, split CLI as hoppy-cli#37
Conversation
Mirror the hyalo project's shape: one `bunny-api` library crate with services (core, compute, containers, database, recording, shield, storage, stream) as feature-gated modules, and a separate `hoppy-cli` binary crate. `bunny-syslog-receiver` stays standalone. - Workspace bumped to 0.3.0 - Root Cargo.toml is now pure [workspace], default-members = hoppy-cli - CLI binary still named `hoppy`; install line becomes `cargo install hoppy-cli` - release.yml reduced from 9 publish steps to 3 - CLAUDE.md, README.md, decision-log updated Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR consolidates seven per-service API crates into a single feature-gated ChangesWorkspace Consolidation and CLI Relocation
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Pull request overview
This PR restructures the workspace by merging the previously split bunny-api-* service crates into a single feature-gated bunny-api crate, and relocating the CLI into a dedicated hoppy-cli crate (package name hoppy-cli, binary name hoppy). It also updates docs and test scaffolding to match the new workspace layout and publishing/install story.
Changes:
- Consolidate API clients into
crates/bunny-api/with feature-gated service modules (core/compute/containers/database/shield/storage/stream) and migrate imports/tests accordingly. - Split the CLI into
crates/hoppy-cli/, wire workspacedefault-members, and updatextask+ documentation to referencehoppy-cli. - Add/refresh CLI e2e tests and snapshots under the new crate layout.
Reviewed changes
Copilot reviewed 65 out of 215 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
Cargo.toml |
Convert root manifest to workspace-only, set default-members, bump workspace version, and switch workspace deps to bunny-api + hoppy-cli. |
Cargo.lock |
Update lockfile for crate consolidation/renames and version bump. |
README.md |
Update install instructions to cargo install hoppy-cli and clarify package vs binary naming. |
CLAUDE.md |
Update contributor guidance to reflect the new crate layout and conventions. |
.github/copilot-instructions.md |
Update repository layout documentation to reflect bunny-api + hoppy-cli structure. |
hoppy-knowledgebase/decision-log.md |
Record the iter-32 decision/rationale for consolidating the API crates and splitting the CLI crate. |
xtask/Cargo.toml |
Point xtask at the new hoppy-cli workspace dependency. |
xtask/src/main.rs |
Update CLI type import path from hoppy to hoppy_cli. |
crates/hoppy-cli/Cargo.toml |
Define the new CLI package, binary target, e2e test target, and dependencies. |
crates/hoppy-cli/build.rs |
Add build provenance embedding (git SHA + spec date) for hoppy --version. |
crates/hoppy-cli/src/main.rs |
New CLI entrypoint and command dispatch for the relocated binary crate. |
crates/hoppy-cli/src/lib.rs |
Export CLI/date modules for reuse (e.g., xtask). |
crates/hoppy-cli/src/auth.rs |
Update client construction imports to consolidated bunny_api::* modules. |
crates/hoppy-cli/src/cli.rs |
Update type references/imports to bunny_api::* consolidated modules. |
crates/hoppy-cli/src/output.rs |
Introduce shared output helpers (json/table/text) and a paginated JSON envelope helper. |
crates/hoppy-cli/src/progress.rs |
Add progress/spinner helpers gated by TTY + --quiet. |
crates/hoppy-cli/src/commands/mod.rs |
Define CLI command module structure under the new crate. |
crates/hoppy-cli/src/commands/auth.rs |
Update core API type imports to bunny_api::core::types. |
crates/hoppy-cli/src/commands/pull_zone.rs |
Update core API imports to bunny_api::core. |
crates/hoppy-cli/src/commands/dns.rs |
Update core API imports to bunny_api::core. |
crates/hoppy-cli/src/commands/storage_zone.rs |
Update core API imports to bunny_api::core::types. |
crates/hoppy-cli/src/commands/storage.rs |
Update storage API imports to bunny_api::storage. |
crates/hoppy-cli/src/commands/stream.rs |
Update stream/core API imports to bunny_api::{core,stream} and adjust paginated list typing. |
crates/hoppy-cli/src/commands/shield.rs |
Update shield API imports to bunny_api::shield::types. |
crates/hoppy-cli/src/commands/script.rs |
Update compute API imports to bunny_api::compute. |
crates/hoppy-cli/src/commands/container.rs |
Update containers API imports to bunny_api::containers. |
crates/hoppy-cli/src/commands/database.rs |
Update database API imports to bunny_api::database. |
crates/hoppy-cli/src/commands/statistics.rs |
Add statistics command handler under the new crate layout. |
crates/hoppy-cli/src/commands/video_library.rs |
Add video-library stats handler under the new crate layout. |
crates/hoppy-cli/src/commands/purge.rs |
Add purge command handler under the new crate layout. |
crates/hoppy-cli/tests/e2e/mod.rs |
Add e2e test module entrypoint for the new CLI crate. |
crates/hoppy-cli/tests/e2e/support/mod.rs |
Adjust fixture loading to account for the new crate-relative manifest dir. |
crates/hoppy-cli/tests/e2e/cli_auth.rs |
Add/port auth e2e coverage under the new CLI crate. |
crates/hoppy-cli/tests/e2e/cli_statistics.rs |
Add/port statistics e2e coverage under the new CLI crate. |
crates/hoppy-cli/tests/e2e/cli_video_library.rs |
Add video-library e2e coverage under the new CLI crate. |
crates/hoppy-cli/tests/e2e/snapshots/* |
Add/update insta snapshots for the e2e test suite under hoppy-cli. |
crates/bunny-api/Cargo.toml |
Define the consolidated API client crate with feature-gated services and test targets. |
crates/bunny-api/src/lib.rs |
Add feature-gated module declarations for the unified bunny-api crate. |
crates/bunny-api/src/recording/mod.rs |
Move recording helper into the unified crate for shared use across services. |
crates/bunny-api/src/core/mod.rs |
Update docs and keep flat re-exports for ergonomic bunny_api::core::* imports. |
crates/bunny-api/src/core/client.rs |
Update recording import path and adjust type paths to super::types. |
crates/bunny-api/src/core/types.rs |
Fix module-relative serde helper imports after consolidation. |
crates/bunny-api/src/database/mod.rs |
Update docs/examples for new import paths. |
crates/bunny-api/src/database/client.rs |
Update recording import path and adjust type paths to super::types. |
crates/bunny-api/src/shield/mod.rs |
Update docs/examples for new import paths. |
crates/bunny-api/src/shield/client.rs |
Update recording import path and adjust type paths to super::types. |
crates/bunny-api/src/stream/mod.rs |
Update docs/examples for new import paths and keep flat re-exports. |
crates/bunny-api/src/stream/client.rs |
Update recording import path and adjust type paths to super::types. |
crates/bunny-api/src/storage/mod.rs |
Introduce unified storage module exports under bunny-api. |
crates/bunny-api/src/storage/client.rs |
Update recording import path and adjust type paths to super::types. |
crates/bunny-api/src/storage/types.rs |
Add storage API types into the unified crate. |
crates/bunny-api/src/compute/mod.rs |
Add compute module exports under bunny-api. |
crates/bunny-api/src/compute/client.rs |
Update recording import path and adjust type paths to super::types. |
crates/bunny-api/src/containers/mod.rs |
Add containers module exports under bunny-api. |
crates/bunny-api/src/containers/client.rs |
Update recording import path and adjust type paths to super::types. |
crates/bunny-api/tests/core/e2e/* |
Update e2e tests to use bunny_api::core and fix fixture include paths. |
crates/bunny-api/tests/compute/e2e/* |
Update e2e tests to use bunny_api::compute and fix fixture include paths. |
crates/bunny-api/tests/containers/e2e/* |
Update e2e tests to use bunny_api::containers and fix fixture include paths. |
crates/bunny-api/tests/database/e2e/* |
Update e2e tests to use bunny_api::database and fix fixture include paths. |
crates/bunny-api/tests/shield/e2e/* |
Update e2e tests to use bunny_api::shield (module wiring added). |
crates/bunny-api/tests/storage/e2e/* |
Update e2e tests to use bunny_api::storage and fix fixture include paths. |
crates/bunny-api/tests/stream/e2e/* |
Update e2e tests to use bunny_api::stream and fix fixture include paths. |
crates/bunny-api-core/* |
Remove per-service crate manifests/READMEs as part of consolidation. |
crates/bunny-api-compute/* |
Remove per-service crate manifests/READMEs as part of consolidation. |
crates/bunny-api-containers/* |
Remove per-service crate manifests/READMEs as part of consolidation. |
crates/bunny-api-database/* |
Remove per-service crate manifests/READMEs as part of consolidation. |
crates/bunny-api-shield/* |
Remove per-service crate manifests/READMEs as part of consolidation. |
crates/bunny-api-storage/* |
Remove per-service crate manifests/READMEs as part of consolidation. |
crates/bunny-api-stream/* |
Remove per-service crate manifests/READMEs as part of consolidation. |
crates/bunny-api-recording/* |
Remove standalone recording crate manifests/READMEs as part of consolidation. |
Summary
bunny-api-*library crates into a singlebunny-apicrate with services (core,compute,containers,database,recording,shield,storage,stream) as feature-gated modules. Mirrors the hyalo project's shape.hoppybinary intocrates/hoppy-cli/(packagehoppy-cli, binary still namedhoppy). RootCargo.tomlis now pure[workspace]withdefault-members = ["crates/hoppy-cli"].bunny-syslog-receiverstays standalone (genuinely independent).0.3.0(structural breaking change to the public Rust API; CLI binary is backwards-compatible).release.ymlreduced from 9 sequentialcargo publishsteps to 3 (bunny-api,bunny-syslog-receiver,hoppy-cli).cargo install hoppy-cli; README, CLAUDE.md, decision-log updated accordingly.Test plan
cargo fmt --checkcleancargo clippy --workspace --all-targets -- -D warningscleancargo test --workspace --quiet— 16 test suites, 0 failurescargo auditcleancargo deny checkclean./target/release/hoppy --version→hoppy 0.3.0 (...)cargo run -- --helpworks from workspace root (provesdefault-membersis wired)BUNNY_API_KEY=$TEST_BUNNY_API_KEY ./target/release/hoppy auth check)🤖 Generated with Claude Code
Summary by CodeRabbit
hoppy-cli(binary namehoppyremains unchanged).