diff --git a/config/tests/test.debezium-with-schema-registry.yaml b/config/tests/test.debezium-with-schema-registry.yaml index 95cf405ee7..cc2dc30e3e 100644 --- a/config/tests/test.debezium-with-schema-registry.yaml +++ b/config/tests/test.debezium-with-schema-registry.yaml @@ -1,4 +1,5 @@ app_name: dozer-kafka-with-schema-registry-test +version: 1 api: rest: @@ -36,4 +37,4 @@ endpoints: sql: select id from products; index: primary_key: - - id \ No newline at end of file + - id diff --git a/config/tests/test.debezium.yaml b/config/tests/test.debezium.yaml index 94e352893f..68dcc7d158 100644 --- a/config/tests/test.debezium.yaml +++ b/config/tests/test.debezium.yaml @@ -1,4 +1,5 @@ app_name: dozer-kafka-test +version: 1 api: rest: diff --git a/config/tests/test.postgres.yaml b/config/tests/test.postgres.yaml index f1b840dd32..9ec8f20eb1 100644 --- a/config/tests/test.postgres.yaml +++ b/config/tests/test.postgres.yaml @@ -1,4 +1,5 @@ app_name: postgres-test +version: 1 api: rest: @@ -38,4 +39,4 @@ endpoints: sql: select id from products_test; index: primary_key: - - id \ No newline at end of file + - id diff --git a/config/tests/test.snowflake.yaml b/config/tests/test.snowflake.yaml index 2960c0f71d..80860ebad1 100644 --- a/config/tests/test.snowflake.yaml +++ b/config/tests/test.snowflake.yaml @@ -1,4 +1,5 @@ app_name: dozer-snowflake-test +version: 1 api: rest: diff --git a/dozer-cli/src/cli/init.rs b/dozer-cli/src/cli/init.rs index 9762ee8f3a..5bedb02644 100644 --- a/dozer-cli/src/cli/init.rs +++ b/dozer-cli/src/cli/init.rs @@ -175,7 +175,10 @@ pub fn generate_config_repl() -> Result<(), OrchestrationError> { let mut rl = Editor::::new() .map_err(|e| OrchestrationError::CliError(CliError::ReadlineError(e)))?; rl.set_helper(Some(InitHelper {})); - let mut default_config = Config::default(); + let mut default_config = Config { + version: 1, + ..Default::default() + }; let default_app_name = "quick-start-app"; let questions: Vec = vec![ ( diff --git a/dozer-cli/src/cli/tests.rs b/dozer-cli/src/cli/tests.rs index 03ecebc252..c05cdf4834 100644 --- a/dozer-cli/src/cli/tests.rs +++ b/dozer-cli/src/cli/tests.rs @@ -24,6 +24,7 @@ fn test_yml_content_full() -> (&'static str, Config) { }); let config = Config { app_name: "dozer-config-sample".to_owned(), + version: 1, home_dir: DEFAULT_HOME_DIR.to_owned(), api: Some(api_config), connections: vec![test_connection], @@ -35,6 +36,7 @@ fn test_yml_content_full() -> (&'static str, Config) { ( r#" app_name: dozer-config-sample + version: 1, home_dir: './.dozer' api: rest: @@ -91,6 +93,7 @@ fn test_yml_content_full() -> (&'static str, Config) { fn test_yml_content_missing_api_config() -> &'static str { r#" app_name: dozer-config-sample + version: 1, connections: - db_type: Postgres authentication: !Postgres @@ -121,6 +124,7 @@ fn test_yml_content_missing_api_config() -> &'static str { fn test_yml_content_missing_internal_config() -> &'static str { r#" app_name: dozer-config-sample + version: 1, api: rest: port: 8080 @@ -228,6 +232,7 @@ fn test_config() -> Config { let api_config = test_api_config(); Config { app_name: "dozer-config-sample".to_owned(), + version: 1, home_dir: DEFAULT_HOME_DIR.to_owned(), api: Some(api_config), connections: vec![test_connection], diff --git a/dozer-cli/src/live/state.rs b/dozer-cli/src/live/state.rs index 6dd12bb56b..40a4eb126a 100644 --- a/dozer-cli/src/live/state.rs +++ b/dozer-cli/src/live/state.rs @@ -266,8 +266,10 @@ fn get_contract(dozer_and_contract: &Option) -> Result<&Contra async fn create_contract(dozer: SimpleOrchestrator) -> Result { let dag = create_dag(&dozer).await?; + let version = dozer.config.version; let schemas = DagSchemas::new(dag)?; let contract = Contract::new( + version as usize, &schemas, &dozer.config.endpoints, // We don't care about API generation options here. They are handled in `run_all`. diff --git a/dozer-cli/src/pipeline/tests/builder.rs b/dozer-cli/src/pipeline/tests/builder.rs index 50b5833c93..2a5058a986 100644 --- a/dozer-cli/src/pipeline/tests/builder.rs +++ b/dozer-cli/src/pipeline/tests/builder.rs @@ -22,6 +22,7 @@ fn get_default_config() -> Config { Config { app_name: "multi".to_string(), + version: 1, api: Default::default(), flags: Default::default(), connections: vec![grpc_conn.clone()], diff --git a/dozer-cli/src/simple/build/contract/mod.rs b/dozer-cli/src/simple/build/contract/mod.rs index 8bd9d5b78b..c489fd84a2 100644 --- a/dozer-cli/src/simple/build/contract/mod.rs +++ b/dozer-cli/src/simple/build/contract/mod.rs @@ -49,14 +49,17 @@ pub struct EdgeType { pub type PipelineContract = daggy::Dag; -#[derive(Debug, Clone)] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(crate = "dozer_types::serde")] pub struct Contract { + pub version: usize, pub pipeline: PipelineContract, pub endpoints: BTreeMap, } impl Contract { pub fn new( + version: usize, dag_schemas: &DagSchemas, endpoints: &[ApiEndpoint], enable_token: bool, @@ -111,47 +114,19 @@ impl Contract { ); Ok(Self { + version, pipeline, endpoints: endpoint_schemas, }) } pub fn serialize(&self, build_path: &BuildPath) -> Result<(), BuildError> { - serde_json_to_path(&build_path.dag_path, &self.pipeline)?; - - for (endpoint_name, schema) in &self.endpoints { - let endpoint_path = build_path.get_endpoint_path(endpoint_name); - serde_json_to_path(&endpoint_path.schema_path, schema)?; - } - + serde_json_to_path(&build_path.dag_path, &self)?; Ok(()) } pub fn deserialize(build_path: &BuildPath) -> Result { - let pipeline: daggy::Dag = serde_json_from_path(&build_path.dag_path)?; - - let mut endpoints = BTreeMap::new(); - for (node_index, node) in pipeline.node_references() { - // Endpoint must have zero out degree. - if pipeline - .edges_directed(node_index, Direction::Outgoing) - .count() - > 0 - { - continue; - } - - // `NodeHandle::id` is the endpoint name. - let endpoint_name = node.handle.id.clone(); - let endpoint_path = build_path.get_endpoint_path(&endpoint_name); - let schema: EndpointSchema = serde_json_from_path(&endpoint_path.schema_path)?; - endpoints.insert(endpoint_name, schema); - } - - Ok(Self { - pipeline, - endpoints, - }) + serde_json_from_path(&build_path.dag_path) } } diff --git a/dozer-cli/src/simple/executor.rs b/dozer-cli/src/simple/executor.rs index af6a0f621d..f03d154353 100644 --- a/dozer-cli/src/simple/executor.rs +++ b/dozer-cli/src/simple/executor.rs @@ -21,7 +21,9 @@ use dozer_types::indicatif::MultiProgress; use dozer_types::models::connection::Connection; -use crate::errors::OrchestrationError; +use crate::errors::{BuildError, OrchestrationError}; + +use super::Contract; pub struct Executor<'a> { connections: &'a [Connection], @@ -123,9 +125,13 @@ async fn create_log_endpoint( ) -> Result { let endpoint_path = build_path.get_endpoint_path(endpoint_name); - let schema_string = tokio::fs::read_to_string(&endpoint_path.schema_path) - .await - .map_err(|e| OrchestrationError::FileSystem(endpoint_path.schema_path.into(), e))?; + let contract = Contract::deserialize(build_path)?; + let schema = contract + .endpoints + .get(endpoint_name) + .ok_or_else(|| BuildError::MissingEndpoint(endpoint_name.to_owned()))?; + let schema_string = + dozer_types::serde_json::to_string(schema).map_err(BuildError::SerdeJson)?; let descriptor_bytes = tokio::fs::read(&build_path.descriptor_path) .await diff --git a/dozer-cli/src/simple/orchestrator.rs b/dozer-cli/src/simple/orchestrator.rs index 61dd9bd068..4eff1f9a38 100644 --- a/dozer-cli/src/simple/orchestrator.rs +++ b/dozer-cli/src/simple/orchestrator.rs @@ -312,7 +312,10 @@ impl SimpleOrchestrator { .as_ref() .map(|flags| flags.push_events) .unwrap_or_else(default_push_events); + let version = self.config.version as usize; + let contract = build::Contract::new( + version, &dag_schemas, &self.config.endpoints, enable_token, diff --git a/dozer-cli/src/tests.rs b/dozer-cli/src/tests.rs index da0d1f2677..49bb363fd1 100644 --- a/dozer-cli/src/tests.rs +++ b/dozer-cli/src/tests.rs @@ -11,6 +11,7 @@ fn test_sql_merge_in_config() { let yaml = format!( r#" app_name: dozer-config-sample + version: 1 sql: {} "#, @@ -31,7 +32,10 @@ fn test_sql_merge_in_config() { fn test_sql_from_single_sql_source_in_config() { let query = "select * from table_b"; - let yaml = r#"app_name: dozer-config-sample"#; + let yaml = r#" + app_name: dozer-config-sample + version: 1 + "#; let mut combined_yaml = serde_yaml::Value::Mapping(Mapping::new()); @@ -50,6 +54,7 @@ fn test_sql_from_single_yaml_source_in_config() { let yaml = format!( r#" app_name: dozer-config-sample + version: 1 sql: {} "#, diff --git a/dozer-ingestion/src/tests/cases/postgres/dozer-config.yaml b/dozer-ingestion/src/tests/cases/postgres/dozer-config.yaml index 86319a8a3f..5ed73f09e5 100644 --- a/dozer-ingestion/src/tests/cases/postgres/dozer-config.yaml +++ b/dozer-ingestion/src/tests/cases/postgres/dozer-config.yaml @@ -1,4 +1,5 @@ app_name: 1-hypercharge-postgres-sample +version: 1 connections: - config: !Postgres user: postgres diff --git a/dozer-ingestion/src/tests/cases/snowflake/dozer-config.yaml b/dozer-ingestion/src/tests/cases/snowflake/dozer-config.yaml index 9aa11ddeb0..64d811a2df 100644 --- a/dozer-ingestion/src/tests/cases/snowflake/dozer-config.yaml +++ b/dozer-ingestion/src/tests/cases/snowflake/dozer-config.yaml @@ -1,4 +1,5 @@ app_name: snowflake-test +version: 1 connections: - config: !Snowflake server: "{{SN_SERVER}}" @@ -28,4 +29,4 @@ endpoints: table_name: customers_data index: primary_key: - - C_CUSTKEY \ No newline at end of file + - C_CUSTKEY diff --git a/dozer-ingestion/tests/test_suite/connectors/dozer.rs b/dozer-ingestion/tests/test_suite/connectors/dozer.rs index 549db35f99..d3e6d47d0f 100644 --- a/dozer-ingestion/tests/test_suite/connectors/dozer.rs +++ b/dozer-ingestion/tests/test_suite/connectors/dozer.rs @@ -200,6 +200,7 @@ async fn create_nested_dozer_server( let cache_dir = dozer_dir.join("cache"); std::fs::create_dir_all(&cache_dir).unwrap(); let config = dozer_types::models::config::Config { + version: 1, app_name: "nested-dozer-connector-test".to_owned(), home_dir: dozer_dir.to_str().unwrap().to_owned(), cache_dir: cache_dir.to_str().unwrap().to_owned(), @@ -288,6 +289,7 @@ impl Drop for DozerConnectorTest { static DOZER_CONFIG: &str = r#" app_name: dozer-nested +version: 1 connections: - config: !Grpc schemas: !Path ./schema.json diff --git a/dozer-log/src/home_dir.rs b/dozer-log/src/home_dir.rs index 1c83c95746..bf4ff5e241 100644 --- a/dozer-log/src/home_dir.rs +++ b/dozer-log/src/home_dir.rs @@ -176,11 +176,9 @@ pub struct BuildPath { impl BuildPath { pub fn get_endpoint_path(&self, endpoint_name: &str) -> EndpointPath { - let schema_path = self.contracts_dir.join(format!("{}.json", endpoint_name)); let log_dir_relative_to_data_dir = self.log_dir_relative_to_data_dir.join(endpoint_name); EndpointPath { build_id: self.id.clone(), - schema_path, log_dir_relative_to_data_dir, } } @@ -193,6 +191,5 @@ impl BuildPath { #[derive(Debug, Clone)] pub struct EndpointPath { pub build_id: BuildId, - pub schema_path: Utf8PathBuf, pub log_dir_relative_to_data_dir: Utf8PathBuf, } diff --git a/dozer-tests/src/e2e_tests/cases/dozer-samples-connectors-local-storage/dozer-config.yaml b/dozer-tests/src/e2e_tests/cases/dozer-samples-connectors-local-storage/dozer-config.yaml index fd65275c0a..4d3b699897 100644 --- a/dozer-tests/src/e2e_tests/cases/dozer-samples-connectors-local-storage/dozer-config.yaml +++ b/dozer-tests/src/e2e_tests/cases/dozer-samples-connectors-local-storage/dozer-config.yaml @@ -1,4 +1,5 @@ app_name: dozer-samples-connectors-local-storage +version: 1 connections: - config : !LocalStorage diff --git a/dozer-tests/src/e2e_tests/cases/dozer-samples-connectors-postgres/dozer-config.yaml b/dozer-tests/src/e2e_tests/cases/dozer-samples-connectors-postgres/dozer-config.yaml index 460cd0e095..8c35be1bed 100644 --- a/dozer-tests/src/e2e_tests/cases/dozer-samples-connectors-postgres/dozer-config.yaml +++ b/dozer-tests/src/e2e_tests/cases/dozer-samples-connectors-postgres/dozer-config.yaml @@ -1,4 +1,5 @@ app_name: dozer-samples-connectors-postgres +version: 1 connections: - name: pagila_conn diff --git a/dozer-tests/src/e2e_tests/cases/error_non_existing_primary_key/dozer-config.yaml b/dozer-tests/src/e2e_tests/cases/error_non_existing_primary_key/dozer-config.yaml index 6dc03180bb..721d06e0e0 100644 --- a/dozer-tests/src/e2e_tests/cases/error_non_existing_primary_key/dozer-config.yaml +++ b/dozer-tests/src/e2e_tests/cases/error_non_existing_primary_key/dozer-config.yaml @@ -1,4 +1,5 @@ app_name: working_app +version: 1 connections: - config: !Ethereum provider: !Log diff --git a/dozer-tests/src/e2e_tests/cases/eth-logs/dozer-config.yaml b/dozer-tests/src/e2e_tests/cases/eth-logs/dozer-config.yaml index 7d6638448a..7ce71f6cbf 100644 --- a/dozer-tests/src/e2e_tests/cases/eth-logs/dozer-config.yaml +++ b/dozer-tests/src/e2e_tests/cases/eth-logs/dozer-config.yaml @@ -1,4 +1,5 @@ app_name: working_app +version: 1 connections: - config: !Ethereum provider: !Log diff --git a/dozer-tests/src/e2e_tests/cases/flags_dynamic_false/dozer-config.yaml b/dozer-tests/src/e2e_tests/cases/flags_dynamic_false/dozer-config.yaml index f4e7bbf57a..37171fb270 100644 --- a/dozer-tests/src/e2e_tests/cases/flags_dynamic_false/dozer-config.yaml +++ b/dozer-tests/src/e2e_tests/cases/flags_dynamic_false/dozer-config.yaml @@ -1,4 +1,5 @@ app_name: working_app +version: 1 connections: - config: !Ethereum provider: !Log diff --git a/dozer-tests/src/e2e_tests/cases/grpc_ingest/dozer-config.yaml b/dozer-tests/src/e2e_tests/cases/grpc_ingest/dozer-config.yaml index fff28c451c..52bc8163c2 100644 --- a/dozer-tests/src/e2e_tests/cases/grpc_ingest/dozer-config.yaml +++ b/dozer-tests/src/e2e_tests/cases/grpc_ingest/dozer-config.yaml @@ -1,4 +1,5 @@ app_name: dozer-ingest-users +version: 1 connections: - config: !Grpc schemas: !Inline | diff --git a/dozer-tests/src/e2e_tests/cases/ignore-eth-traces/dozer-config.yaml b/dozer-tests/src/e2e_tests/cases/ignore-eth-traces/dozer-config.yaml index d2c76e5c34..4117b59602 100644 --- a/dozer-tests/src/e2e_tests/cases/ignore-eth-traces/dozer-config.yaml +++ b/dozer-tests/src/e2e_tests/cases/ignore-eth-traces/dozer-config.yaml @@ -1,4 +1,5 @@ app_name: dozer-eth-dashboard +version: 1 connections: - config: !Ethereum provider: !Trace diff --git a/dozer-tests/src/e2e_tests/cases/mongodb/dozer-config.yaml b/dozer-tests/src/e2e_tests/cases/mongodb/dozer-config.yaml index f3ab71784a..787461dc3d 100644 --- a/dozer-tests/src/e2e_tests/cases/mongodb/dozer-config.yaml +++ b/dozer-tests/src/e2e_tests/cases/mongodb/dozer-config.yaml @@ -1,4 +1,5 @@ app_name: mongodb-e2e-test +version: 1 connections: - config: !MongoDB connection_string: mongodb://localhost/sample_mflix diff --git a/dozer-tests/src/e2e_tests/cases/mysql-chinook/dozer-config.yaml b/dozer-tests/src/e2e_tests/cases/mysql-chinook/dozer-config.yaml index cf90262013..717b83f107 100644 --- a/dozer-tests/src/e2e_tests/cases/mysql-chinook/dozer-config.yaml +++ b/dozer-tests/src/e2e_tests/cases/mysql-chinook/dozer-config.yaml @@ -1,4 +1,5 @@ app_name: chinook-mysql +version: 1 connections: - name: chinook_mysql diff --git a/dozer-tests/src/e2e_tests/cases/pg_nested_aggregation/dozer-config.yaml b/dozer-tests/src/e2e_tests/cases/pg_nested_aggregation/dozer-config.yaml index 7c9f709b09..d1eb9efc84 100644 --- a/dozer-tests/src/e2e_tests/cases/pg_nested_aggregation/dozer-config.yaml +++ b/dozer-tests/src/e2e_tests/cases/pg_nested_aggregation/dozer-config.yaml @@ -1,4 +1,5 @@ app_name: pg_nested_aggregation +version: 1 connections: - config: !Postgres user: postgres diff --git a/dozer-tests/src/e2e_tests/cases/postgres/dozer-config.yaml b/dozer-tests/src/e2e_tests/cases/postgres/dozer-config.yaml index fed8b07ee6..60cd15b353 100644 --- a/dozer-tests/src/e2e_tests/cases/postgres/dozer-config.yaml +++ b/dozer-tests/src/e2e_tests/cases/postgres/dozer-config.yaml @@ -1,4 +1,5 @@ app_name: postgres-e2e-test +version: 1 connections: - config: !Postgres user: postgres diff --git a/dozer-tests/src/e2e_tests/cases/sql-aggregations/dozer-config.yaml b/dozer-tests/src/e2e_tests/cases/sql-aggregations/dozer-config.yaml index 12bb6568c2..66a33c8859 100644 --- a/dozer-tests/src/e2e_tests/cases/sql-aggregations/dozer-config.yaml +++ b/dozer-tests/src/e2e_tests/cases/sql-aggregations/dozer-config.yaml @@ -1,4 +1,5 @@ app_name: sql-aggregations +version: 1 connections: - config : !LocalStorage diff --git a/dozer-tests/src/e2e_tests/cases/sql-join-sample/dozer-config.yaml b/dozer-tests/src/e2e_tests/cases/sql-join-sample/dozer-config.yaml index 7cda66c66c..9b1323dc2d 100644 --- a/dozer-tests/src/e2e_tests/cases/sql-join-sample/dozer-config.yaml +++ b/dozer-tests/src/e2e_tests/cases/sql-join-sample/dozer-config.yaml @@ -1,4 +1,5 @@ app_name: sql-join-sample +version: 1 connections: - config : !LocalStorage diff --git a/dozer-tests/src/e2e_tests/cases/sql-window-functions-sample/dozer-config.yaml b/dozer-tests/src/e2e_tests/cases/sql-window-functions-sample/dozer-config.yaml index a148b1a226..78549f278a 100644 --- a/dozer-tests/src/e2e_tests/cases/sql-window-functions-sample/dozer-config.yaml +++ b/dozer-tests/src/e2e_tests/cases/sql-window-functions-sample/dozer-config.yaml @@ -1,4 +1,5 @@ app_name: sql-window-functions-sample +version: 1 connections: - config : !LocalStorage diff --git a/dozer-tests/src/e2e_tests/cases/usecases-pgflights/dozer-config.yaml b/dozer-tests/src/e2e_tests/cases/usecases-pgflights/dozer-config.yaml index 24e90b9efe..4858fd5c2a 100644 --- a/dozer-tests/src/e2e_tests/cases/usecases-pgflights/dozer-config.yaml +++ b/dozer-tests/src/e2e_tests/cases/usecases-pgflights/dozer-config.yaml @@ -1,4 +1,5 @@ app_name: flight-microservices +version: 1 cache_max_map_size: 2147483648 connections: - config: !Postgres @@ -118,4 +119,4 @@ endpoints: index: primary_key: - flight_no - - days_of_week \ No newline at end of file + - days_of_week diff --git a/dozer-tests/src/tests/e2e/fixtures/basic.yaml b/dozer-tests/src/tests/e2e/fixtures/basic.yaml index 9c9f8669f7..c06972eb78 100644 --- a/dozer-tests/src/tests/e2e/fixtures/basic.yaml +++ b/dozer-tests/src/tests/e2e/fixtures/basic.yaml @@ -1,4 +1,5 @@ app_name: dozer-users-ingest +version: 1 connections: - config: !Grpc schemas: !Inline | diff --git a/dozer-tests/src/tests/e2e/fixtures/basic_sql.yaml b/dozer-tests/src/tests/e2e/fixtures/basic_sql.yaml index b6b62674f8..e8166df2d4 100644 --- a/dozer-tests/src/tests/e2e/fixtures/basic_sql.yaml +++ b/dozer-tests/src/tests/e2e/fixtures/basic_sql.yaml @@ -1,4 +1,5 @@ app_name: dozer-ingest-users +version: 1 connections: - config: !LocalStorage details: diff --git a/dozer-tests/src/tests/e2e/fixtures/basic_sql_wildcard.yaml b/dozer-tests/src/tests/e2e/fixtures/basic_sql_wildcard.yaml index 93e63b9090..3105bdbe66 100644 --- a/dozer-tests/src/tests/e2e/fixtures/basic_sql_wildcard.yaml +++ b/dozer-tests/src/tests/e2e/fixtures/basic_sql_wildcard.yaml @@ -1,4 +1,5 @@ app_name: wildcard-test +version: 1 connections: - config: !Grpc port: 8088 diff --git a/dozer-tests/src/tests/e2e/fixtures/left_join.yaml b/dozer-tests/src/tests/e2e/fixtures/left_join.yaml index 828b1aedda..e88f8d4452 100644 --- a/dozer-tests/src/tests/e2e/fixtures/left_join.yaml +++ b/dozer-tests/src/tests/e2e/fixtures/left_join.yaml @@ -1,4 +1,5 @@ app_name: left-join-test +version: 1 connections: - config: !Grpc port: 8086 diff --git a/dozer-types/src/models/config.rs b/dozer-types/src/models/config.rs index 125ccf62b2..719967be98 100644 --- a/dozer-types/src/models/config.rs +++ b/dozer-types/src/models/config.rs @@ -12,6 +12,9 @@ use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, PartialEq, Eq, Clone, prost::Message)] /// The configuration for the app pub struct Config { + #[prost(uint32, tag = "1")] + pub version: u32, + #[prost(string, tag = "2")] /// name of the app pub app_name: String, diff --git a/dozer-types/src/tests/api_config_yaml_deserialize.rs b/dozer-types/src/tests/api_config_yaml_deserialize.rs index baa50b9844..450b21e0e4 100644 --- a/dozer-types/src/tests/api_config_yaml_deserialize.rs +++ b/dozer-types/src/tests/api_config_yaml_deserialize.rs @@ -10,6 +10,7 @@ use crate::models::{ fn override_rest_port() { let input_config = r#" app_name: working_app + version: 1 api: rest: port: 9876 @@ -35,6 +36,7 @@ fn override_rest_port() { fn override_rest_host() { let input_config = r#" app_name: working_app + version: 1 api: rest: host: localhost @@ -60,6 +62,7 @@ fn override_rest_host() { fn override_rest_enabled() { let input_config = r#" app_name: working_app + version: 1 api: rest: enabled: false @@ -85,6 +88,7 @@ fn override_rest_enabled() { fn override_grpc_port() { let input_config = r#" app_name: working_app + version: 1 api: grpc: port: 4232 @@ -110,6 +114,7 @@ fn override_grpc_port() { fn override_grpc_enabled() { let input_config = r#" app_name: working_app + version: 1 api: grpc: enabled: false @@ -135,6 +140,7 @@ fn override_grpc_enabled() { fn override_grpc_and_rest_port() { let input_config = r#" app_name: working_app + version: 1 api: grpc: port: 4232 @@ -171,6 +177,7 @@ fn override_grpc_and_rest_port() { fn override_grpc_and_rest_port_jwt() { let input_config = r#" app_name: working_app + version: 1 api: grpc: port: 4232 @@ -214,6 +221,7 @@ fn override_grpc_and_rest_port_jwt() { fn override_grpc_and_rest_port_jwt_pipeline_home_dir() { let input_config = r#" app_name: working_app + version: 1 api: grpc: port: 4232 diff --git a/dozer-types/src/tests/dozer_yaml_deserialize.rs b/dozer-types/src/tests/dozer_yaml_deserialize.rs index c781137123..bc0f456978 100644 --- a/dozer-types/src/tests/dozer_yaml_deserialize.rs +++ b/dozer-types/src/tests/dozer_yaml_deserialize.rs @@ -5,6 +5,7 @@ use crate::models::config::Config; fn error_wrong_reference_connection_name() { let input_config = r#" app_name: working_app + version: 1 home_dir: './.dozer' connections: - authentication: !Postgres @@ -45,6 +46,7 @@ fn error_wrong_reference_connection_name() { fn error_missing_field_general() { let input_config = r#" app_name: working_app + version: 1 home_dir: './.dozer' connections: - authentication: !Postgres @@ -81,6 +83,7 @@ fn error_missing_field_general() { fn error_missing_field_in_source() { let input_config = r#" app_name: working_app + version: 1 home_dir: './.dozer' connections: - authentication: !Postgres @@ -112,6 +115,7 @@ fn error_missing_field_in_source() { fn error_missing_field_connection_ref_in_source() { let input_config = r#" app_name: working_app + version: 1 home_dir: './.dozer' connections: - authentication: !Postgres @@ -143,6 +147,7 @@ fn error_missing_field_connection_ref_in_source() { fn error_missing_connection_ref() { let input_config = r#" app_name: working_app + version: 1 home_dir: './.dozer' connections: - config: !Postgres diff --git a/dozer-types/src/tests/flags_config_yaml_deserialize.rs b/dozer-types/src/tests/flags_config_yaml_deserialize.rs index 920570401d..83926a2937 100644 --- a/dozer-types/src/tests/flags_config_yaml_deserialize.rs +++ b/dozer-types/src/tests/flags_config_yaml_deserialize.rs @@ -7,6 +7,7 @@ use crate::models::{ fn test_partial_flag_config_input() { let input_config_with_flag = r#" app_name: working_app + version: 1 flags: grpc_web: false push_events: false @@ -29,6 +30,7 @@ fn test_partial_flag_config_input() { fn test_storage_params_config() { let input_config_without_flag = r#" app_name: working_app + version: 1 cache_max_map_size: 1073741824 "#; let deserializer_result = serde_yaml::from_str::(input_config_without_flag).unwrap();