Skip to content

Commit b137835

Browse files
authored
Merge branch 'main' into DTOSS-11646-Setup-Container-Apps-container-probes
2 parents bbc17cf + 0aa198e commit b137835

File tree

79 files changed

+2253
-1486
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+2253
-1486
lines changed

.github/workflows/cicd-2-main-branch.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,67 @@ jobs:
9292
environments: '["review","dev","preprod","prod"]'
9393
commit_sha: ${{ github.sha }}
9494
secrets: inherit
95+
96+
notify-failure:
97+
name: 'Notify failure'
98+
runs-on: ubuntu-latest
99+
if: ${{ failure() }}
100+
needs: [commit-stage, test-stage, build-stage, deploy-stage]
101+
steps:
102+
- name: Determine failed stages
103+
id: failed_stages
104+
run: |
105+
failed_stages=""
106+
107+
if [[ "${{ needs.commit-stage.result }}" == "failure" ]]; then
108+
failed_stages="${failed_stages}• Commit stage\n"
109+
fi
110+
if [[ "${{ needs.test-stage.result }}" == "failure" ]]; then
111+
failed_stages="${failed_stages}• Test stage\n"
112+
fi
113+
if [[ "${{ needs.build-stage.result }}" == "failure" ]]; then
114+
failed_stages="${failed_stages}• Build stage\n"
115+
fi
116+
if [[ "${{ needs.deploy-stage.result }}" == "failure" ]]; then
117+
failed_stages="${failed_stages}• Deploy stage (check workflow for environment)\n"
118+
fi
119+
120+
# Format for Slack (remove trailing newline)
121+
failed_stages=$(echo -e "$failed_stages" | sed -e :a -e '/^\n*$/{$d;N;ba' -e '}')
122+
123+
# Use delimiter for multiline output
124+
echo "stages<<EOF" >> $GITHUB_OUTPUT
125+
echo "$failed_stages" >> $GITHUB_OUTPUT
126+
echo "EOF" >> $GITHUB_OUTPUT
127+
128+
- name: Notify Slack
129+
uses: slackapi/slack-github-action@v2.1.1
130+
with:
131+
webhook: ${{ secrets.SLACK_WEBHOOK_DEV_NOTIFICATIONS_URL }}
132+
webhook-type: incoming-webhook
133+
payload: |
134+
blocks:
135+
- type: section
136+
text:
137+
type: mrkdwn
138+
text: ":warning: Main branch CI/CD workflow failed:"
139+
- type: section
140+
fields:
141+
- type: mrkdwn
142+
text: |-
143+
*Workflow:*
144+
<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.workflow }}>
145+
- type: mrkdwn
146+
text: |-
147+
*Commit:*
148+
<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>
149+
- type: mrkdwn
150+
text: |-
151+
*Repo:*
152+
${{ github.repository }}
153+
- type: section
154+
text:
155+
type: mrkdwn
156+
text: |-
157+
*Failed Stages:*
158+
${{ steps.failed_stages.outputs.stages }}

docs/infrastructure/create-environment.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ The environment requires a shared Azure front door profile created in the hub. T
2929

3030
## Bicep
3131

32+
> [!IMPORTANT]
33+
> **Required permissions**: Owner role on both the hub and resource subscriptions
34+
3235
- From AVD:
3336
- Login with Microsoft Graph scope: `az login --scope https://graph.microsoft.com//.default -t HSCIC365.onmicrosoft.com`
3437
- Run bicep: `make [environment] resource-group-init`

infrastructure/environments/dev/variables.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ENV_CONFIG=dev
22
ENVIRONMENT=dev
3-
AZURE_SUBSCRIPTION="Digital Screening DToS - Core Services Dev"
3+
AZURE_SUBSCRIPTION="Breast Screening - Manage Breast Screening - Dev"
44
HUB_SUBSCRIPTION="Digital Screening DToS - DevOps"
55
HUB=dev
66
TERRAFORM_MODULES_REF=main

infrastructure/environments/preprod/variables.tfvars

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ nhs_notify_api_message_batch_url = "https://int.api.service.nhs.uk/comms/v1
1212
seed_demo_data = false
1313
allowed_paths = ["/notifications/message-status/create"]
1414
enable_alerting = true
15+
enable_notifications_jobs_schedule = true

