Skip to content

Commit 430ab5a

Browse files
committed
Merge branch 'dev' into EES-Master-conflictresolution
2 parents e1fe1b5 + e90b5d4 commit 430ab5a

File tree

201 files changed

+15634
-3013
lines changed

Some content is hidden

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

201 files changed

+15634
-3013
lines changed

.eslintrc.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@
154154
},
155155
"extends": ["plugin:@next/next/recommended"],
156156
"rules": {
157-
"@next/next/no-img-element": "off"
157+
"@next/next/no-img-element": "off",
158+
"@next/next/no-html-link-for-pages": ["error", ["src/pages", "src/explore-education-statistics-frontend/src/pages"]]
158159
}
159160
}
160161
]

.github/workflows/validate-snapshots.yml

+30-8
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,35 @@ jobs:
7878
- test
7979

8080
steps:
81-
- uses: actions/checkout@v4
81+
- name: Checkout
82+
uses: actions/checkout@v4
83+
with:
84+
token: ${{ env.GH_TOKEN }}
85+
8286
- name: Slack Notification
83-
uses: rtCamp/action-slack-notify@v2
87+
uses: slackapi/slack-github-action@v1.26.0
88+
with:
89+
payload: |
90+
{
91+
"text": "Workflow ${{ needs.test.result }}",
92+
"blocks": [
93+
{
94+
"type": "header",
95+
"text": {
96+
"type": "plain_text",
97+
"text": ":x: Workflow ${{ needs.test.result }}",
98+
"emoji": true
99+
}
100+
},
101+
{
102+
"type": "section",
103+
"text": {
104+
"type": "mrkdwn",
105+
"text": "*Workflow*: <https://github.com/dfe-analytical-services/explore-education-statistics/actions/workflows/validate-snapshots.yml|${{ github.workflow }}>\n*Details*: Notification from action run `${{ github.run_number }}`, which ran against commit `${{ github.sha }}` from branch `${{ github.ref_name }}` of the `${{ github.repository }}` repository."
106+
}
107+
}
108+
]
109+
}
84110
env:
85-
SLACK_USERNAME: Alertbot
86-
SLACK_ICON_EMOJI: ':x:'
87-
SLACK_COLOR: '#a30200'
88-
SLACK_TITLE: Workflow ${{ needs.test.result }}
89-
MSG_MINIMAL: actions url
90-
SLACK_WEBHOOK: ${{ env.SLACK_WEBHOOK_URL }}
111+
SLACK_WEBHOOK_URL: ${{ env.SLACK_WEBHOOK_URL }}
112+
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK

azure-pipelines-ui-tests.dfe.yml

+9-13
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
variables:
22
SPN_NAME: s101d-datahub-spn-ees-dfe-gov-uk
33
schedules:
4-
- cron: 0 5,7,19 * * 1,2,3,4,5
4+
- cron: 0 6 * * 1,2,3,4,5
55
branches:
66
include:
77
- dev
@@ -41,7 +41,7 @@ jobs:
4141
inputs:
4242
azureSubscription: $(SPN_NAME)
4343
KeyVaultName: s101d01-kv-ees-01
44-
SecretsFilter: ees-test-SLACK-BOT-TOKEN,ees-test-SLACK-TEST-REPORT-WEBHOOK-URL
44+
SecretsFilter: ees-alerts-slackapptoken
4545
RunAsPreJob: true
4646

4747
- task: PythonScript@0
@@ -51,8 +51,7 @@ jobs:
5151
arguments: --admin-pass "test" --analyst-pass "test" --expiredinvite-pass "test" --noinvite-pass "test" --pendinginvite-pass "test" --env "dev" --file "tests/general_public/" --processes 4 --rerun-attempts 3
5252
workingDirectory: tests/robot-tests
5353
env:
54-
SLACK_BOT_TOKEN: $(ees-test-SLACK-BOT-TOKEN)
55-
SLACK_TEST_REPORT_WEBHOOK_URL: $(ees-test-SLACK-TEST-REPORT-WEBHOOK-URL)
54+
SLACK_APP_TOKEN: $(ees-alerts-slackapptoken)
5655

