From 18e9b13c44a3d960b9e2b8e871078efa0f00ce9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Greinhofer?= Date: Mon, 9 Dec 2024 14:07:20 -0600 Subject: [PATCH] Update BNA REST API Client (#27) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updates the BNS REST API client to the current version. Signed-off-by: Rémy Greinhofer --- Cargo.lock | 2 +- Cargo.toml | 2 +- lambdas/src/bna-fargate-run.rs | 2 +- lambdas/src/bna-save-results.rs | 27 ++++++++++++++++++++++++++- 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d8506ba..0861246 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -792,7 +792,7 @@ dependencies = [ [[package]] name = "bnaclient" version = "1.0.0" -source = "git+https://github.com/PeopleForBikes/bna-api?rev=8f7c5cf#8f7c5cf914504803d1b6f860c035abf37e597c3b" +source = "git+https://github.com/PeopleForBikes/bna-api?rev=f4c3ae6#f4c3ae6d27ebe1cb9f123a2b14533a5d3dcf85b4" dependencies = [ "bytes", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 0f7e9ad..348bd7a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ aws-sdk-s3 = "1.65.0" aws-sdk-sqs = "1.50.0" aws-smithy-types-convert = "0.60.8" axum = "0.7.7" -bnaclient = { git = "https://github.com/PeopleForBikes/bna-api", rev = "8f7c5cf" } +bnaclient = { git = "https://github.com/PeopleForBikes/bna-api", rev = "f4c3ae6" } bnacore = { git = "https://github.com/PeopleForBikes/brokenspoke", rev = "c20ec31" } chrono = "0.4.39" clap = "4.5.20" diff --git a/lambdas/src/bna-fargate-run.rs b/lambdas/src/bna-fargate-run.rs index ab762de..93d8454 100644 --- a/lambdas/src/bna-fargate-run.rs +++ b/lambdas/src/bna-fargate-run.rs @@ -53,7 +53,7 @@ async fn function_handler(event: LambdaEvent) -> Result) -> Result<(), Error> { .end_time(end_time) .results_posted(true) .start_time(start_time) - .status(AnalysisStatus::Complete) + .status(AnalysisStatus::Completed) .step(Step::Cleanup), ) .send() @@ -738,6 +738,31 @@ mod tests { // dbg!(r); // } + // #[test(tokio::test)] + // async fn test_update_pipeline() { + // let client = bnaclient::Client::new("http://localhost:3000"); + // let analysis_patch_builder = AnalysisPatch::builder() + // .start_time(Utc::now()) + // .cost(Decimal::new(10345, 3).to_f64().expect("no overflow")) + // .step(Step::Setup) + // .results_posted(true) + // .status(AnalysisStatus::Completed); + // let analysis_patch: AnalysisPatch = analysis_patch_builder.try_into().unwrap(); + // println!("{}", serde_json::to_string(&analysis_patch).unwrap()); + // let r = client + // .patch_analysis() + // .analysis_id(StateMachineId( + // "c86473dd-53b5-4abd-be0d-c25ed6b5f029" + // .parse::() + // .unwrap(), + // )) + // .body(analysis_patch) + // .send() + // .await + // .unwrap(); + // dbg!(r); + // } + // #[test(tokio::test)] // async fn test_fargate_details() { // let config = aws_config::load_defaults(BehaviorVersion::latest()).await;