infrastructure/environments/prod/variables.tfvars

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ allowed_paths = ["/notifications/message-status/create"]
1313
enable_alerting = true
1414
use_apex_domain = true
1515
cae_zone_redundancy_enabled = true
16+
enable_notifications_jobs_schedule = true

infrastructure/environments/review/variables.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
ENV_CONFIG=review
2+
AZURE_SUBSCRIPTION="Breast Screening - Manage Breast Screening - Dev"
23
HUB_SUBSCRIPTION="Digital Screening DToS - DevOps"
34
AZURE_SUBSCRIPTION="Digital Screening DToS - Core Services Dev"
45
HUB=dev

infrastructure/modules/container-apps/jobs.tf

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
locals {
22
scheduled_jobs = {
33
store_mesh_messages = {
4-
cron_expression = "0 6-20 * * *"
4+
cron_expression = "0 6 * * *"
55
environment_variables = {
66
BLOB_CONTAINER_NAME = "notifications-mesh-data"
77
}
88
job_short_name = "smm"
99
job_container_args = "store_mesh_messages"
1010
}
1111
create_appointments = {
12-
cron_expression = "30 6-20 * * *"
12+
cron_expression = "0 7 * * *"
1313
environment_variables = {
1414
BLOB_CONTAINER_NAME = "notifications-mesh-data"
1515
}
@@ -28,17 +28,6 @@ locals {
2828
job_short_name = "smb"
2929
job_container_args = "send_message_batch"
3030
}
31-
retry_failed_message_batch = {
32-
# cron_expression = "0,30 9-12 * * 1-5"
33-
cron_expression = null
34-
environment_variables = {
35-
API_OAUTH_TOKEN_URL = var.api_oauth_token_url
36-
NHS_NOTIFY_API_MESSAGE_BATCH_URL = var.nhs_notify_api_message_batch_url
37-
RETRY_QUEUE_NAME = "notifications-message-batch-retries"
38-
}
39-
job_short_name = "rmb"
40-
job_container_args = "retry_failed_message_batch"
41-
}
4231
save_message_status = {
4332
# cron_expression = "0,30 * * * *"
4433
cron_expression = null
@@ -69,7 +58,6 @@ locals {
6958
collect_metrics = {
7059
cron_expression = "*/5 * * * *"
7160
environment_variables = {
72-
RETRY_QUEUE_NAME = "notifications-message-batch-retries"
7361
STATUS_UPDATES_QUEUE_NAME = "notifications-message-status-updates"
7462
ENVIRONMENT = var.environment
7563
}

manage_breast_screening/config/.env.tpl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ BASIC_AUTH_PASSWORD=changeme
3131
# Notifications specific env vars
3232
NOTIFICATIONS_BATCH_RETRY_LIMIT=5
3333

34-
NOTIFICATIONS_SMTP_USERNAME=example@nhs.net
35-
NOTIFICATIONS_SMTP_PASSWORD=changeme
36-
NOTIFICATIONS_SMTP_RECIPIENTS=example@nhs.net,example@mail.com
37-
NOTIFICATIONS_SMTP_IS_ENABLED=False
38-
3934
API_OAUTH_API_KEY=""
4035
API_OAUTH_API_KID=""
4136
API_OAUTH_PRIVATE_KEY=""

manage_breast_screening/core/jinja2/layout-confirmation.jinja

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{% extends "layout-app.jinja" %}
22
{% from 'nhsuk/components/button/macro.jinja' import button %}
3+
{% from 'nhsuk/components/inset-text/macro.jinja' import insetText %}
4+
35

46
{% block header %}
57
{{ header({
@@ -21,6 +23,13 @@
2123
</h1>
2224

2325
{% block details %}
26+
{% set insetTextHtml %}
27+
<p>This action is final and cannot be undone.</p>
28+
{% endset %}
29+
30+
{{ insetText({
31+
"html": insetTextHtml
32+
}) }}
2433
{% endblock %}
2534

2635
<form method="post" action="{{ confirm_action.href | default(request.path) }}">

manage_breast_screening/core/views/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)