Skip to content

Commit

Permalink
chore: Move ContractService implementation to Contract (#1899)
Browse files Browse the repository at this point in the history
* chore: Split `build.rs` to several files

* chore: Remove `serde` from `dozer-cli/Cargo.toml`

* chore: Move `ContractService` implementation to `Contract`
  • Loading branch information
chubei committed Aug 23, 2023
1 parent 19d77d0 commit e5d5832
Show file tree
Hide file tree
Showing 20 changed files with 703 additions and 669 deletions.
2 changes: 0 additions & 2 deletions dozer-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ dozer-types = { path = "../dozer-types" }
dozer-tracing = { path = "../dozer-tracing" }
dozer-storage = { path = "../dozer-storage" }

serde_json = "1.0.93"
serde = "1.0.152"
uuid = { version = "1.3.0", features = ["v4", "serde"] }
tokio = { version = "1", features = ["full"] }
tempdir = "0.3.7"
Expand Down
1 change: 1 addition & 0 deletions dozer-cli/src/cli/helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use crate::simple::SimpleOrchestrator as Dozer;
use atty::Stream;
use dozer_types::models::config::default_cache_max_map_size;
use dozer_types::prettytable::{row, Table};
use dozer_types::serde_json;
use dozer_types::{models::config::Config, serde_yaml};
use handlebars::Handlebars;
use std::collections::BTreeMap;
Expand Down
4 changes: 3 additions & 1 deletion dozer-cli/src/cli/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use super::helper::{DESCRIPTION, LOGO};

#[cfg(feature = "cloud")]
use crate::cli::cloud::Cloud;
use dozer_types::constants::DEFAULT_CONFIG_PATH_PATTERNS;
use dozer_types::{constants::DEFAULT_CONFIG_PATH_PATTERNS, serde_json};

#[derive(Parser, Debug)]
#[command(author, version, name = "dozer")]
Expand Down Expand Up @@ -149,6 +149,8 @@ pub struct ConnectorCommand {

#[cfg(test)]
mod tests {
use dozer_types::serde_json;

#[test]
fn test_parse_config_override_string() {
let arg = "/app=\"abc\"";
Expand Down
3 changes: 2 additions & 1 deletion dozer-cli/src/cloud_app_context.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
use crate::errors::CloudContextError;
use crate::errors::CloudContextError::{AppIdNotFound, FailedToGetDirectoryPath};
use dozer_types::models::cloud::Cloud;
use dozer_types::serde::Serialize;
use dozer_types::serde_yaml;
use serde::Serialize;
use std::io::Write;
use std::{env, fs};

#[derive(Serialize)]
#[serde(crate = "dozer_types::serde")]
pub struct CloudConfig {
pub cloud: Cloud,
}
Expand Down
4 changes: 2 additions & 2 deletions dozer-cli/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ use dozer_cache::errors::CacheError;
use dozer_core::errors::ExecutionError;
use dozer_ingestion::errors::ConnectorError;
use dozer_sql::pipeline::errors::PipelineError;
use dozer_types::errors::internal::BoxedError;
use dozer_types::thiserror::Error;
use dozer_types::{errors::internal::BoxedError, serde_json};
use dozer_types::{serde_yaml, thiserror};

use crate::pipeline::connector_source::ConnectorSourceFactoryError;
Expand Down Expand Up @@ -190,7 +190,7 @@ pub enum ConfigCombineError {

#[derive(Debug, Error)]
pub enum BuildError {
#[error("Endpoint {0} found in DAG but not in configuration file")]
#[error("Endpoint {0} not found in DAG")]
MissingEndpoint(String),
#[error("Got mismatching primary key for `{endpoint_name}`. Expected: `{expected:?}`, got: `{actual:?}`")]
MismatchPrimaryKey {
Expand Down
4 changes: 3 additions & 1 deletion dozer-cli/src/live/errors.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::errors::{CliError, OrchestrationError};
use crate::errors::{BuildError, CliError, OrchestrationError};
use dozer_core::errors::ExecutionError;
use dozer_sql::pipeline::errors::PipelineError;

Expand Down Expand Up @@ -28,6 +28,8 @@ pub enum LiveError {
#[error("Cannot start ui server: {0}")]
CannotStartUiServer(#[source] std::io::Error),

#[error(transparent)]
Build(#[from] BuildError),
#[error(transparent)]
PipelineError(#[from] PipelineError),
#[error(transparent)]
Expand Down
141 changes: 0 additions & 141 deletions dozer-cli/src/live/graph.rs

This file was deleted.

8 changes: 0 additions & 8 deletions dozer-cli/src/live/helper.rs

This file was deleted.

4 changes: 1 addition & 3 deletions dozer-cli/src/live/mod.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
mod downloader;
mod errors;
mod graph;
mod server;
mod state;
mod watcher;
use std::sync::Arc;
mod helper;
use self::state::LiveState;
use crate::{cli::types::Live, live::server::LIVE_PORT, shutdown::ShutdownReceiver};
use dozer_types::{grpc_types::live::ConnectResponse, log::info};
use std::sync::Arc;
mod progress;
pub use errors::LiveError;
use futures::stream::{AbortHandle, Abortable};
Expand Down
Loading

0 comments on commit e5d5832

Please sign in to comment.