Skip to content

feat: mount distributed_cli for hops service (drop local adapter)#56

Merged
patrickleet merged 2 commits into
mainfrom
feat/service-via-distributed-cli
Jun 7, 2026
Merged

feat: mount distributed_cli for hops service (drop local adapter)#56
patrickleet merged 2 commits into
mainfrom
feat/service-via-distributed-cli

Conversation

@patrickleet
Copy link
Copy Markdown
Collaborator

@patrickleet patrickleet commented Jun 6, 2026

Summary

Make hops service a thin proxy over distributed_cli instead of carrying its own scaffold/describe/schema adapter.

  • The Service variant now holds distributed_cli::ServiceArgs and dispatches with distributed_cli::run.
  • Deletes src/commands/service/ (the former ~930-line adapter).
  • Swaps the dependency from distributed_tooling to distributed_cli.

distributed_cli is the in-workspace crate in the distributed repo that owns the generation logic and the dsvc command surface. By mounting its clap types here rather than reimplementing them, new flags/commands added there (e.g. schema --format atlas) reach hops service on a plain cargo update — no code changes in this repo.

Verified: hops service scaffold|describe|schema resolve, and hops service schema --help shows the Atlas flags. Build green.

Sequencing note

distributed_cli isn't published yet (distributed PR #74 is open), so this temporarily uses a git dependency on the distributed branch. Once #74 merges and releases, swap to the registry version (distributed_cli = "<version>") — a one-line change. This is the last cross-repo coordination step; afterwards it's just cargo update.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactor
    • Migrated service command functionality to an external dependency to improve code modularity and maintainability.

…pter

`hops service` now re-exports distributed_cli's command surface rather than
carrying its own scaffold/describe/schema adapter: the Service variant holds
distributed_cli::ServiceArgs and dispatches with distributed_cli::run. Deletes
src/commands/service (the former ~930-line adapter) and swaps the dependency from
distributed_tooling to distributed_cli.

This makes hops a thin, optional front-end: new flags/commands added in
distributed_cli (e.g. `schema --format atlas`) reach `hops service` on a plain
cargo update, with no code changes here.

Temporary git dep on the distributed branch until distributed_cli is published;
swap to a registry version once distributed PR #74 releases.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 6, 2026

Review Change Stack

Warning

Review limit reached

@patrickleet, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 30 minutes and 40 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 86653e56-2bcd-4905-b3e4-134d5e3a6159

📥 Commits

Reviewing files that changed from the base of the PR and between d826dea and 268405f.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • Cargo.toml
📝 Walkthrough

Walkthrough

The PR migrates the service subcommand implementation from the local hops-cli crate to an external distributed_cli crate. The dependency is updated to point to a git-based distributed_cli package, the local service module is removed from exports, and the command dispatch in main is re-wired to use the external implementation.

Changes

Service Command External Migration

Layer / File(s) Summary
Dependency update to distributed_cli
Cargo.toml
The distributed_tooling = "1.5" dependency is replaced with a git-based distributed_cli pointing to https://github.com/hops-ops/distributed.git on the feat/atlas-schema-resource branch, with TODO comments marking it as temporary pending registry publication.
Remove local service module and re-wire dispatch
src/commands/mod.rs, src/main.rs
The pub mod service; export is deleted from commands, and the Service subcommand dispatch in main switches from commands::service::{ServiceArgs, run} to distributed_cli::{ServiceArgs, run}.

Possibly Related PRs

  • hops-ops/hops-cli#55: This PR directly replaces the service subcommand implementation that was introduced in the retrieved PR by delegating to the external distributed_cli crate.

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

A service hops away to distant lands, 📦
From local mod to crate so grand!
With git's fine branch, the code takes flight,
External logic shines so bright. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: replacing the local service adapter with distributed_cli and removing the adapter code, which aligns with the primary objectives of the PR.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/service-via-distributed-cli

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
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Cargo.toml`:
- Around line 11-13: The Cargo.toml currently uses a temporary git dependency
for distributed_cli; open a tracked issue (or add to the project board)
referencing distributed PR `#74` to replace the git dep with a registry version
when published and link to this PR; in that issue also add a checklist to verify
that the crate re-exports ServiceArgs and run at the crate root (pub use
cli::{..., ServiceArgs, ...} and pub use cli::{..., run, ...}) and that run has
the signature pub fn run(args: &ServiceArgs) -> Result<(), Box<dyn Error>> so
the public API remains compatible before swapping the dependency.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: dc5edf29-0ab5-4700-9fd3-e6f5a9f87340

📥 Commits

Reviewing files that changed from the base of the PR and between b7630d6 and d826dea.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • Cargo.toml
  • src/commands/mod.rs
  • src/commands/service/mod.rs
  • src/main.rs
💤 Files with no reviewable changes (2)
  • src/commands/service/mod.rs
  • src/commands/mod.rs

Comment thread Cargo.toml Outdated
distributed PR #74 merged and released distributed_cli 1.6.x, so replace the
temporary git dependency with the registry version. No git source or branch
tracking; `hops service` resolves the command surface from the published crate.

Closes #58
@patrickleet patrickleet merged commit e44dc97 into main Jun 7, 2026
2 checks passed
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.

1 participant