From 068d3d5b72bac1a69bf2236f261cd5e9e13c92c9 Mon Sep 17 00:00:00 2001 From: "ayush.jain@juspay.in" Date: Thu, 21 Nov 2024 13:32:20 +0530 Subject: [PATCH] fix: Add exp feature flag --- crates/experimentation_platform/Cargo.toml | 1 + crates/superposition_types/Cargo.toml | 5 +++-- crates/superposition_types/src/config.rs | 2 +- crates/superposition_types/src/lib.rs | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/experimentation_platform/Cargo.toml b/crates/experimentation_platform/Cargo.toml index c27c229b..e12ef6e0 100644 --- a/crates/experimentation_platform/Cargo.toml +++ b/crates/experimentation_platform/Cargo.toml @@ -22,6 +22,7 @@ serde_json = { workspace = true } service_utils = { path = "../service_utils" } superposition_macros = { path = "../superposition_macros" } superposition_types = { path = "../superposition_types", features = [ + "experimentation", "result", "diesel_derives", ] } diff --git a/crates/superposition_types/Cargo.toml b/crates/superposition_types/Cargo.toml index 78cbdda6..19875942 100644 --- a/crates/superposition_types/Cargo.toml +++ b/crates/superposition_types/Cargo.toml @@ -13,7 +13,7 @@ cac_db_config = { path = "../cac_db_config", optional = true } chrono = { workspace = true } derive_more = { workspace = true } diesel = { workspace = true, optional = true } -experimentation_db_config = { path = "../experimentation_db_config" } +experimentation_db_config = { path = "../experimentation_db_config", optional = true } jsonlogic = { workspace = true } log = { workspace = true } regex = { workspace = true } @@ -30,11 +30,12 @@ diesel_derives = [ "dep:superposition_derives", "dep:cac_db_config", "cac_db_config/diesel_derives", - "experimentation_db_config/diesel_derives", + "experimentation_db_config?/diesel_derives", ] disable_db_data_validation = [] result = ["dep:diesel", "dep:anyhow", "dep:thiserror", "dep:actix-web"] server = ["dep:actix-web"] +experimentation = ["dep:experimentation_db_config"] [lints] workspace = true diff --git a/crates/superposition_types/src/config.rs b/crates/superposition_types/src/config.rs index 2ba43a05..d75ee8da 100644 --- a/crates/superposition_types/src/config.rs +++ b/crates/superposition_types/src/config.rs @@ -46,7 +46,7 @@ macro_rules! impl_try_from_map { feature = "diesel_derives", derive(AsExpression, FromSqlRow, JsonFromSql, JsonToSql) )] -#[cfg_attr(feature = "diesel_derives",diesel(sql_type = Json))] +#[cfg_attr(feature = "diesel_derives", diesel(sql_type = Json))] pub struct Overrides(Map); impl Overrides { diff --git a/crates/superposition_types/src/lib.rs b/crates/superposition_types/src/lib.rs index 1aede985..2d5c548b 100644 --- a/crates/superposition_types/src/lib.rs +++ b/crates/superposition_types/src/lib.rs @@ -4,6 +4,7 @@ mod config; mod contextual; #[cfg(feature = "server")] pub mod custom_query; +#[cfg(feature = "experimentation")] pub mod exp_models; mod overridden; #[cfg(feature = "result")]