From f7a6c5ff893388dd8afbf6f9f1e67e7df196da6a Mon Sep 17 00:00:00 2001 From: Alex Nitu Date: Thu, 18 Jul 2024 17:08:55 +0100 Subject: [PATCH 1/2] chore: lock @types/lodash version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 67e09091..c2d924d5 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "@types/bunyan": "1.8.6", "@types/debug": "4.1.5", "@types/jest": "^29.5.12", - "@types/lodash": "^4.14.149", + "@types/lodash": "4.17.5", "@types/micromatch": "4.0.6", "@types/needle": "2.0.4", "@types/node": "^20.11.1", From a07d92719419ae240a09f5d1fddf757eae36c9b6 Mon Sep 17 00:00:00 2001 From: Alex Nitu Date: Thu, 18 Jul 2024 17:15:35 +0100 Subject: [PATCH 2/2] chore: add slack notification on pipeline fail --- .circleci/config.yml | 65 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 63 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 68bf1187..3bca73e6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,7 @@ version: 2.1 orbs: prodsec: snyk/prodsec-orb@1.1 + slack: circleci/slack@4.13.3 features_only: &features_only filters: @@ -17,6 +18,61 @@ defaults: &defaults docker: - image: cimg/node:20.11.1 +commands: + notify_slack_on_failure: + steps: + - slack/notify: + branch_pattern: main + channel: import-alerts + event: fail + mentions: '@team-import' + custom: | + { + "blocks": [ + { + "type": "header", + "text": { + "type": "plain_text", + "text": "CICD pipeline failed :circleci-fail:", + "emoji": true + } + }, + { + "type": "divider" + }, + { + "type": "section", + "fields": [ + { + "type": "mrkdwn", + "text": "*Project*: ${CIRCLE_PROJECT_REPONAME}" + }, + { + "type": "mrkdwn", + "text": "*Job*: ${CIRCLE_JOB}" + }, + { + "type": "mrkdwn", + "text": "*Branch*: ${CIRCLE_BRANCH}" + }, + { + "type": "mrkdwn", + "text": "*Author*: ${CIRCLE_USERNAME}" + } + ], + "accessory": { + "type": "button", + "text": { + "type": "plain_text", + "emoji": true, + "text": "View Job" + }, + "value": "${CIRCLE_BUILD_URL}" + } + } + ] + } + jobs: security-scans: <<: *defaults @@ -36,6 +92,7 @@ jobs: - run: npm install - run: npm test - run: npx semantic-release + - notify_slack_on_failure build-test: <<: *defaults @@ -74,12 +131,16 @@ workflows: <<: *main_only jobs: - build-test-monitor: - context: snyk-api-import + context: + - snyk-api-import + - snyk-bot-slack build-test-monitor: jobs: - build-test-monitor: - context: snyk-api-import + context: + - snyk-api-import + - snyk-bot-slack <<: *main_only build-test: