From 3ef07474548f33e453e9218c15003a6a55b3878a Mon Sep 17 00:00:00 2001 From: Roy Howie Date: Tue, 12 Nov 2024 06:55:42 -0800 Subject: [PATCH] feat: allow periods (".") in alarm names (#593) FIFO queues require a suffix of ".fifo" and thus do not work without alarm name overrides. This is tedious. --- _By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license_ Co-authored-by: Roy Howie --- lib/dashboard/MonitoringNamingStrategy.ts | 2 +- test/dashboard/MonitoringNamingStrategy.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dashboard/MonitoringNamingStrategy.ts b/lib/dashboard/MonitoringNamingStrategy.ts index 9362b10f..33a85bf2 100644 --- a/lib/dashboard/MonitoringNamingStrategy.ts +++ b/lib/dashboard/MonitoringNamingStrategy.ts @@ -62,7 +62,7 @@ export class MonitoringNamingStrategy { static isAlarmFriendly(str: string) { // we do not know the exact pattern yet, but this is a safe approximation // also, tokens are not allowed in alarm names - return str && !Token.isUnresolved(str) && /^[a-zA-Z0-9\-_]+$/.test(str); + return str && !Token.isUnresolved(str) && /^[a-zA-Z0-9\-_\.]+$/.test(str); } private getFallbackAlarmFriendlyName() { diff --git a/test/dashboard/MonitoringNamingStrategy.test.ts b/test/dashboard/MonitoringNamingStrategy.test.ts index 1df98e35..fdba408e 100644 --- a/test/dashboard/MonitoringNamingStrategy.test.ts +++ b/test/dashboard/MonitoringNamingStrategy.test.ts @@ -21,7 +21,7 @@ test("string with comma is not alarm friendly", () => { test("this string is alarm friendly", () => { expect( - MonitoringNamingStrategy.isAlarmFriendly("This_is__Valid-Alarm-Name"), + MonitoringNamingStrategy.isAlarmFriendly("This_is__Valid-Alarm.Name"), ).toBeTruthy(); });