From 6f272f76cc6acb139ba164d8a65fdce8666bae57 Mon Sep 17 00:00:00 2001 From: Mitch Dawson Date: Tue, 22 Oct 2024 14:47:13 +0100 Subject: [PATCH] report an issue workflow changes and test fix --- .github/workflows/deploy-dev-from-branch.yml | 1 + .github/workflows/deploy-staged.yml | 3 +++ .github/workflows/reusable-push-and-deploy.yml | 9 +++++++++ deployments/templates/deployment.yml | 12 ++++++++++++ tests/home/service/test_details.py | 2 +- 5 files changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-dev-from-branch.yml b/.github/workflows/deploy-dev-from-branch.yml index 11960b69..2208d248 100644 --- a/.github/workflows/deploy-dev-from-branch.yml +++ b/.github/workflows/deploy-dev-from-branch.yml @@ -38,3 +38,4 @@ jobs: catalogue_token: ${{ secrets.CATALOGUE_TOKEN }} slack_alert_webhook: ${{ secrets.SLACK_ALERT_WEBHOOK }} azure_client_secret: ${{ secrets.AZURE_CLIENT_SECRET }} + notify_api_key: ${{ secrets.NOTIFY_API_KEY }} diff --git a/.github/workflows/deploy-staged.yml b/.github/workflows/deploy-staged.yml index 85d5cb4a..7509cc0e 100644 --- a/.github/workflows/deploy-staged.yml +++ b/.github/workflows/deploy-staged.yml @@ -29,6 +29,7 @@ jobs: catalogue_token: ${{ secrets.CATALOGUE_TOKEN }} slack_alert_webhook: ${{ secrets.SLACK_ALERT_WEBHOOK }} azure_client_secret: ${{ secrets.AZURE_CLIENT_SECRET }} + notify_api_key: ${{ secrets.NOTIFY_API_KEY }} deploy-preprod: uses: "./.github/workflows/reusable-push-and-deploy.yml" @@ -45,6 +46,7 @@ jobs: catalogue_token: ${{ secrets.CATALOGUE_TOKEN }} slack_alert_webhook: ${{ secrets.SLACK_ALERT_WEBHOOK }} azure_client_secret: ${{ secrets.AZURE_CLIENT_SECRET }} + notify_api_key: ${{ secrets.NOTIFY_API_KEY }} notify-preprod-success: needs: deploy-preprod @@ -85,6 +87,7 @@ jobs: catalogue_token: ${{ secrets.CATALOGUE_TOKEN }} slack_alert_webhook: ${{ secrets.SLACK_ALERT_WEBHOOK }} azure_client_secret: ${{ secrets.AZURE_CLIENT_SECRET }} + notify_api_key: ${{ secrets.NOTIFY_API_KEY }} post-deploy: name: "Post-deploy admin" diff --git a/.github/workflows/reusable-push-and-deploy.yml b/.github/workflows/reusable-push-and-deploy.yml index da409f90..68d77247 100644 --- a/.github/workflows/reusable-push-and-deploy.yml +++ b/.github/workflows/reusable-push-and-deploy.yml @@ -35,6 +35,9 @@ on: azure_client_secret: description: "azure client secret" required: true + notify_api_key: + description: "api key for the gds notify service" + required: true jobs: push-and-deploy: @@ -119,6 +122,12 @@ jobs: AZURE_REDIRECT_URI: ${{ vars.AZURE_REDIRECT_URI }} AZURE_AUTHORITY: ${{ vars.AZURE_AUTHORITY }} EXTERNAL_DOMAIN_PREFIX: ${{ vars.EXTERNAL_DOMAIN_PREFIX }} + NOTIFY_ENABLED: ${{ vars.NOTIFY_ENABLED }} + NOTIFY_API_KEY: ${{ secrets.NOTIFY_API_KEY }} + NOTIFY_DATA_OWNER_TEMPLATE_ID: ${{ vars. NOTIFY_DATA_OWNER_TEMPLATE_ID }} + NOTIFY_SENDER_TEMPLATE_ID: ${{ vars.NOTIFY_SENDER_TEMPLATE_ID }} + NOTIFY_DATA_CATALOGUE_TEMPLATE_ID: ${{ vars.NOTIFY_DATA_CATALOGUE_TEMPLATE_ID }} + DATA_CATALOGUE_EMAIL: ${{ vars.DATA_CATALOGUE_EMAIL }} run: | cat deployments/templates/deployment.yml | envsubst > deployments/deployment.yml diff --git a/deployments/templates/deployment.yml b/deployments/templates/deployment.yml index 03a05a98..6a10e778 100644 --- a/deployments/templates/deployment.yml +++ b/deployments/templates/deployment.yml @@ -69,6 +69,18 @@ spec: value: "${TRACES_SAMPLE_RATE}" - name: PROFILES_SAMPLE_RATE value: "${PROFILES_SAMPLE_RATE}" + - name: "${NOTIFY_ENABLED}" + value: NOTIFY_ENABLED + - name: "${NOTIFY_API_KEY}" + value: NOTIFY_API_KEY + - name: "${NOTIFY_DATA_OWNER_TEMPLATE_ID}" + value: NOTIFY_DATA_OWNER_TEMPLATE_ID + - name: "${NOTIFY_SENDER_TEMPLATE_ID}" + value: NOTIFY_SENDER_TEMPLATE_ID + - name: "${NOTIFY_DATA_CATALOGUE_TEMPLATE_ID}" + value: NOTIFY_DATA_CATALOGUE_TEMPLATE_ID + - name: "${DATA_CATALOGUE_EMAIL}" + value: DATA_CATALOGUE_EMAIL - name: SECRET_KEY valueFrom: secretKeyRef: diff --git a/tests/home/service/test_details.py b/tests/home/service/test_details.py index 1334f279..267abcfd 100644 --- a/tests/home/service/test_details.py +++ b/tests/home/service/test_details.py @@ -214,7 +214,7 @@ def test_get_context(self, mock_catalogue): expected = { "entity": chart_metadata, "entity_type": "Chart", - "platform_name": "Justice Data", + "platform_name": "justice-data", "parent_entity": None, "parent_type": "dashboard", "h1_value": "test",