From a3624f80b9cd9400393577aefe7d91deec817a9d Mon Sep 17 00:00:00 2001 From: arpandhakal Date: Mon, 28 Jul 2025 15:48:33 +0545 Subject: [PATCH 1/2] feat(OUT-2004): postdeploy script for milestone 15 - created a postdeploy script consisting of 2 backfill scripts for milestone 15. - ran backfill user ids script in production database and deleted contraint violating data consisting of 2864 tasks, 653 internalUserNotifications and 1051 clientNotifications. - saved the deleted data in csv format in production storage. --- package.json | 3 ++- .../index.ts | 4 ++-- src/cmd/post-deploy-m15/index.ts | 13 +++++++++++++ 3 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 src/cmd/post-deploy-m15/index.ts diff --git a/package.json b/package.json index 267a4cd17..28107d63f 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,8 @@ "cmd:backfill-completed-tasks": "tsx ./src/cmd/backfill-completed-tasks", "cmd:backfill-new-user-ids": "tsx ./src/cmd/backfill-new-user-ids", "cmd:normalize-filterOptions-assignee": "tsx ./src/cmd/normalize-filterOptions-assignee", - "cmd:backfill-company-id-in-client-notifications": "tsx ./src/cmd/backfill-company-id-in-client-notifications" + "cmd:backfill-company-id-in-client-notifications": "tsx ./src/cmd/backfill-company-id-in-client-notifications", + "cmd:post-deploy-m15": "tsx ./src/cmd/post-deploy-m15" }, "dependencies": { "@cyntler/react-doc-viewer": "^1.17.0", diff --git a/src/cmd/backfill-company-id-in-client-notifications/index.ts b/src/cmd/backfill-company-id-in-client-notifications/index.ts index 88441e814..55dafa275 100644 --- a/src/cmd/backfill-company-id-in-client-notifications/index.ts +++ b/src/cmd/backfill-company-id-in-client-notifications/index.ts @@ -80,7 +80,7 @@ const updateClientNotifications = async ( return { failedClientNotifications } } -const run = async () => { +export const backfillCompanyIdInClientNotifications = async () => { console.info(`backfill-company-id#run | Using clients endpoint:`, COPILOT_CLIENTS_ENDPOINT) const db = DBClient.getInstance() @@ -112,4 +112,4 @@ const run = async () => { console.info(`Failed update on clientNotifications (${failedClientNotifications.length})`, failedClientNotifications) } -run() +backfillCompanyIdInClientNotifications() diff --git a/src/cmd/post-deploy-m15/index.ts b/src/cmd/post-deploy-m15/index.ts new file mode 100644 index 000000000..f014ad900 --- /dev/null +++ b/src/cmd/post-deploy-m15/index.ts @@ -0,0 +1,13 @@ +import { backfillCompanyIdInClientNotifications } from '../backfill-company-id-in-client-notifications' +import { normalizeStringAssigneeToObject } from '../normalize-filterOptions-assignee' + +const run = async () => { + console.info('⚒️ Running normalize-filter-options script') + await normalizeStringAssigneeToObject() + console.info('🔥 Completed : normalize-filter-options script') + console.info('⚒️ Running script to backfill companyId in ClientNotifications') + await backfillCompanyIdInClientNotifications() + console.info('🔥 Completed : backfill companyId in ClientNotifications') +} + +run() From f56ccc9330259a541f447239f54e6295cb211802 Mon Sep 17 00:00:00 2001 From: arpandhakal Date: Mon, 28 Jul 2025 15:52:24 +0545 Subject: [PATCH 2/2] feat(OUT-2004): comment added to remind trigger deploy post production --- src/cmd/post-deploy-m15/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cmd/post-deploy-m15/index.ts b/src/cmd/post-deploy-m15/index.ts index f014ad900..80a9242fb 100644 --- a/src/cmd/post-deploy-m15/index.ts +++ b/src/cmd/post-deploy-m15/index.ts @@ -8,6 +8,8 @@ const run = async () => { console.info('⚒️ Running script to backfill companyId in ClientNotifications') await backfillCompanyIdInClientNotifications() console.info('🔥 Completed : backfill companyId in ClientNotifications') + + //DO NOT FORGET to run trigger deploy action once milestone 15 has been promoted to production } run()