From 7150826b2a3f932e7b02d30f10b47b57fe7ef1b8 Mon Sep 17 00:00:00 2001 From: Joshua Feingold Date: Tue, 27 Jul 2021 09:16:00 -0500 Subject: [PATCH 1/2] @W-9625690@: Enabling PagerDuty alerts for heartbeat action. --- .github/workflows/production-heartbeat.yml | 46 +++++++++++----------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/.github/workflows/production-heartbeat.yml b/.github/workflows/production-heartbeat.yml index 3da27e7cd..123bcd388 100644 --- a/.github/workflows/production-heartbeat.yml +++ b/.github/workflows/production-heartbeat.yml @@ -43,28 +43,26 @@ jobs: name: smoke-test-results-${{ runner.os }} path: smoke-test-results -# This part is commented out for now, so we can run the script for a day or two without risking blowing up PagerDuty. -# Once we've seen that it works properly, we'll re-enable the alerts. # === Report any failures === -# - name: Report failures -# if: ${{ failure() }} -# shell: bash -# env: -# # A link to this run -# RUN_LINK: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} -# run: | -# curl --request POST \ -# --data '{"payload": { -# "summary": "Production heartbeat script failed on ${{ runner.os }}", -# "source": "Github Actions", -# "severity": "critical", -# "custom_details": "SFDX install: ${{ steps.sfdx_install.outcome }}. Scanner install: ${{ steps.scanner_install.outcome }}. Smoke tests: ${{ steps.smoke_tests.outcome }}" -# }, -# "links": [{ -# "href": "${{ env.RUN_LINK }}", -# "text": "Link to action execution" -# }], -# "event_action": "trigger", -# "routing_key": "${{ secrets.PAGERDUTY_HEARTBEAT_KEY }}" -# }' \ -# https://events.pagerduty.com/v2/enqueue + - name: Report failures + if: ${{ failure() }} + shell: bash + env: + # A link to this run + RUN_LINK: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} + run: | + curl --request POST \ + --data '{"payload": { + "summary": "Production heartbeat script failed on ${{ runner.os }}", + "source": "Github Actions", + "severity": "critical", + "custom_details": "SFDX install: ${{ steps.sfdx_install.outcome }}. Scanner install: ${{ steps.scanner_install.outcome }}. Smoke tests: ${{ steps.smoke_tests.outcome }}" + }, + "links": [{ + "href": "${{ env.RUN_LINK }}", + "text": "Link to action execution" + }], + "event_action": "trigger", + "routing_key": "${{ secrets.PAGERDUTY_HEARTBEAT_KEY }}" + }' \ + https://events.pagerduty.com/v2/enqueue From d66148cefdc12e99dfeb95fbada822dd4808dabf Mon Sep 17 00:00:00 2001 From: Joshua Feingold Date: Tue, 27 Jul 2021 11:12:04 -0500 Subject: [PATCH 2/2] DO NOT MERGE THIS UNDER ANY CIRCUMSTANCES. --- ...ction-heartbeat.yml => production-heartbeat-test.yml} | 9 +++++---- smoke-tests/smoke-test.sh | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) rename .github/workflows/{production-heartbeat.yml => production-heartbeat-test.yml} (95%) diff --git a/.github/workflows/production-heartbeat.yml b/.github/workflows/production-heartbeat-test.yml similarity index 95% rename from .github/workflows/production-heartbeat.yml rename to .github/workflows/production-heartbeat-test.yml index 123bcd388..40c0355dd 100644 --- a/.github/workflows/production-heartbeat.yml +++ b/.github/workflows/production-heartbeat-test.yml @@ -1,8 +1,9 @@ -name: production-heartbeat +name: production-heartbeat-test on: - schedule: - # Times are UTC - - cron: '45 1,5,9,13,17,21 * * *' + pull_request +# schedule: +# # Times are UTC +# - cron: '45 1,5,9,13,17,21 * * *' jobs: production-heartbeat: strategy: diff --git a/smoke-tests/smoke-test.sh b/smoke-tests/smoke-test.sh index dc5325d84..c52199b0b 100755 --- a/smoke-tests/smoke-test.sh +++ b/smoke-tests/smoke-test.sh @@ -17,7 +17,7 @@ $EXE_NAME scanner:rule:describe -n EmptyCatchBlock echo "==== Describe a non-existent rule ====" $EXE_NAME scanner:rule:describe -n NotAnActualRule echo "==== Run rules against force-app, which should hit PMD and ESLint engines ====" -$EXE_NAME scanner:run --format junit --target test/code-fixtures/projects/app/force-app --outfile smoke-test-results/run1.xml +$EXE_NAME scanner:run --format foo --target test/code-fixtures/projects/app/force-app --outfile smoke-test-results/run1.xml echo "==== Run rules against a typescript file, which should run ESLint-Typescript ====" $EXE_NAME scanner:run --format junit --target test/code-fixtures/projects/ts/src/simpleYetWrong.ts --tsconfig test/code-fixtures/projects/tsconfig.json --outfile smoke-test-results/run2.xml echo "==== Run RetireJS against a folder ===="