5756
- task: PublishTestResults@2
5857
displayName: Publish Test Results
@@ -93,7 +92,7 @@ jobs:
9392
inputs:
9493
azureSubscription: $(SPN_NAME)
9594
KeyVaultName: s101d01-kv-ees-01
96-
SecretsFilter: ees-test-ADMIN-PASSWORD,ees-test-ANALYST-PASSWORD,ees-test-expiredinvite-password,ees-test-NOINVITE-PASSWORD,ees-test-PENDINGINVITE-PASSWORD,ees-test-SLACK-BOT-TOKEN,ees-test-SLACK-TEST-REPORT-WEBHOOK-URL
95+
SecretsFilter: ees-test-ADMIN-PASSWORD,ees-test-ANALYST-PASSWORD,ees-test-expiredinvite-password,ees-test-NOINVITE-PASSWORD,ees-test-PENDINGINVITE-PASSWORD,ees-alerts-slackapptoken
9796
RunAsPreJob: true
9897

9998
- task: PythonScript@0
@@ -105,8 +104,7 @@ jobs:
105104
# The magic incantation '"$(variable)"'was added by Mark to resolve an issue with Analyst password that contained ampersands.
106105
workingDirectory: tests/robot-tests
107106
env:
108-
SLACK_BOT_TOKEN: $(ees-test-SLACK-BOT-TOKEN)
109-
SLACK_TEST_REPORT_WEBHOOK_URL: $(ees-test-SLACK-TEST-REPORT-WEBHOOK-URL)
107+
SLACK_APP_TOKEN: $(ees-alerts-slackapptoken)
110108

111109
- task: PublishTestResults@2
112110
displayName: Publish Test Results
@@ -146,7 +144,7 @@ jobs:
146144
inputs:
147145
azureSubscription: $(SPN_NAME)
148146
KeyVaultName: s101d01-kv-ees-01
149-
SecretsFilter: ees-test-ADMIN-PASSWORD,ees-test-ANALYST-PASSWORD,ees-test-expiredinvite-password,ees-test-NOINVITE-PASSWORD,ees-test-PENDINGINVITE-PASSWORD,ees-test-SLACK-BOT-TOKEN,ees-test-SLACK-TEST-REPORT-WEBHOOK-URL
147+
SecretsFilter: ees-test-ADMIN-PASSWORD,ees-test-ANALYST-PASSWORD,ees-test-expiredinvite-password,ees-test-NOINVITE-PASSWORD,ees-test-PENDINGINVITE-PASSWORD,ees-alerts-slackapptoken
150148
RunAsPreJob: true
151149

152150
- task: PythonScript@0
@@ -157,8 +155,7 @@ jobs:
157155
arguments: --admin-pass '"$(ees-test-ADMIN-PASSWORD)"' --analyst-pass '"$(ees-test-ANALYST-PASSWORD)"' --expiredinvite-pass '"$(ees-test-expiredinvite-password)"' --noinvite-pass '"$(ees-test-NOINVITE-PASSWORD)"' --pendinginvite-pass '"$(ees-test-PENDINGINVITE-PASSWORD)"' --env "dev" --file "tests/admin" --processes 4 --rerun-attempts 3
158156
workingDirectory: tests/robot-tests
159157
env:
160-
SLACK_BOT_TOKEN: $(ees-test-SLACK-BOT-TOKEN)
161-
SLACK_TEST_REPORT_WEBHOOK_URL: $(ees-test-SLACK-TEST-REPORT-WEBHOOK-URL)
158+
SLACK_APP_TOKEN: $(ees-alerts-slackapptoken)
162159

163160
- task: PublishTestResults@2
164161
displayName: Publish Test Results
@@ -199,7 +196,7 @@ jobs:
199196
inputs:
200197
azureSubscription: $(SPN_NAME)
201198
KeyVaultName: s101d01-kv-ees-01
202-
SecretsFilter: ees-test-ADMIN-PASSWORD,ees-test-ANALYST-PASSWORD,ees-test-expiredinvite-password,ees-test-NOINVITE-PASSWORD,ees-test-PENDINGINVITE-PASSWORD,ees-test-SLACK-BOT-TOKEN,ees-test-SLACK-TEST-REPORT-WEBHOOK-URL
199+
SecretsFilter: ees-test-ADMIN-PASSWORD,ees-test-ANALYST-PASSWORD,ees-test-expiredinvite-password,ees-test-NOINVITE-PASSWORD,ees-test-PENDINGINVITE-PASSWORD,ees-alerts-slackapptoken
203200
RunAsPreJob: true
204201

