refactor(cli): rename ServerStoreClient -> Client, fabro_api::Client -> ApiClient

The CLI façade is the primary type callers reach for, so it deserves
the bare `Client` name (per `reqwest::Client`, `hyper::Client`
convention). The raw generated HTTP binding is secondary and is more
accurately named `ApiClient`. "Store" in `ServerStoreClient` was
leftover from the SlateDB-ownership refactor and no longer describes
the type.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Bryan Helmkamp 2026-04-20 08:56:09 -04:00
parent 92ec483b60
commit aa8cdd6986
No known key found for this signature in database
21 changed files with 88 additions and 87 deletions

View file

@ -13,4 +13,4 @@
mod generated {
include!(concat!(env!("OUT_DIR"), "/codegen.rs"));
}
pub use generated::{Client, types};
pub use generated::{Client as ApiClient, types};

View file

@ -9,7 +9,7 @@ use fabro_util::printer::Printer;
use tokio::sync::OnceCell;
use crate::args::{ServerConnectionArgs, ServerTargetArgs};
use crate::server_client::ServerStoreClient;
use crate::server_client::Client;
use crate::{server_client, user_config};
#[derive(Clone, Debug)]
@ -35,7 +35,7 @@ pub(crate) struct CommandContext {
machine_settings: SettingsLayer,
cli_settings: CliSettings,
server_mode: ServerMode,
server: OnceCell<Arc<ServerStoreClient>>,
server: OnceCell<Arc<Client>>,
}
impl CommandContext {
@ -135,7 +135,7 @@ impl CommandContext {
&self.cli_settings
}
pub(crate) async fn server(&self) -> Result<Arc<ServerStoreClient>> {
pub(crate) async fn server(&self) -> Result<Arc<Client>> {
let server_mode = self.server_mode.clone();
let base_config_path = self.base_config_path.clone();
let machine_settings = self.machine_settings.clone();

View file

@ -11,7 +11,7 @@ use fabro_types::settings::cli::{CliLayer, OutputFormat};
use fabro_util::printer::Printer;
use crate::args::ArtifactCpArgs;
use crate::server_client::ServerStoreClient;
use crate::server_client::Client;
use crate::shared::{print_json_pretty, split_run_path};
pub(super) async fn cp_command(
@ -140,7 +140,7 @@ pub(super) async fn cp_command(
}
async fn write_artifact_file(
client: &ServerStoreClient,
client: &Client,
run_id: &fabro_types::RunId,
entry: &super::ArtifactEntry,
dest_file: &Path,

View file

@ -9,7 +9,7 @@ use fabro_util::printer::Printer;
use crate::args::{ArtifactCommand, ArtifactNamespace, ServerTargetArgs};
use crate::command_context::CommandContext;
use crate::server_client::ServerStoreClient;
use crate::server_client::Client;
#[derive(Clone, Debug, serde::Serialize)]
pub(super) struct ArtifactEntry {
@ -29,7 +29,7 @@ pub(super) async fn resolve_artifacts(
cli: &CliSettings,
cli_layer: &CliLayer,
printer: Printer,
) -> Result<(RunId, ServerStoreClient, Vec<ArtifactEntry>)> {
) -> Result<(RunId, Client, Vec<ArtifactEntry>)> {
let ctx = CommandContext::for_target(server, printer, cli.clone(), cli_layer)?;
let client = ctx.server().await?;
let run_id = client.resolve_run(run_selector).await?.run_id;

View file

@ -1094,7 +1094,7 @@ async fn setup_github_app(
}
async fn persist_vault_secrets_via_server(
client: &fabro_api::Client,
client: &fabro_api::ApiClient,
secrets: &[CreateSecretRequest],
) -> Result<()> {
for secret in secrets {
@ -1117,7 +1117,7 @@ async fn persist_vault_secrets_with(
storage_dir: &Path,
secrets: &[CreateSecretRequest],
server_was_running: bool,
connect_api_client: impl for<'a> Fn(&'a Path) -> BoxFuture<'a, Result<fabro_api::Client>>,
connect_api_client: impl for<'a> Fn(&'a Path) -> BoxFuture<'a, Result<fabro_api::ApiClient>>,
stop_server: impl for<'a> Fn(&'a Path, Duration) -> BoxFuture<'a, bool>,
) -> Result<()> {
if secrets.is_empty() {
@ -1303,7 +1303,7 @@ async fn persist_install_outputs_with_settings(
vault_secrets: &[CreateSecretRequest],
settings_write: Option<PendingSettingsWrite<'_>>,
server_was_running: bool,
connect_api_client: impl for<'a> Fn(&'a Path) -> BoxFuture<'a, Result<fabro_api::Client>>,
connect_api_client: impl for<'a> Fn(&'a Path) -> BoxFuture<'a, Result<fabro_api::ApiClient>>,
stop_server: impl for<'a> Fn(&'a Path, Duration) -> BoxFuture<'a, bool>,
) -> Result<()> {
persist_server_env_secrets(storage_dir, server_env_secrets)?;
@ -2486,7 +2486,7 @@ client_id = "client-id"
&vault_secrets,
false,
|_| {
let client = fabro_api::Client::new_with_client(
let client = fabro_api::ApiClient::new_with_client(
&server.base_url(),
fabro_test::test_http_client(),
);
@ -2548,7 +2548,7 @@ client_id = "client-id"
&vault_secrets,
true,
|_| {
let client = fabro_api::Client::new_with_client(
let client = fabro_api::ApiClient::new_with_client(
&server.base_url(),
fabro_test::test_http_client(),
);

View file

@ -207,7 +207,7 @@ where
}
async fn fetch_models_from_server(
client: &fabro_api::Client,
client: &fabro_api::ApiClient,
provider: Option<&str>,
query: Option<&str>,
) -> Result<Vec<Model>> {
@ -237,7 +237,7 @@ async fn fetch_models_from_server(
}
async fn test_model_via_server(
client: &fabro_api::Client,
client: &fabro_api::ApiClient,
model_id: &str,
mode: Option<api_types::ModelTestMode>,
) -> Result<api_types::ModelTestResult> {
@ -255,7 +255,7 @@ async fn test_model_via_server(
reason = "Progress goes to stderr while tables or JSON results go to stdout."
)]
async fn test_models_via_server(
client: &fabro_api::Client,
client: &fabro_api::ApiClient,
provider: Option<&str>,
model: Option<&str>,
deep: bool,
@ -432,7 +432,7 @@ async fn test_models_via_server(
)]
async fn run_models(
command: ModelsCommand,
client: &fabro_api::Client,
client: &fabro_api::ApiClient,
json_output: bool,
) -> Result<()> {
let styles = Styles::detect_stdout();
@ -483,8 +483,8 @@ mod tests {
use super::*;
fn test_api_client(api_url: &str) -> fabro_api::Client {
fabro_api::Client::new_with_client(api_url, fabro_test::test_http_client())
fn test_api_client(api_url: &str) -> fabro_api::ApiClient {
fabro_api::ApiClient::new_with_client(api_url, fabro_test::test_http_client())
}
fn test_model_json(id: &str, provider: Provider) -> serde_json::Value {

View file

@ -74,7 +74,7 @@ pub(crate) async fn attach_run(
}
pub(crate) async fn attach_run_with_client(
client: &server_client::ServerStoreClient,
client: &server_client::Client,
run_id: &RunId,
kill_on_detach: bool,
styles: &'static Styles,
@ -152,7 +152,7 @@ fn replay_run_with_client(
}
async fn attach_live_run_with_client(
client: &server_client::ServerStoreClient,
client: &server_client::Client,
run_id: &RunId,
existing_events: Vec<EventEnvelope>,
mut stream: server_client::RunAttachEventStream,
@ -226,7 +226,7 @@ async fn attach_live_run_with_client(
}
async fn handle_pending_server_interview(
client: &server_client::ServerStoreClient,
client: &server_client::Client,
run_id: &RunId,
auto_approve: bool,
progress_ui: &mut run_progress::ProgressUI,
@ -262,7 +262,7 @@ async fn handle_pending_server_interview(
}
async fn handle_detach_signal(
client: &server_client::ServerStoreClient,
client: &server_client::Client,
run_id: &RunId,
kill_on_detach: bool,
printer: Printer,
@ -316,7 +316,7 @@ fn api_question_to_question(question: &types::ApiQuestion) -> Question {
}
async fn submit_server_interview_answer(
client: &server_client::ServerStoreClient,
client: &server_client::Client,
run_id: &RunId,
qid: &str,
answer: &fabro_interview::Answer,
@ -625,7 +625,7 @@ mod tests {
.header("Content-Type", "application/json")
.body(terminal_run_state_response().to_string());
});
let client = server_client::ServerStoreClient::new_no_proxy(&server.base_url()).unwrap();
let client = server_client::Client::new_no_proxy(&server.base_url()).unwrap();
handle_detach_signal(&client, &run_id, true, Printer::Default).await;

View file

@ -9,7 +9,7 @@ use tracing::{debug, info};
use crate::args::{CpArgs, ServerTargetArgs};
use crate::command_context::CommandContext;
use crate::server_client::ServerStoreClient;
use crate::server_client::Client;
use crate::shared::{print_json_pretty, split_run_path};
#[derive(Debug)]
@ -131,7 +131,7 @@ async fn resolve_client_and_run_id(
cli: &CliSettings,
cli_layer: &CliLayer,
printer: Printer,
) -> Result<(ServerStoreClient, fabro_types::RunId)> {
) -> Result<(Client, fabro_types::RunId)> {
let ctx = CommandContext::for_target(server, printer, cli.clone(), cli_layer)?;
let client = ctx.server().await?;
let run_id = client.resolve_run(run_prefix).await?.run_id;
@ -139,7 +139,7 @@ async fn resolve_client_and_run_id(
}
async fn write_sandbox_file(
client: &ServerStoreClient,
client: &Client,
run_id: &fabro_types::RunId,
remote_path: &str,
local_path: &Path,
@ -157,7 +157,7 @@ async fn write_sandbox_file(
}
async fn upload_sandbox_file(
client: &ServerStoreClient,
client: &Client,
run_id: &fabro_types::RunId,
local_path: &Path,
remote_path: &str,
@ -169,7 +169,7 @@ async fn upload_sandbox_file(
}
async fn download_recursive(
client: &ServerStoreClient,
client: &Client,
run_id: &fabro_types::RunId,
remote_path: &str,
local_path: &Path,
@ -194,7 +194,7 @@ async fn download_recursive(
}
async fn upload_recursive(
client: &ServerStoreClient,
client: &Client,
run_id: &fabro_types::RunId,
local_path: &Path,
remote_path: &str,

View file

@ -152,7 +152,7 @@ fn try_parse_relative_duration(s: &str) -> Option<chrono::Duration> {
}
async fn follow_store_logs(
client: &server_client::ServerStoreClient,
client: &server_client::Client,
run_id: &fabro_types::RunId,
seq: u32,
pretty: bool,
@ -225,7 +225,7 @@ async fn follow_store_logs(
}
async fn run_concluded(
client: &server_client::ServerStoreClient,
client: &server_client::Client,
run_id: &fabro_types::RunId,
) -> Result<bool> {
let state = client
@ -239,7 +239,7 @@ async fn run_concluded(
}
async fn flush_remaining_store_events(
client: &server_client::ServerStoreClient,
client: &server_client::Client,
run_id: &fabro_types::RunId,
next_seq: u32,
pretty: bool,

View file

@ -131,7 +131,7 @@ pub(crate) fn api_check_report_to_local(report: &types::PreflightCheckReport) ->
}
pub(crate) async fn print_run_summary_with_client(
client: &server_client::ServerStoreClient,
client: &server_client::Client,
run_id: &fabro_types::RunId,
local_run_dir: Option<&Path>,
styles: &Styles,
@ -292,7 +292,7 @@ pub(crate) fn print_final_output(output: Option<&str>, styles: &Styles, printer:
}
async fn resolve_final_output_with_client(
client: &server_client::ServerStoreClient,
client: &server_client::Client,
run_id: &RunId,
checkpoint: Option<&fabro_types::Checkpoint>,
) -> Result<Option<String>> {
@ -317,7 +317,7 @@ async fn resolve_final_output_with_client(
}
async fn resolve_response_string(
client: &server_client::ServerStoreClient,
client: &server_client::Client,
run_id: &RunId,
response: &str,
) -> Result<Option<String>> {
@ -342,7 +342,7 @@ fn blob_id_from_response(response: &str) -> Option<RunBlobId> {
}
async fn list_artifact_display_entries_with_client(
client: &server_client::ServerStoreClient,
client: &server_client::Client,
run_id: &RunId,
) -> Result<Vec<(String, u32, String)>> {
let mut entries = Vec::new();
@ -356,7 +356,7 @@ async fn list_artifact_display_entries_with_client(
}
async fn print_assets_with_client(
client: &server_client::ServerStoreClient,
client: &server_client::Client,
run_id: &RunId,
styles: &Styles,
printer: Printer,

View file

@ -18,7 +18,7 @@ use serde::Serialize;
use crate::args::RewindArgs;
use crate::command_context::CommandContext;
use crate::commands::store::rebuild::rebuild_run_store;
use crate::server_client::ServerStoreClient;
use crate::server_client::Client;
use crate::shared::repo::ensure_matching_repo_origin;
use crate::shared::{color_if, print_json_pretty};
@ -111,7 +111,7 @@ pub(crate) fn timeline_entries_json(timeline: &RunTimeline) -> Vec<TimelineEntry
}
async fn reset_rewound_run_state(
client: &ServerStoreClient,
client: &Client,
git_store: &Store,
run_id: &fabro_types::RunId,
entry: &TimelineEntry,

View file

@ -239,7 +239,7 @@ async fn apply_worker_control_line(
fn build_artifact_uploader(
run_id: RunId,
client: server_client::ServerStoreClient,
client: server_client::Client,
artifact_upload_token: Option<String>,
) -> Arc<dyn StageArtifactUploader> {
match artifact_upload_token {
@ -254,7 +254,7 @@ fn build_artifact_uploader(
struct HttpArtifactUploader {
run_id: RunId,
client: server_client::ServerStoreClient,
client: server_client::Client,
bearer_token: String,
}
@ -318,16 +318,13 @@ impl StageArtifactUploader for MissingArtifactUploadTokenUploader {
#[derive(Clone)]
struct HttpRunStore {
run_id: RunId,
client: server_client::ServerStoreClient,
client: server_client::Client,
state: Arc<Mutex<RunProjection>>,
events: Arc<Mutex<Option<Vec<EventEnvelope>>>>,
}
impl HttpRunStore {
async fn connect(
run_id: RunId,
client: server_client::ServerStoreClient,
) -> Result<RunStoreHandle> {
async fn connect(run_id: RunId, client: server_client::Client) -> Result<RunStoreHandle> {
let state = client
.get_run_state(&run_id)
.await

View file

@ -4,7 +4,7 @@ use fabro_types::RunId;
use crate::server_client;
pub(crate) async fn start_run_with_client(
client: &server_client::ServerStoreClient,
client: &server_client::Client,
run_id: &RunId,
resume: bool,
) -> Result<()> {

View file

@ -65,7 +65,7 @@ impl Action {
async fn run_bulk(
action: Action,
identifiers: &[String],
client: &server_client::ServerStoreClient,
client: &server_client::Client,
cli: &CliSettings,
printer: Printer,
) -> Result<()> {

View file

@ -21,7 +21,7 @@ pub(crate) async fn remove_command(
async fn remove_from(
args: &RunsRemoveArgs,
client: &server_client::ServerStoreClient,
client: &server_client::Client,
cli: &CliSettings,
printer: Printer,
) -> Result<()> {
@ -83,7 +83,7 @@ async fn remove_from(
}
async fn delete_server_run(
client: &server_client::ServerStoreClient,
client: &server_client::Client,
run_id: &fabro_types::RunId,
force: bool,
) -> Result<()> {

View file

@ -2,7 +2,7 @@ use anyhow::Result;
use chrono::{DateTime, Utc};
use cli_table::format::{Border, Separator};
use cli_table::{Cell, CellStruct, Style, Table};
use fabro_api::Client;
use fabro_api::ApiClient;
use fabro_types::settings::CliSettings;
use fabro_types::settings::cli::OutputFormat;
use fabro_util::printer::Printer;
@ -24,7 +24,7 @@ fn format_age(dt: DateTime<Utc>, now: DateTime<Utc>) -> String {
}
pub(super) async fn list_command(
client: &Client,
client: &ApiClient,
_args: &SecretListArgs,
cli: &CliSettings,
printer: Printer,

View file

@ -1,5 +1,5 @@
use anyhow::Result;
use fabro_api::{Client, types};
use fabro_api::{ApiClient, types};
use fabro_types::settings::CliSettings;
use fabro_types::settings::cli::OutputFormat;
use fabro_util::printer::Printer;
@ -9,7 +9,7 @@ use crate::server_client;
use crate::shared::print_json_pretty;
pub(super) async fn rm_command(
client: &Client,
client: &ApiClient,
args: &SecretRmArgs,
cli: &CliSettings,
printer: Printer,

View file

@ -10,7 +10,7 @@
use std::io::{IsTerminal, Read as _};
use anyhow::{Context as _, Result, bail};
use fabro_api::{Client, types};
use fabro_api::{ApiClient, types};
use fabro_types::settings::CliSettings;
use fabro_types::settings::cli::OutputFormat;
use fabro_util::printer::Printer;
@ -58,7 +58,7 @@ async fn resolve_value(args: &SecretSetArgs) -> Result<String> {
}
pub(super) async fn set_command(
client: &Client,
client: &ApiClient,
args: &SecretSetArgs,
cli: &CliSettings,
printer: Printer,

View file

@ -23,7 +23,7 @@ use tokio::task::spawn_blocking;
use super::run_export::StoreRunExport;
use crate::args::StoreDumpArgs;
use crate::command_context::CommandContext;
use crate::server_client::ServerStoreClient;
use crate::server_client::Client;
use crate::shared::{absolute_or_current, print_json_pretty};
pub(crate) async fn dump_command(
@ -164,12 +164,12 @@ impl DumpDataSource for LocalDumpSource<'_> {
}
struct ServerDumpSource<'a> {
client: &'a ServerStoreClient,
client: &'a Client,
run_id: &'a RunId,
}
impl<'a> ServerDumpSource<'a> {
fn new(client: &'a ServerStoreClient, run_id: &'a RunId) -> Self {
fn new(client: &'a Client, run_id: &'a RunId) -> Self {
Self { client, run_id }
}
}

View file

@ -30,8 +30,12 @@ use crate::user_config::cli_http_client_builder;
use crate::{sse, user_config};
#[derive(Clone)]
pub(crate) struct ServerStoreClient {
client: fabro_api::Client,
#[expect(
clippy::struct_field_names,
reason = "fields name the underlying clients (api client, http client); renaming to avoid the struct's own name would obscure them"
)]
pub(crate) struct Client {
client: fabro_api::ApiClient,
http_client: fabro_http::HttpClient,
base_url: String,
}
@ -86,11 +90,11 @@ impl RunAttachEventStream {
pub(crate) use fabro_store::RunProjection;
#[cfg(test)]
pub(crate) async fn connect_server(storage_dir: &Path) -> Result<ServerStoreClient> {
pub(crate) async fn connect_server(storage_dir: &Path) -> Result<Client> {
connect_api_client_bundle(storage_dir).await
}
pub(crate) async fn connect_server_target_direct(target: &str) -> Result<ServerStoreClient> {
pub(crate) async fn connect_server_target_direct(target: &str) -> Result<Client> {
if target.starts_with("http://") || target.starts_with("https://") {
connect_remote_api_client_bundle(target, None, RemoteDevTokenAuth::Ambient)
} else {
@ -106,7 +110,7 @@ pub(crate) async fn connect_server_with_settings(
args: &ServerTargetArgs,
settings: &SettingsLayer,
base_config_path: &Path,
) -> Result<ServerStoreClient> {
) -> Result<Client> {
let target = user_config::resolve_server_target(args, settings)?;
let runtime = LocalServerRuntime {
active_config_path: base_config_path.to_path_buf(),
@ -115,7 +119,7 @@ pub(crate) async fn connect_server_with_settings(
connect_target_api_client_bundle(&target, &runtime).await
}
async fn connect_api_client_bundle(storage_dir: &Path) -> Result<ServerStoreClient> {
async fn connect_api_client_bundle(storage_dir: &Path) -> Result<Client> {
let config_path = user_config::active_settings_path(None);
let bind = start::ensure_server_running_for_storage(storage_dir, &config_path)
.await
@ -127,8 +131,8 @@ async fn connect_api_client_bundle(storage_dir: &Path) -> Result<ServerStoreClie
let builder = cli_http_client_builder().no_proxy();
let http_client = apply_bearer_token_auth(builder, &token)?.build()?;
let base_url = format!("http://{addr}");
let client = fabro_api::Client::new_with_client(&base_url, http_client.clone());
Ok(ServerStoreClient {
let client = fabro_api::ApiClient::new_with_client(&base_url, http_client.clone());
Ok(Client {
client,
http_client,
base_url,
@ -137,7 +141,7 @@ async fn connect_api_client_bundle(storage_dir: &Path) -> Result<ServerStoreClie
}
}
pub(crate) async fn connect_api_client(storage_dir: &Path) -> Result<fabro_api::Client> {
pub(crate) async fn connect_api_client(storage_dir: &Path) -> Result<fabro_api::ApiClient> {
connect_api_client_bundle(storage_dir)
.await
.map(|client| client.client)
@ -146,7 +150,7 @@ pub(crate) async fn connect_api_client(storage_dir: &Path) -> Result<fabro_api::
async fn connect_target_api_client_bundle(
target: &user_config::ServerTarget,
runtime: &LocalServerRuntime,
) -> Result<ServerStoreClient> {
) -> Result<Client> {
match target {
user_config::ServerTarget::HttpUrl { api_url, tls } => connect_remote_api_client_bundle(
api_url,
@ -184,7 +188,7 @@ fn connect_remote_api_client_bundle(
api_url: &str,
tls: Option<&user_config::ClientTlsSettings>,
dev_token_auth: RemoteDevTokenAuth<'_>,
) -> Result<ServerStoreClient> {
) -> Result<Client> {
let normalized = normalize_remote_server_target(api_url);
let mut builder = user_config::build_server_client_builder(tls)?;
builder = match dev_token_auth {
@ -202,8 +206,8 @@ fn connect_remote_api_client_bundle(
RemoteDevTokenAuth::Ambient => apply_dev_token_auth(builder, None)?,
};
let http_client = builder.build()?;
let client = fabro_api::Client::new_with_client(&normalized, http_client.clone());
Ok(ServerStoreClient {
let client = fabro_api::ApiClient::new_with_client(&normalized, http_client.clone());
Ok(Client {
client,
http_client,
base_url: normalized,
@ -357,10 +361,10 @@ fn apply_dev_token_auth(
apply_bearer_token_auth(builder, &token)
}
fn unix_socket_api_client_bundle(http_client: fabro_http::HttpClient) -> ServerStoreClient {
fn unix_socket_api_client_bundle(http_client: fabro_http::HttpClient) -> Client {
let base_url = "http://fabro".to_string();
let client = fabro_api::Client::new_with_client(&base_url, http_client.clone());
ServerStoreClient {
let client = fabro_api::ApiClient::new_with_client(&base_url, http_client.clone());
Client {
client,
http_client,
base_url,
@ -370,7 +374,7 @@ fn unix_socket_api_client_bundle(http_client: fabro_http::HttpClient) -> ServerS
async fn build_authed_unix_socket_client(
path: &Path,
storage_dir: Option<&Path>,
) -> Result<ServerStoreClient> {
) -> Result<Client> {
let http_client = if let Some(storage_dir) = storage_dir {
let token = wait_for_local_dev_token(storage_dir).await?;
apply_bearer_token_auth(
@ -398,7 +402,7 @@ fn build_unix_socket_probe_client(path: &Path) -> Result<fabro_http::HttpClient>
async fn try_connect_unix_socket_api_client_bundle(
path: &Path,
storage_dir: Option<&Path>,
) -> Result<ServerStoreClient> {
) -> Result<Client> {
check_server_ready(&build_unix_socket_probe_client(path)?).await?;
build_authed_unix_socket_client(path, storage_dir).await
}
@ -406,7 +410,7 @@ async fn try_connect_unix_socket_api_client_bundle(
async fn connect_unix_socket_api_client_bundle(
path: &Path,
storage_dir: Option<&Path>,
) -> Result<ServerStoreClient> {
) -> Result<Client> {
wait_for_server_ready(&build_unix_socket_probe_client(path)?).await?;
build_authed_unix_socket_client(path, storage_dir).await
}
@ -453,12 +457,12 @@ struct ArtifactBatchUploadEntry {
content_type: Option<String>,
}
impl ServerStoreClient {
impl Client {
/// Build a client for tests that bypasses proxy discovery.
#[cfg(test)]
pub(crate) fn new_no_proxy(base_url: &str) -> Result<Self> {
let http_client = cli_http_client_builder().no_proxy().build()?;
let client = fabro_api::Client::new_with_client(base_url, http_client.clone());
let client = fabro_api::ApiClient::new_with_client(base_url, http_client.clone());
Ok(Self {
client,
http_client,
@ -470,7 +474,7 @@ impl ServerStoreClient {
self.clone()
}
pub(crate) fn api(&self) -> &fabro_api::Client {
pub(crate) fn api(&self) -> &fabro_api::ApiClient {
&self.client
}

View file

@ -6,7 +6,7 @@ use chrono::{DateTime, Utc};
use fabro_store::RunSummary;
use fabro_types::{RunId, RunStatus, StatusReason};
use crate::server_client::ServerStoreClient;
use crate::server_client::Client;
#[derive(Debug, Clone)]
pub(crate) struct ServerRunSummaryInfo {
@ -75,12 +75,12 @@ impl ServerRunSummaryInfo {
}
pub(crate) struct ServerSummaryLookup {
client: Arc<ServerStoreClient>,
client: Arc<Client>,
runs: Vec<ServerRunSummaryInfo>,
}
impl ServerSummaryLookup {
pub(crate) async fn from_client(client: Arc<ServerStoreClient>) -> Result<Self> {
pub(crate) async fn from_client(client: Arc<Client>) -> Result<Self> {
let summaries = client.list_store_runs().await?;
let mut runs = summaries
.into_iter()
@ -94,7 +94,7 @@ impl ServerSummaryLookup {
Ok(Self { client, runs })
}
pub(crate) fn client(&self) -> &ServerStoreClient {
pub(crate) fn client(&self) -> &Client {
self.client.as_ref()
}