From f6556f03d63090f2090e2bfe803f915f0fa4f642 Mon Sep 17 00:00:00 2001 From: Malcolm Baig Date: Wed, 21 Feb 2024 15:21:51 +0000 Subject: [PATCH] Update webhook env var in SlackClient This env var hasn't been set for the production app since the AKS migration, and is needed by SlackClient for reporting performance alerts and Zendesk health to Slack. Secrets for this service are now split into infra and app lists. The infra list contains a Slack webhook URL that is used when database backups fail. We need that same URL in the app list. In addition to adding SLACK_WEBHOOK to the app secrets via the Azure Portal, this PR simply aligns the name of the env var between the two places in the codebase it is currently used. --- .env.test | 2 +- app/services/slack_client.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.env.test b/.env.test index eb92b7582..2495522d8 100644 --- a/.env.test +++ b/.env.test @@ -9,6 +9,6 @@ IDENTITY_API_URL=https://preprod.teaching-identity.education.gov.uk/ IDENTITY_SHARED_SECRET_KEY=testkey IDENTITY_USER_TOKEN=testkey REDIS_URL=redis://localhost:6379/1 -SLACK_WEBHOOK_URL=test +SLACK_WEBHOOK=test SUPPORT_PASSWORD=test SUPPORT_USERNAME=test diff --git a/app/services/slack_client.rb b/app/services/slack_client.rb index 9ca599e7a..d5eff9a8c 100644 --- a/app/services/slack_client.rb +++ b/app/services/slack_client.rb @@ -17,7 +17,7 @@ def create_message(message) private def client - Faraday.new(url: ENV.fetch("SLACK_WEBHOOK_URL")) do |faraday| + Faraday.new(url: ENV.fetch("SLACK_WEBHOOK")) do |faraday| faraday.request :json faraday.response :json faraday.response :logger, nil, { bodies: true, headers: true }