Skip to content

Commit

Permalink
Update BNA REST API Client (#27)
Browse files Browse the repository at this point in the history
Updates the BNS REST API client to the current version.

Signed-off-by: Rémy Greinhofer <[email protected]>
  • Loading branch information
rgreinho authored Dec 9, 2024
1 parent c9b523d commit 18e9b13
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion lambdas/src/bna-fargate-run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async fn function_handler(event: LambdaEvent<TaskInput>) -> Result<TaskOutput, E
AnalysisPost::builder()
.state_machine_id(StateMachineId(state_machine_id))
.start_time(Utc::now())
.status(AnalysisStatus::InProgress)
.status(AnalysisStatus::Processing)
.step(Step::Setup)
.sqs_message(serde_json::to_string(analysis_parameters)?)
.s3_bucket(aws_s3.destination.clone()),
Expand Down
27 changes: 26 additions & 1 deletion lambdas/src/bna-save-results.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ async fn function_handler(event: LambdaEvent<TaskInput>) -> Result<(), Error> {
.end_time(end_time)
.results_posted(true)
.start_time(start_time)
.status(AnalysisStatus::Complete)
.status(AnalysisStatus::Completed)
.step(Step::Cleanup),
)
.send()
Expand Down Expand Up @@ -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::<Uuid>()
// .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;
Expand Down

0 comments on commit 18e9b13

Please sign in to comment.