From c99cf15c370f84764d9cee6212ceade143a82ed8 Mon Sep 17 00:00:00 2001 From: "harshitha.d" Date: Mon, 12 May 2025 19:25:59 +0530 Subject: [PATCH 1/3] fix: include region in Slack message header --- sanity-report.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sanity-report.js b/sanity-report.js index 9a664f4d..b5f52823 100644 --- a/sanity-report.js +++ b/sanity-report.js @@ -39,8 +39,16 @@ console.log('Total Skip:', summary.skippedTests); console.log('Total Pending:', summary.pendingTests); console.log('Total Duration:', summary.duration); +const host = process.env.HOST || '' +let region = 'UNKNOWN REGION' + +const match = host.match(/^([^-]+(?:-[^-]+)*)-api/) +if (match && match[1]) { + region = match[1].toUpperCase() +} + const slackMessage = ` -*Test Summary of JS Delivery SDK* +*JavaScript CMA Report - ${region}* • Total Test Suits: *${summary.totalSuites}* • Total Tests: *${summary.totalTests}* • Total Pass:: *${summary.passedTests}* From 880266c1b1bdd42f8a4643664f653752a2e2d3cb Mon Sep 17 00:00:00 2001 From: "harshitha.d" Date: Mon, 12 May 2025 19:43:38 +0530 Subject: [PATCH 2/3] fix: update regex to match CDN in host for region detection --- sanity-report.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sanity-report.js b/sanity-report.js index b5f52823..3c625d44 100644 --- a/sanity-report.js +++ b/sanity-report.js @@ -42,7 +42,7 @@ console.log('Total Duration:', summary.duration); const host = process.env.HOST || '' let region = 'UNKNOWN REGION' -const match = host.match(/^([^-]+(?:-[^-]+)*)-api/) +const match = host.match(/^([^-]+(?:-[^-]+)*)-cdn/) if (match && match[1]) { region = match[1].toUpperCase() } From 0c6409bafd648b6f9fef2ecdd7a26c9e41f19290 Mon Sep 17 00:00:00 2001 From: "harshitha.d" Date: Tue, 13 May 2025 17:41:25 +0530 Subject: [PATCH 3/3] Slack msg: set default region to AWS-NA in sanity report --- sanity-report.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sanity-report.js b/sanity-report.js index 3c625d44..08eba35a 100644 --- a/sanity-report.js +++ b/sanity-report.js @@ -40,7 +40,7 @@ console.log('Total Pending:', summary.pendingTests); console.log('Total Duration:', summary.duration); const host = process.env.HOST || '' -let region = 'UNKNOWN REGION' +let region = 'AWS-NA' const match = host.match(/^([^-]+(?:-[^-]+)*)-cdn/) if (match && match[1]) {