diff --git a/Cargo.toml b/Cargo.toml index 5cec78da..9cad86de 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ publish = false # cargo # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -mesa = "0.33.0" +mesa = "0.33.1" # mesa = { path = "../mesa" } # Only for development purposes strum = "0.25.0" strum_macros = "0.25" diff --git a/src/cli/commands/get_configuration.rs b/src/cli/commands/get_configuration.rs index 7dbaa48b..56a9e595 100644 --- a/src/cli/commands/get_configuration.rs +++ b/src/cli/commands/get_configuration.rs @@ -3,7 +3,7 @@ use mesa::{ self, configuration::mesa::r#struct::{ cfs_configuration::{Configuration, Layer}, - cfs_configuration_response::CfsConfigurationResponse, + cfs_configuration_response::{self, CfsConfigurationResponse}, }, }, common::gitea, @@ -54,6 +54,9 @@ pub async fn exec( let layer_details: Layer = get_configuration_layer_details(shasta_root_cert, gitea_token, layer).await; + println!("DEBUG - layer :\n{:#?}", layer); + println!("DEBUG - layer details:\n{}", layer_details); + layers.push(layer_details); } @@ -71,7 +74,7 @@ pub async fn exec( pub async fn get_configuration_layer_details( shasta_root_cert: &[u8], gitea_token: &str, - layer: &mesa::cfs::configuration::mesa::r#struct::cfs_configuration_response::Layer, + layer: &cfs_configuration_response::Layer, ) -> Layer { let commit_id: String = layer.commit.clone().unwrap_or("Not defined".to_string()); // let branch_name_opt: Option<&str> = layer.branch.as_deref(); @@ -328,6 +331,7 @@ pub async fn get_configuration_layer_details( .unwrap(), &branch_name, &tag_name, + &layer.playbook, // most_recent_commit, ) } diff --git a/src/common/cfs_configuration_utils.rs b/src/common/cfs_configuration_utils.rs index 776f7169..e70a35c0 100644 --- a/src/common/cfs_configuration_utils.rs +++ b/src/common/cfs_configuration_utils.rs @@ -15,20 +15,22 @@ pub fn print_table_struct(cfs_configurations: &Vec) { let layers_json = &cfs_configuration.layers; layers = format!( - "COMMIT: {} NAME: {}", + "NAME: {}\nPLAYBOOK: {}\nCOMMIT: {}", + layers_json[0].name, + layers_json[0].playbook, layers_json[0] .commit .as_ref() .unwrap_or(&"Not defined".to_string()), - layers_json[0].name ); for layer in layers_json.iter().skip(1) { layers = format!( - "{}\nCOMMIT: {} NAME: {}", + "{}\n\nNAME: {}\nPLAYBOOK: {}\nCOMMIT: {}", layers, + layer.name, + layer.playbook, layer.commit.as_ref().unwrap_or(&"Not defined".to_string()), - layer.name ); } } @@ -52,7 +54,7 @@ pub fn print_table_details_struct(cfs_configuration: Configuration) { for layer in cfs_configuration.config_layers { layers = format!( - "{}\n\nName: {}\nBranch: {}\nTag: {}\nCommit date: {}\nAuthor: {}\nSHA: {}", + "{}\n\nName: {}\nBranch: {}\nTag: {}\nCommit date: {}\nAuthor: {}\nSHA: {}\nPLAYBOOK: {}", layers, layer.name, layer.branch, @@ -65,6 +67,7 @@ pub fn print_table_details_struct(cfs_configuration: Configuration) { layer.commit_date, layer.author, layer.commit_id, + layer.playbook ); }