fix(cloudwatch): return empty CompositeAlarms and LogAlarms from DescribeAlarms (#6363)

* fix(cloudwatch): return empty CompositeAlarms and LogAlarms from DescribeAlarms

AWS sends every alarm collection even when it is empty. Floci only sent
MetricAlarms, so the AWS CLI's text output printed a leading None line
for each missing paginator result key.

Closes #6362

* test(cloudwatch): check empty alarm collections in sdk-test-python instead of bats

Drop the new AWS CLI bats file and assert the empty CompositeAlarms and
LogAlarms lists in the existing describe_alarms test, as boto3 leaves an
absent list out of the response.
This commit is contained in:
Stuart Lang authored and GitHub committed 2026-10-23 19:06:44 -04:00
1 parent 8f76b2f0fc
commit 42f5019231
5 files changed
+33

No files matched your search

@@ -264,6 +264,8 @@ public class CloudWatchMetricsJsonHandler {
if (a.getStateReasonData() != null) node.put("StateReasonData", a.getStateReasonData());
node.put("StateUpdatedTimestamp", a.getStateUpdatedTimestamp());
}
response.putArray("CompositeAlarms");
response.putArray("LogAlarms");
return Response.ok(response).build();
}
@@ -260,6 +260,8 @@ public class CloudWatchMetricsQueryHandler {
toAlarmXml(xml, a);
}
xml.end("MetricAlarms");
xml.start("CompositeAlarms").end("CompositeAlarms");
xml.start("LogAlarms").end("LogAlarms");
return Response.ok(AwsQueryResponse.envelope("DescribeAlarms", null, xml.build())).build();
}