diff --git a/Cargo.lock b/Cargo.lock index cf77157..403ed9e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -622,7 +622,7 @@ dependencies = [ [[package]] name = "fslabscli" -version = "0.2.0" +version = "0.3.1" dependencies = [ "anyhow", "assert_fs", diff --git a/Cargo.toml b/Cargo.toml index 3599700..6a8f87d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fslabscli" -version = "0.3.1" +version = "0.3.2" edition = "2021" authors = ["FSLABS DevOps Gods"] repository = "https://github.com/ForesightMiningSoftwareCorporation/fslabsci" diff --git a/src/commands/check_workspace/mod.rs b/src/commands/check_workspace/mod.rs index 01ad514..64c129a 100644 --- a/src/commands/check_workspace/mod.rs +++ b/src/commands/check_workspace/mod.rs @@ -120,14 +120,14 @@ pub struct PackageMetadataFslabsCiTest { pub skip: Option, } -#[derive(Deserialize, Default)] +#[derive(Deserialize, Default, Debug)] struct PackageMetadataFslabsCi { - pub publish: PackageMetadataFslabsCiPublish, + pub publish: Option, #[serde(default)] - pub test: PackageMetadataFslabsCiTest, + pub test: Option, } -#[derive(Deserialize, Default)] +#[derive(Deserialize, Default, Debug)] struct PackageMetadata { pub fslabs: PackageMetadataFslabsCi, } @@ -146,8 +146,11 @@ impl Result { .unwrap() .to_path_buf(); let metadata: PackageMetadata = - from_value(package.metadata).unwrap_or_else(|_| PackageMetadata::default()); - let mut publish = metadata.fslabs.publish; + from_value(package.metadata.clone()).unwrap_or_else(|_| PackageMetadata::default()); + let mut publish = metadata + .fslabs + .publish + .unwrap_or_else(|| PackageMetadataFslabsCiPublish::default()); publish.cargo.registry = match package.publish.clone() { Some(r) => Some(r.clone()), None => { @@ -188,7 +191,10 @@ impl Result { version: package.version.to_string(), path, publish_detail: publish, - test_detail: metadata.fslabs.test, + test_detail: metadata + .fslabs + .test + .unwrap_or_else(|| PackageMetadataFslabsCiTest::default()), dependencies, ..Default::default() }) diff --git a/src/commands/generate_workflow/mod.rs b/src/commands/generate_workflow/mod.rs index 0d13515..2296b6b 100644 --- a/src/commands/generate_workflow/mod.rs +++ b/src/commands/generate_workflow/mod.rs @@ -327,7 +327,7 @@ impl FromMap for GithubWorkflowJobSecret { } } -#[derive(Clone, Default)] +#[derive(Clone, Default, Debug)] pub struct StringBool(bool); impl From for Value { diff --git a/src/commands/generate_workflow/test_workflow.rs b/src/commands/generate_workflow/test_workflow.rs index d1dfe24..8a2f42a 100644 --- a/src/commands/generate_workflow/test_workflow.rs +++ b/src/commands/generate_workflow/test_workflow.rs @@ -3,7 +3,7 @@ use serde_yaml::Value; use crate::commands::generate_workflow::StringBool; -#[derive(Default, Clone)] +#[derive(Default, Clone, Debug)] pub struct TestWorkflowArgs { /// Package that needs to be installed before Rust compilation can happens pub required_packages: Option, diff --git a/src/commands/summaries/mod.rs b/src/commands/summaries/mod.rs index 0bbaaf0..d82e417 100644 --- a/src/commands/summaries/mod.rs +++ b/src/commands/summaries/mod.rs @@ -332,6 +332,7 @@ pub async fn checks_summaries( ), ("tests".to_string(), check_summary.outputs.tests.clone()), ]; + println!("Got subchecks: {:?}", sub_checks.clone()); let mut checked_sub_checks: Vec<(String, CheckOutput)> = vec![]; for (subcheck, check) in sub_checks { if let Some(check) = check { @@ -347,6 +348,7 @@ pub async fn checks_summaries( } } } + println!("Got subchecks: {:?}", checked_sub_checks.clone()); // order sub check by number checked_sub_checks.sort_by_key(|(_, o)| o.number.unwrap()); check_outputs.push(CheckedOutput { @@ -369,6 +371,7 @@ pub async fn checks_summaries( let mut rows: Vec> = vec![header_row]; check_outputs.sort_by_key(|c| c.check_name.clone()); for checked in check_outputs.iter() { + println!("Checked:{} {:?}", checked.check_name, checked.sub_checks); let colspan = lcm_result / (checked.sub_checks.len()); let check_cell_name = format!( "{} {}", diff --git a/summaries_data/ci_tests-check.json b/summaries_data/ci_tests-check.json index 6ae3853..d5430bc 100644 --- a/summaries_data/ci_tests-check.json +++ b/summaries_data/ci_tests-check.json @@ -1,13 +1,13 @@ { "name": "ci_tests", - "start_time": "1709641211000", - "end_time": "1709641238000", + "start_time": "1709648904000", + "end_time": "1709648914000", "working_directory": ".", "type": "check", "server_url": "https://github.com", "repository": "ForesightMiningSoftwareCorporation/ci_tests", - "run_id": "8017778855", - "run_attempt": "22", + "run_id": "8157844148", + "run_attempt": "2", "actor": "loispostula", "event_name": "pull_request", "outputs": { diff --git a/summaries_data/ci_tests-miri.json b/summaries_data/ci_tests-miri.json index 525e8e5..1b2c50d 100644 --- a/summaries_data/ci_tests-miri.json +++ b/summaries_data/ci_tests-miri.json @@ -1,13 +1,13 @@ { "name": "ci_tests", - "start_time": "1709641317000", - "end_time": "1709641319000", + "start_time": "1709648904000", + "end_time": "1709648905000", "working_directory": ".", "type": "miri", "server_url": "https://github.com", "repository": "ForesightMiningSoftwareCorporation/ci_tests", - "run_id": "8017778855", - "run_attempt": "22", + "run_id": "8157844148", + "run_attempt": "2", "actor": "loispostula", "event_name": "pull_request", "outputs": { diff --git a/summaries_data/ci_tests-test.json b/summaries_data/ci_tests-test.json index 3d3e095..7b69a8d 100644 --- a/summaries_data/ci_tests-test.json +++ b/summaries_data/ci_tests-test.json @@ -1,13 +1,13 @@ { "name": "ci_tests", - "start_time": "1709641250000", - "end_time": "1709641256000", + "start_time": "1709648903000", + "end_time": "1709648905000", "working_directory": ".", "type": "test", "server_url": "https://github.com", "repository": "ForesightMiningSoftwareCorporation/ci_tests", - "run_id": "8017778855", - "run_attempt": "22", + "run_id": "8157844148", + "run_attempt": "2", "actor": "loispostula", "event_name": "pull_request", "outputs": {