Skip to content

Commit

Permalink
feat: allow periods (".") in alarm names (#593)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
royhowie and Roy Howie authored Nov 12, 2024
1 parent cf8640d commit 3ef0747
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/dashboard/MonitoringNamingStrategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion test/dashboard/MonitoringNamingStrategy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});

Expand Down

0 comments on commit 3ef0747

Please sign in to comment.