diff --git a/core/startos/src/dependencies.rs b/core/startos/src/dependencies.rs index 54e38f299..013648980 100644 --- a/core/startos/src/dependencies.rs +++ b/core/startos/src/dependencies.rs @@ -9,13 +9,13 @@ use rpc_toolkit::{from_fn_async, Context, Empty, HandlerExt, ParentHandler}; use serde::{Deserialize, Serialize}; use tracing::instrument; use ts_rs::TS; -use url::Url; use crate::config::{Config, ConfigSpec, ConfigureContext}; -use crate::context::RpcContext; +use crate::context::{CliContext, RpcContext}; use crate::db::model::package::CurrentDependencies; use crate::prelude::*; use crate::rpc_continuations::Guid; +use crate::util::serde::HandlerExtSerde; use crate::util::PathOrUrl; use crate::Error; @@ -65,11 +65,20 @@ pub struct ConfigureParams { dependency_id: PackageId, } pub fn configure() -> ParentHandler { - ParentHandler::new().root_handler( - from_fn_async(configure_impl) - .with_inherited(|params, _| params) - .no_cli(), - ) + ParentHandler::new() + .root_handler( + from_fn_async(configure_impl) + .with_inherited(|params, _| params) + .no_display() + .with_call_remote::(), + ) + .subcommand( + "dry", + from_fn_async(configure_dry) + .with_inherited(|params, _| params) + .with_display_serializable() + .with_call_remote::(), + ) } pub async fn configure_impl( @@ -105,6 +114,17 @@ pub async fn configure_impl( Ok(()) } +pub async fn configure_dry( + ctx: RpcContext, + _: Empty, + ConfigureParams { + dependent_id, + dependency_id, + }: ConfigureParams, +) -> Result { + configure_logic(ctx.clone(), (dependent_id, dependency_id.clone())).await +} + #[derive(Clone, Debug, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct ConfigDryRes { diff --git a/core/startos/src/service/dependencies.rs b/core/startos/src/service/dependencies.rs index 60fd76ad6..e8c6f07c4 100644 --- a/core/startos/src/service/dependencies.rs +++ b/core/startos/src/service/dependencies.rs @@ -38,7 +38,7 @@ impl ServiceActorSeed { ) .await .with_kind(ErrorKind::Dependency) - .map(|res| res.filter(|c| !c.is_empty())) + .map(|res| res.filter(|c| !c.is_empty() && Some(c) != remote_config.as_ref())) } }