fluvio-community / fluvio-community/fluvio

Improve ergonomics for clients connecting to cluster on another host

Open
#2,017 2 comments 0 reactions 0 assignees View on GitHub
API CLI Client DX/GENERAL enhancement good first issue technical debt value/high
Dominant language
Rust
Stars
5.3k
Forks
530
PR merge metrics
No merged PRs in 30d

Description

The [default Rust client](https://docs.rs/fluvio/0.12.5/fluvio/struct.Fluvio.html#method.connect ) assumes a local cluster, with preference given to the config file at `~/.fluvio/config`.

You can also [connect to a different cluster](https://docs.rs/fluvio/0.12.5/fluvio/struct.Fluvio.html#method.connect_with_config) by providing a [`FluvioConfig`](https://docs.rs/fluvio/0.12.5/fluvio/config/struct.FluvioConfig.html).

But for the CLI and our other clients, users need to modify `~/.fluvio/config` to connect to another cluster, which is not always a practical approach.

In my opinion this behavior was permitted by [`Profile`](https://docs.rs/fluvio/0.12.5/fluvio/config/struct.Profile.html) (and maybe also [`Config`](https://docs.rs/fluvio/0.12.5/fluvio/config/struct.Config.html)) being heavily leveraged in the `fluvio` crate. It enabled shortcuts for the CLI that other clients don't need to assume. Like having a config file to load from a specific location on the filesystem.

---

What I think needs to happen:

* Move the whole concept of `Profile` (and maybe `Config` too?) out of `fluvio` and into `fluvio-cli-common` (or related crates), since it is effectively a CLI only concept for a user of multiple clusters. Not directly used by Fluvio cluster.
* Add CLI subcommands to add new Profiles so users don't have to open the file
* Expose `FluvioConfig` in the other language client libraries, so it can be used to connect to other clusters (or add other connect methods to provide the same effect)
* This point is not to be solved by this issue. The other clients can link to this issue

Contributor guide

Open the contributing guide

Research direction

Start by tracing Profile and Config usage in the fluvio crate and the related fluvio-cli-common code, then review how the CLI currently loads ~/.fluvio/config. Define the boundary between shared client configuration and CLI profile management. Done means profile creation is available through CLI subcommands without manual file editing, while the separate client-library connection work remains scoped for follow-up issues.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, distributed-systems
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.