diff --git a/eden/fs/cli_rs/edenfs-client/src/checkout.rs b/eden/fs/cli_rs/edenfs-client/src/checkout.rs index 6a1b49a7ed656..5392bf869e713 100644 --- a/eden/fs/cli_rs/edenfs-client/src/checkout.rs +++ b/eden/fs/cli_rs/edenfs-client/src/checkout.rs @@ -46,12 +46,12 @@ use serde::Serializer; use strum::EnumString; use strum::EnumVariantNames; use strum::VariantNames; -use thrift_types::edenfs::errors::eden_service::PrefetchFilesError; use thrift_types::edenfs::types::GlobParams; use thrift_types::edenfs::types::MountInfo; use thrift_types::edenfs::types::MountState; use thrift_types::edenfs::types::PredictiveFetch; use thrift_types::edenfs::types::PrefetchParams; +use thrift_types::edenfs_clients::errors::PrefetchFilesError; use thrift_types::fbthrift::ApplicationExceptionErrorCode; use toml::value::Value; use uuid::Uuid; diff --git a/eden/fs/cli_rs/edenfs-client/src/instance.rs b/eden/fs/cli_rs/edenfs-client/src/instance.rs index e47e70fd4a0b3..762cb56399bda 100644 --- a/eden/fs/cli_rs/edenfs-client/src/instance.rs +++ b/eden/fs/cli_rs/edenfs-client/src/instance.rs @@ -27,7 +27,7 @@ use edenfs_utils::strip_unc_prefix; use fbinit::expect_init; use fbthrift_socket::SocketTransport; #[cfg(fbcode_build)] -use thrift_streaming::streaming_eden_service::StreamStartStatusError; +use thrift_streaming_clients::errors::StreamStartStatusError; #[cfg(fbcode_build)] use thrift_streaming_thriftclients::build_StreamingEdenService_client; use thrift_types::edenfs::types::DaemonInfo; diff --git a/eden/fs/cli_rs/edenfs-client/src/lib.rs b/eden/fs/cli_rs/edenfs-client/src/lib.rs index 6079b48e21d86..ffa59821aa852 100644 --- a/eden/fs/cli_rs/edenfs-client/src/lib.rs +++ b/eden/fs/cli_rs/edenfs-client/src/lib.rs @@ -9,10 +9,10 @@ use std::sync::Arc; use futures::stream::BoxStream; #[cfg(fbcode_build)] -use thrift_streaming::errors::streaming_eden_service::StreamStartStatusStreamError; -#[cfg(fbcode_build)] use thrift_streaming::types::EdenStartStatusUpdate; #[cfg(fbcode_build)] +use thrift_streaming_clients::errors::StreamStartStatusStreamError; +#[cfg(fbcode_build)] use thrift_streaming_clients::StreamingEdenService; use thrift_types::edenfs_clients::EdenService; diff --git a/eden/mononoke/hooks/TARGETS b/eden/mononoke/hooks/TARGETS index 812f62b3fdc42..c955f0ae7cfe8 100644 --- a/eden/mononoke/hooks/TARGETS +++ b/eden/mononoke/hooks/TARGETS @@ -71,7 +71,6 @@ rust_library( "//infrasec/authorization/if:if-aclchecker-rust", "//infrasec/authorization/if:if-aclchecker-rust-clients", "//infrasec/authorization/if:if-aclchecker-rust-srclients", - "//infrasec/authorization/if:if-service-rust", "//infrasec/authorization/if:if-service-rust-clients", "//infrasec/authorization/if:if-service-rust-srclients", "//security/source_control/verify_integrity:verify_integrity_client_lib", diff --git a/eden/mononoke/land_service/src/errors.rs b/eden/mononoke/land_service/src/errors.rs index 1638f009dc23b..5e51ead6ab97b 100644 --- a/eden/mononoke/land_service/src/errors.rs +++ b/eden/mononoke/land_service/src/errors.rs @@ -11,8 +11,8 @@ use anyhow::Error; use bookmarks_movement::describe_hook_rejections; use bookmarks_movement::BookmarkMovementError; use bookmarks_movement::HookRejection; -use land_service_if::services::land_service::LandChangesetsExn; use land_service_if::InternalError; +use land_service_if_services::errors::LandChangesetsExn; use mononoke_api::MononokeError; use pushrebase::PushrebaseConflict; use pushrebase::PushrebaseError; @@ -66,7 +66,7 @@ impl From for LandChangesetsExn { fn from(e: LandChangesetsError) -> LandChangesetsExn { match e { LandChangesetsError::InternalError(e) => { - land_service_if::services::land_service::LandChangesetsExn::internal_error(e) + land_service_if_services::errors::LandChangesetsExn::internal_error(e) } LandChangesetsError::HookRejections(rejections) => { LandChangesetsExn::hook_rejections(land_service_if::HookRejectionsException { diff --git a/eden/mononoke/land_service/src/facebook.rs b/eden/mononoke/land_service/src/facebook.rs index ffc7b4e68ade9..01852f23041c9 100644 --- a/eden/mononoke/land_service/src/facebook.rs +++ b/eden/mononoke/land_service/src/facebook.rs @@ -11,9 +11,9 @@ use std::sync::Arc; use async_trait::async_trait; use fb303_core::fb303_status; -use fb303_core::services::base_service::GetNameExn; -use fb303_core::services::base_service::GetStatusDetailsExn; -use fb303_core::services::base_service::GetStatusExn; +use fb303_core_services::errors::GetNameExn; +use fb303_core_services::errors::GetStatusDetailsExn; +use fb303_core_services::errors::GetStatusExn; use fb303_core_services::BaseService; #[derive(Clone)] diff --git a/eden/mononoke/land_service/src/land_service_impl.rs b/eden/mononoke/land_service/src/land_service_impl.rs index cff5a471ff4c7..17432e77b9ee9 100644 --- a/eden/mononoke/land_service/src/land_service_impl.rs +++ b/eden/mononoke/land_service/src/land_service_impl.rs @@ -13,8 +13,8 @@ use async_trait::async_trait; use futures::channel::oneshot; use futures::future::BoxFuture; use futures::future::Shared; -use land_service_if::services::land_service::LandChangesetsExn; use land_service_if::types::*; +use land_service_if_services::errors::LandChangesetsExn; use land_service_if_services::LandService; use mononoke_api::CoreContext; use parking_lot::Mutex; diff --git a/eden/mononoke/pushrebase/TARGETS b/eden/mononoke/pushrebase/TARGETS index a548c38316f8b..28d6613169aee 100644 --- a/eden/mononoke/pushrebase/TARGETS +++ b/eden/mononoke/pushrebase/TARGETS @@ -94,7 +94,7 @@ rust_library( name = "pushrebase_client", srcs = glob(["client/**/*.rs"]), autocargo = {"cargo_toml_dir": "client"}, - deps = [ + deps = ([ "fbsource//third-party/rust:async-trait", "fbsource//third-party/rust:bytes", "//common/rust/smc-thrift:smc-thrift", @@ -115,5 +115,5 @@ rust_library( "fbsource//third-party/rust:arc-swap", "fbsource//third-party/rust:regex", "//eden/mononoke/repo_attributes/repo_identity:repo_identity", - ]), + ])) + ["//eden/mononoke/land_service/if:land_service_if-rust-clients"], ) diff --git a/eden/mononoke/scs_server/src/errors.rs b/eden/mononoke/scs_server/src/errors.rs index dba6965ea8bc9..26917bf53aa22 100644 --- a/eden/mononoke/scs_server/src/errors.rs +++ b/eden/mononoke/scs_server/src/errors.rs @@ -13,7 +13,7 @@ use git_types::GitError; use megarepo_error::MegarepoError; use mononoke_api::MononokeError; use source_control as thrift; -use source_control::services::source_control_service as service; +use source_control_services::errors::source_control_service as service; pub(crate) enum ServiceError { Request(thrift::RequestError), diff --git a/eden/mononoke/scs_server/src/facebook.rs b/eden/mononoke/scs_server/src/facebook.rs index 8a259401c688c..012c2cba88b65 100644 --- a/eden/mononoke/scs_server/src/facebook.rs +++ b/eden/mononoke/scs_server/src/facebook.rs @@ -11,9 +11,9 @@ use std::sync::Arc; use async_trait::async_trait; use fb303_core::fb303_status; -use fb303_core::services::base_service::GetNameExn; -use fb303_core::services::base_service::GetStatusDetailsExn; -use fb303_core::services::base_service::GetStatusExn; +use fb303_core_services::errors::GetNameExn; +use fb303_core_services::errors::GetStatusDetailsExn; +use fb303_core_services::errors::GetStatusExn; use fb303_core_services::BaseService; #[derive(Clone)] diff --git a/eden/mononoke/scs_server/src/methods/repo/land_stack.rs b/eden/mononoke/scs_server/src/methods/repo/land_stack.rs index c7e628be1505d..6172b3dc2a453 100644 --- a/eden/mononoke/scs_server/src/methods/repo/land_stack.rs +++ b/eden/mononoke/scs_server/src/methods/repo/land_stack.rs @@ -16,7 +16,7 @@ use mononoke_api::MononokeError; use pushrebase::PushrebaseConflict; use service::RepoLandStackExn; use source_control as thrift; -use source_control::services::source_control_service as service; +use source_control_services::errors::source_control_service as service; use crate::commit_id::CommitIdExt; use crate::errors; diff --git a/eden/mononoke/scs_server/src/source_control_impl.rs b/eden/mononoke/scs_server/src/source_control_impl.rs index 463f5f8f6d3fb..02e322bff5cdb 100644 --- a/eden/mononoke/scs_server/src/source_control_impl.rs +++ b/eden/mononoke/scs_server/src/source_control_impl.rs @@ -52,7 +52,7 @@ use scuba_ext::MononokeScubaSampleBuilder; use scuba_ext::ScubaValue; use slog::Logger; use source_control as thrift; -use source_control::services::source_control_service as service; +use source_control_services::errors::source_control_service as service; use source_control_services::SourceControlService; use srserver::RequestContext; use stats::prelude::*; diff --git a/eden/scm/lib/clidispatch/src/errors.rs b/eden/scm/lib/clidispatch/src/errors.rs index 9e87843b044f1..daccaa21a6836 100644 --- a/eden/scm/lib/clidispatch/src/errors.rs +++ b/eden/scm/lib/clidispatch/src/errors.rs @@ -11,7 +11,7 @@ use configmodel::Config; use configmodel::ConfigExt; use thiserror::Error; #[cfg(feature = "eden")] -use thrift_types::edenfs as eden; +use thrift_types::edenfs_clients as eden_clients; #[derive(Debug, Error)] #[error("cannot decode arguments")] @@ -79,9 +79,7 @@ pub fn print_error(err: &anyhow::Error, io: &crate::io::IO, _args: &[String]) { } else { #[cfg(feature = "eden")] { - if let Some(eden::errors::eden_service::GetScmStatusV2Error::ex(e)) = - err.downcast_ref::() - { + if let Some(eden_clients::errors::GetScmStatusV2Error::ex(e)) = err.downcast_ref() { let _ = io.write_err(format!("abort: {}\n", e.message)); let _ = io.flush(); return; @@ -164,6 +162,9 @@ pub fn triage_error( mod tests { use std::io::Cursor; + #[cfg(feature = "eden")] + use thrift_types::edenfs as eden; + use super::*; #[test] @@ -172,14 +173,13 @@ mod tests { let error_msg = "cannot compute status while a checkout is currently in progress"; let expected_error = format!("abort: {}\n", error_msg); - let error: anyhow::Error = - eden::errors::eden_service::GetScmStatusV2Error::ex(eden::EdenError { - message: error_msg.to_string(), - errorCode: Some(255), - errorType: eden::EdenErrorType::CHECKOUT_IN_PROGRESS, - ..Default::default() - }) - .into(); + let error: anyhow::Error = eden_clients::errors::GetScmStatusV2Error::ex(eden::EdenError { + message: error_msg.to_string(), + errorCode: Some(255), + errorType: eden::EdenErrorType::CHECKOUT_IN_PROGRESS, + ..Default::default() + }) + .into(); let tin = Cursor::new(Vec::new()); let tout = Cursor::new(Vec::new());