From 2e85fe24b17bf8f1342d8dac586e657e9e281fee Mon Sep 17 00:00:00 2001 From: novica Date: Sat, 17 Oct 2026 15:37:23 +0200 Subject: [PATCH 1/2] fix: send EventBridge target ID as a string EventBridge defines Target Id as a string. Assisted-by: Claude Opus 5.5 --- R/lambda-util.R | 2 +- tests/testthat/test-aws-lookups.R | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/R/lambda-util.R b/R/lambda-util.R index cf7dde0..6470e97 100644 --- a/R/lambda-util.R +++ b/R/lambda-util.R @@ -699,7 +699,7 @@ add_lambda_to_eventridge <- aws_event <- aws_connect("eventbridge") aws_event$put_targets( Rule = rule_name, - Targets = list(list(Id = 1, Arn = lambda_function_arn)) + Targets = list(list(Id = "1", Arn = lambda_function_arn)) ) logger::log_debug("[add_lambda_to_eventridge] Done.") } diff --git a/tests/testthat/test-aws-lookups.R b/tests/testthat/test-aws-lookups.R index aed6dbd..4473167 100644 --- a/tests/testthat/test-aws-lookups.R +++ b/tests/testthat/test-aws-lookups.R @@ -84,6 +84,17 @@ test_that("schedule_lambda builds valid rule and statement names", { expect_match(statement, "^[A-Za-z0-9_-]+$") }) +test_that("add_lambda_to_eventridge sends the target ID as a string", { + targets <- NULL + local_mocked_bindings( + aws_connect = function(service) { + list(put_targets = function(Rule, Targets) targets <<- Targets) + } + ) + add_lambda_to_eventridge("a_rule", "arn:fn") + expect_type(targets[[1]]$Id, "character") +}) + test_that("test_lambda finds the image by tag and removes the container", { calls <- list() local_mocked_bindings( From 96d5db88a035ea4503980edbcaa940909b4bc74a Mon Sep 17 00:00:00 2001 From: novica Date: Sat, 17 Oct 2026 15:41:21 +0200 Subject: [PATCH 2/2] style: avoid implicit assignment in EventBridge test mock Assisted-by: Claude Opus 5.5 --- tests/testthat/test-aws-lookups.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/testthat/test-aws-lookups.R b/tests/testthat/test-aws-lookups.R index 4473167..3c2b745 100644 --- a/tests/testthat/test-aws-lookups.R +++ b/tests/testthat/test-aws-lookups.R @@ -88,7 +88,9 @@ test_that("add_lambda_to_eventridge sends the target ID as a string", { targets <- NULL local_mocked_bindings( aws_connect = function(service) { - list(put_targets = function(Rule, Targets) targets <<- Targets) + list(put_targets = function(Rule, Targets) { + targets <<- Targets + }) } ) add_lambda_to_eventridge("a_rule", "arn:fn")