205202
- task: PythonScript@0
@@ -209,8 +206,7 @@ jobs:
209206
arguments: --admin-pass '"$(ees-test-ADMIN-PASSWORD)"' --analyst-pass '"$(ees-test-ANALYST-PASSWORD)"' --expiredinvite-pass '"$(ees-test-expiredinvite-password)"' --noinvite-pass '"$(ees-test-NOINVITE-PASSWORD)"' --pendinginvite-pass '"$(ees-test-PENDINGINVITE-PASSWORD)"' --env "dev" --file "tests/admin_and_public" --processes 4 --rerun-attempts 3
210207
workingDirectory: tests/robot-tests
211208
env:
212-
SLACK_BOT_TOKEN: $(ees-test-SLACK-BOT-TOKEN)
213-
SLACK_TEST_REPORT_WEBHOOK_URL: $(ees-test-SLACK-TEST-REPORT-WEBHOOK-URL)
209+
SLACK_APP_TOKEN: $(ees-alerts-slackapptoken)
214210

215211
- task: PublishTestResults@2
216212
displayName: Publish Test Results

infrastructure/parameters/dev.parameters.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"value": "B1 Basic"
2525
},
2626
"slackAlertsChannel": {
27-
"value": "#alerts-dev"
27+
"value": "C067Z1K68UD"
2828
},
2929
"publishReleasesCronSchedule": {
3030
"value": "0 0 * * * *"
@@ -112,6 +112,9 @@
112112
},
113113
"immediatePublicationOfScheduledReleaseVersionsEnabled": {
114114
"value": true
115+
},
116+
"publicDataDbExists": {
117+
"value": false
115118
}
116119
}
117120
}

infrastructure/parameters/pre-prod.parameters.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"value": "S1 Standard"
2828
},
2929
"slackAlertsChannel": {
30-
"value": "#alerts-preprod"
30+
"value": "C0681S50SP5"
3131
},
3232
"useSubnets": {
3333
"value": true
@@ -88,6 +88,9 @@
8888
},
8989
"immediatePublicationOfScheduledReleaseVersionsEnabled": {
9090
"value": true
91+
},
92+
"publicDataDbExists": {
93+
"value": false
9194
}
9295
}
9396
}

infrastructure/parameters/prod.parameters.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"value": "S1 Standard"
2828
},
2929
"slackAlertsChannel": {
30-
"value": "#alerts"
30+
"value": "C01MCTX47E3"
3131
},
3232
"publicAppBasicAuth": {
3333
"value": "false"
@@ -91,6 +91,9 @@
9191
},
9292
"maxStatsDbSizeBytes": {
9393
"value": 1020054732800
94+
},
95+
"publicDataDbExists": {
96+
"value": false
9497
}
9598
}
9699
}

infrastructure/parameters/test.parameters.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"value": "B1 Basic"
2525
},
2626
"slackAlertsChannel": {
27-
"value": "#alerts-test"
27+
"value": "C0681S23291"
2828
},
2929
"publishReleasesCronSchedule": {
3030
"value": "0 0 * * * *"
@@ -94,6 +94,9 @@
9494
},
9595
"immediatePublicationOfScheduledReleaseVersionsEnabled": {
9696
"value": true
97+
},
98+
"publicDataDbExists": {
99+
"value": false
97100
}
98101
}
99102
}

infrastructure/templates/datafactory/components/db-maintenance-template.json

