From 7c9c1228d5a7236c6391ecefc4a09c1a435e58fa Mon Sep 17 00:00:00 2001 From: anabellabuckvar <41971124+anabellabuckvar@users.noreply.github.com> Date: Thu, 18 Apr 2024 14:51:52 -0400 Subject: [PATCH 1/6] DOP-4481-hotfix adding extra check --- src/services/slack.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/services/slack.ts b/src/services/slack.ts index 20803d268..ed7f553c6 100644 --- a/src/services/slack.ts +++ b/src/services/slack.ts @@ -66,8 +66,12 @@ export class SlackConnector implements ISlackConnector { block_deploy_option: 'deploy_option', }; + console.log(stateValues); // if deploy all was selected: - if (stateValues['block_deploy_option']['deploy_option']?.selected_option?.value == 'deploy_all') { + if ( + stateValues['block_deploy_option'] && + stateValues['block_deploy_option']['deploy_option']?.selected_option?.value == 'deploy_all' + ) { if (!isAdmin) { throw new Error('User is not an admin and therefore not entitled to deploy all repos'); } From 8a37d903ff5b47b4274980de2bea3012cec0da2e Mon Sep 17 00:00:00 2001 From: anabellabuckvar <41971124+anabellabuckvar@users.noreply.github.com> Date: Thu, 18 Apr 2024 14:54:05 -0400 Subject: [PATCH 2/6] DOP-4481-hotfix push to preprd --- .github/workflows/deploy-stg-ecs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy-stg-ecs.yml b/.github/workflows/deploy-stg-ecs.yml index 2e0cfb462..9dcb643bf 100644 --- a/.github/workflows/deploy-stg-ecs.yml +++ b/.github/workflows/deploy-stg-ecs.yml @@ -3,6 +3,7 @@ on: branches: - "main" - "integration" + - "DOP-4481-hotfix" concurrency: group: environment-stg-${{ github.ref }} cancel-in-progress: true From 197ae54e07cb4799bfa31c3ee70e2d04f6c22acc Mon Sep 17 00:00:00 2001 From: anabellabuckvar <41971124+anabellabuckvar@users.noreply.github.com> Date: Thu, 18 Apr 2024 15:19:02 -0400 Subject: [PATCH 3/6] DOP-4481-hotfix fix conditional --- src/services/slack.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/slack.ts b/src/services/slack.ts index ed7f553c6..571a627d0 100644 --- a/src/services/slack.ts +++ b/src/services/slack.ts @@ -69,8 +69,8 @@ export class SlackConnector implements ISlackConnector { console.log(stateValues); // if deploy all was selected: if ( - stateValues['block_deploy_option'] && - stateValues['block_deploy_option']['deploy_option']?.selected_option?.value == 'deploy_all' + stateValues['block_deploy_option']?.deploy_option && + stateValues['block_deploy_option']?.deploy_option?.selected_option?.value == 'deploy_all' ) { if (!isAdmin) { throw new Error('User is not an admin and therefore not entitled to deploy all repos'); From db6428d98920200f62b2fe0275135908edbf397a Mon Sep 17 00:00:00 2001 From: anabellabuckvar <41971124+anabellabuckvar@users.noreply.github.com> Date: Thu, 18 Apr 2024 15:41:31 -0400 Subject: [PATCH 4/6] DOP-4481-hotfix fix conditional --- src/services/slack.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/slack.ts b/src/services/slack.ts index 571a627d0..c2b022893 100644 --- a/src/services/slack.ts +++ b/src/services/slack.ts @@ -69,7 +69,7 @@ export class SlackConnector implements ISlackConnector { console.log(stateValues); // if deploy all was selected: if ( - stateValues['block_deploy_option']?.deploy_option && + stateValues['block_deploy_option'] && stateValues['block_deploy_option']?.deploy_option?.selected_option?.value == 'deploy_all' ) { if (!isAdmin) { From f629f3a7c9968717e21dc801fdd3541439d8e542 Mon Sep 17 00:00:00 2001 From: anabellabuckvar <41971124+anabellabuckvar@users.noreply.github.com> Date: Thu, 18 Apr 2024 16:04:26 -0400 Subject: [PATCH 5/6] DOP-4481-hotfix fix conditional --- src/services/slack.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/services/slack.ts b/src/services/slack.ts index c2b022893..ae4c44845 100644 --- a/src/services/slack.ts +++ b/src/services/slack.ts @@ -63,15 +63,11 @@ export class SlackConnector implements ISlackConnector { const inputMapping = { block_repo_option: 'repo_option', block_hash_option: 'hash_option', - block_deploy_option: 'deploy_option', }; console.log(stateValues); // if deploy all was selected: - if ( - stateValues['block_deploy_option'] && - stateValues['block_deploy_option']?.deploy_option?.selected_option?.value == 'deploy_all' - ) { + if (stateValues['block_deploy_option']?.deploy_option?.selected_option?.value == 'deploy_all') { if (!isAdmin) { throw new Error('User is not an admin and therefore not entitled to deploy all repos'); } From 623d905feec8dfbd1f57b21c6dd36d3346fa07d3 Mon Sep 17 00:00:00 2001 From: anabellabuckvar <41971124+anabellabuckvar@users.noreply.github.com> Date: Thu, 18 Apr 2024 16:31:06 -0400 Subject: [PATCH 6/6] DOP-4481-hotfix cleaning --- .github/workflows/deploy-stg-ecs.yml | 1 - src/services/slack.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/deploy-stg-ecs.yml b/.github/workflows/deploy-stg-ecs.yml index 9dcb643bf..2e0cfb462 100644 --- a/.github/workflows/deploy-stg-ecs.yml +++ b/.github/workflows/deploy-stg-ecs.yml @@ -3,7 +3,6 @@ on: branches: - "main" - "integration" - - "DOP-4481-hotfix" concurrency: group: environment-stg-${{ github.ref }} cancel-in-progress: true diff --git a/src/services/slack.ts b/src/services/slack.ts index ae4c44845..e5483ec98 100644 --- a/src/services/slack.ts +++ b/src/services/slack.ts @@ -65,7 +65,6 @@ export class SlackConnector implements ISlackConnector { block_hash_option: 'hash_option', }; - console.log(stateValues); // if deploy all was selected: if (stateValues['block_deploy_option']?.deploy_option?.selected_option?.value == 'deploy_all') { if (!isAdmin) {