Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 38 additions & 20 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,27 @@ homepage = "https://code0.tech"
license = "Apache-2.0"

[dependencies]
tucana = { version = "0.0.39", features = ["aquila"] }
tucana = { version = "0.0.41", features = ["aquila"] }
async-trait = "0.1.85"
log = "0.4.24"
tonic = "0.14.1"
dotenv = "0.15.0"
code0-definition-reader = "0.0.18"
tonic-health = "0.14.1"
async-nats = "0.45.0"
futures-core = "0.3.31"
regex = "1.11.2"
serde_json = "1.0.143"
walkdir = "2.5.0"
serde = "1.0.228"

[lib]
doctest = true

[features]
default = ["all"]
flow_definition = []
flow_service = ["flow_definition"]
flow_config = []
flow_health = []
flow_validator = []
all = ["flow_definition", "flow_config", "flow_health", "flow_validator"]
all = ["flow_definition", "flow_config", "flow_health", "flow_validator", "flow_service"]
23 changes: 23 additions & 0 deletions src/flow_definition/error/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
use std::io;
use std::path::PathBuf;

#[derive(Debug)]
pub enum ReaderError {
JsonError {
path: PathBuf,
error: serde_json::Error,
},
ReadFeatureError {
path: String,
source: Box<ReaderError>,
},
ReadDirectoryError {
path: PathBuf,
error: io::Error,
},
ReadFileError {
path: PathBuf,
error: io::Error,
},
DirectoryEntryError(io::Error),
}
Comment on lines +4 to +23
Copy link

Copilot AI Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ReaderError enum lacks documentation. Error types should be documented to help users understand when each error occurs:

/// Errors that can occur while reading definition files.
#[derive(Debug)]
pub enum ReaderError {
    /// Failed to parse JSON from a definition file.
    JsonError {
        /// The path to the file that failed to parse
        path: PathBuf,
        /// The underlying JSON parsing error
        error: serde_json::Error,
    },
    /// Failed to read a feature's definitions.
    ReadFeatureError {
        /// The path to the feature directory
        path: String,
        /// The underlying error that caused this failure
        source: Box<ReaderError>,
    },
    /// Failed to read a directory.
    ReadDirectoryError {
        /// The path to the directory that failed to read
        path: PathBuf,
        /// The underlying I/O error
        error: io::Error,
    },
    /// Failed to read a file.
    ReadFileError {
        /// The path to the file that failed to read
        path: PathBuf,
        /// The underlying I/O error
        error: io::Error,
    },
    /// Failed to read a directory entry.
    DirectoryEntryError(io::Error),
}

Copilot uses AI. Check for mistakes.
10 changes: 10 additions & 0 deletions src/flow_definition/feature/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use serde::Deserialize;
use tucana::shared::{DefinitionDataType, FlowType, RuntimeFunctionDefinition};

#[derive(Deserialize, Debug, Clone)]
pub struct Feature {
pub name: String,
pub data_types: Vec<DefinitionDataType>,
pub flow_types: Vec<FlowType>,
Comment on lines +5 to +10
Copy link

Copilot AI Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Feature struct lacks documentation. Public structs should have doc comments explaining their purpose and fields:

/// Represents a feature containing related flow definitions.
///
/// A feature groups together data types, flow types, and runtime function
/// definitions that belong to the same logical feature or module.
#[derive(Deserialize, Debug, Clone)]
pub struct Feature {
    /// The name of the feature
    pub name: String,
    /// Data type definitions associated with this feature
    pub data_types: Vec<DefinitionDataType>,
    /// Flow type definitions associated with this feature
    pub flow_types: Vec<FlowType>,
    /// Runtime function definitions associated with this feature
    pub functions: Vec<RuntimeFunctionDefinition>,
}
Suggested change
#[derive(Deserialize, Debug, Clone)]
pub struct Feature {
pub name: String,
pub data_types: Vec<DefinitionDataType>,
pub flow_types: Vec<FlowType>,
/// Represents a feature containing related flow definitions.
///
/// A feature groups together data types, flow types, and runtime function
/// definitions that belong to the same logical feature or module.
#[derive(Deserialize, Debug, Clone)]
pub struct Feature {
/// The name of the feature.
pub name: String,
/// Data type definitions associated with this feature.
pub data_types: Vec<DefinitionDataType>,
/// Flow type definitions associated with this feature.
pub flow_types: Vec<FlowType>,
/// Runtime function definitions associated with this feature.

Copilot uses AI. Check for mistakes.
pub functions: Vec<RuntimeFunctionDefinition>,
}
Loading