+23-18
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,14 @@
1414
"description": "The name of the key vault"
1515
}
1616
},
17-
"slackWebhook": {
18-
"type": "string",
19-
"metadata": {
20-
"description": "Slack webhook URI for alerts"
21-
}
22-
},
2317
"slackAlertsChannel": {
2418
"type": "string",
2519
"metadata": {
2620
"description": "Slack channel to post Azure alerts to"
2721
}
22+
},
23+
"slackAppToken": {
24+
"type": "securestring"
2825
}
2926
},
3027
"variables": {
@@ -125,13 +122,15 @@
125122
},
126123
"userProperties": [],
127124
"typeProperties": {
128-
"url": "[parameters('slackWebhook')]",
125+
"url": "https://slack.com/api/chat.postMessage",
129126
"method": "POST",
127+
"headers": {
128+
"Content-Type": "application/json",
129+
"Authorization": "[concat('Bearer ', parameters('slackAppToken'))]"
130+
},
130131
"body": {
131132
"channel": "[parameters('slackAlertsChannel')]",
132-
"icon_emoji": ":smile",
133133
"text": "Data Factory Success!",
134-
"username": "Alertbot",
135134
"attachments": [{
136135
"color": "good",
137136
"fields": [{
@@ -173,13 +172,15 @@
173172
},
174173
"userProperties": [],
175174
"typeProperties": {
176-
"url": "[parameters('slackWebhook')]",
175+
"url": "https://slack.com/api/chat.postMessage",
177176
"method": "POST",
177+
"headers": {
178+
"Content-Type": "application/json",
179+
"Authorization": "[concat('Bearer ', parameters('slackAppToken'))]"
180+
},
178181
"body": {
179182
"channel": "[parameters('slackAlertsChannel')]",
180-
"icon_emoji": ":face_vomiting",
181183
"text": "Data Factory Failure!",
182-
"username": "Alertbot",
183184
"attachments": [
184185
{
185186
"color": "warning",
@@ -293,13 +294,15 @@
293294
},
294295
"userProperties": [],
295296
"typeProperties": {
296-
"url": "[parameters('slackWebhook')]",
297+
"url": "https://slack.com/api/chat.postMessage",
297298
"method": "POST",
299+
"headers": {
300+
"Content-Type": "application/json",
301+
"Authorization": "[concat('Bearer ', parameters('slackAppToken'))]"
302+
},
298303
"body": {
299304
"channel": "[parameters('slackAlertsChannel')]",
300-
"icon_emoji": ":smile",
301305
"text": "Data Factory Success!",
302-
"username": "Alertbot",
303306
"attachments": [{
304307
"color": "good",
305308
"fields": [{
@@ -341,13 +344,15 @@
341344
},
342345
"userProperties": [],
343346
"typeProperties": {
344-
"url": "[parameters('slackWebhook')]",
347+
"url": "https://slack.com/api/chat.postMessage",
345348
"method": "POST",
349+
"headers": {
350+
"Content-Type": "application/json",
351+
"Authorization": "[concat('Bearer ', parameters('slackAppToken'))]"
352+
},
346353
"body": {
347354
"channel": "[parameters('slackAlertsChannel')]",
348-
"icon_emoji": ":face_vomiting",
349355
"text": "Data Factory Failure!",
350-
"username": "Alertbot",
351356
"attachments": [
352357
{
353358
"color": "warning",

infrastructure/templates/datafactory/template.json

+8-9
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,6 @@
4747
"actionGroupAlerts": {
4848
"type": "string"
4949
},
50-
"slackWebhook": {
51-
"type": "string",
52-
"metadata": {
53-
"description": "Slack webhook URI for alerts"
54-
}
55-
},
5650
"slackAlertsChannel": {
5751
"type": "string",
5852
"metadata": {
@@ -92,11 +86,16 @@
9286
"keyVaultName": {
9387
"value": "[parameters('keyVaultName')]"
9488
},
95-
"slackWebhook": {
96-
"value": "[parameters('slackWebhook')]"
97-
},
9889
"slackAlertsChannel": {
9990
"value": "[parameters('slackAlertsChannel')]"
91+
},
92+
"slackAppToken": {
93+
"reference": {
94+
"keyVault": {
95+
"id": "[resourceId('Microsoft.KeyVault/vaults', parameters('keyVaultName'))]"
96+
},
97+
"secretName": "ees-alerts-slackapptoken"
98+
}
10099
}
101100
}
102101
},

0 commit comments

Comments
 (0)