Skip to content

Commit 40d5268

Browse files
authored
Merge pull request #4948 from nhsuk/next
Version 5.2.2
2 parents 3660d12 + 5d11ac1 commit 40d5268

File tree

184 files changed

+3674
-1328
lines changed

Some content is hidden

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

184 files changed

+3674
-1328
lines changed

.github/workflows/build-and-push-image.yml

Lines changed: 47 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name: Build and push image
2-
run-name: Build and push image for ${{ inputs.git-sha || github.sha }}
1+
name: Build and push images
2+
run-name: Build and push images for ${{ inputs.git-sha || github.sha }}
33

44
on:
55
workflow_dispatch:
@@ -26,10 +26,15 @@ jobs:
2626
check-image-presence:
2727
name: Check if images already exist
2828
runs-on: ubuntu-latest
29+
strategy:
30+
fail-fast: true
31+
matrix:
32+
image_type: ["webapp", "ops"]
2933
permissions:
3034
id-token: write
3135
outputs:
32-
build-needed: ${{ steps.check-dev-image.outputs.build-needed || steps.check-prod-image.outputs.build-needed }}
36+
webapp-build-needed: ${{ steps.check-dev-image.outputs.webapp-build-needed || steps.check-prod-image.outputs.webapp-build-needed }}
37+
ops-build-needed: ${{ steps.check-dev-image.outputs.ops-build-needed || steps.check-prod-image.outputs.ops-build-needed }}
3338
steps:
3439
- name: Configure AWS Dev Credentials
3540
uses: aws-actions/configure-aws-credentials@v5
@@ -39,11 +44,11 @@ jobs:
3944
- name: Check if dev image exists
4045
id: check-dev-image
4146
run: |
42-
if aws ecr describe-images --repository-name mavis/webapp --image-ids imageTag=$git_ref > /dev/null 2>&1; then
47+
if aws ecr describe-images --repository-name mavis/${{ matrix.image_type }} --image-ids imageTag=$git_ref > /dev/null 2>&1; then
4348
echo "Dev image with given tag already exists"
4449
else
4550
echo "Dev image does not exist. Build needed"
46-
echo "build-needed=true" >> $GITHUB_OUTPUT
51+
echo "${{ matrix.image_type }}-build-needed=true" >> $GITHUB_OUTPUT
4752
fi
4853
- name: Configure AWS Production credentials
4954
if: env.PUSH_IMAGE_TO_PRODUCTION == 'true'
@@ -55,33 +60,12 @@ jobs:
5560
if: env.PUSH_IMAGE_TO_PRODUCTION == 'true'
5661
id: check-prod-image
5762
run: |
58-
if aws ecr describe-images --repository-name mavis/webapp --image-ids imageTag=$git_ref > /dev/null 2>&1; then
63+
if aws ecr describe-images --repository-name mavis/${{ matrix.image_type }} --image-ids imageTag=$git_ref > /dev/null 2>&1; then
5964
echo "Production image with given tag already exists"
6065
else
6166
echo "Production image does not exist. Build needed"
62-
echo "build-needed=true" >> $GITHUB_OUTPUT
67+
echo "${{ matrix.image_type }}-build-needed=true" >> $GITHUB_OUTPUT
6368
fi
64-
65-
build:
66-
needs: check-image-presence
67-
if: needs.check-image-presence.outputs.build-needed == 'true'
68-
runs-on: ubuntu-latest
69-
steps:
70-
- name: Checkout code
71-
uses: actions/checkout@v5
72-
with:
73-
ref: ${{ env.git_ref }}
74-
- name: Write build SHA
75-
run: git rev-parse HEAD > public/sha
76-
- name: Build Docker image
77-
run: docker build -t "mavis:latest" .
78-
- name: Save Docker image
79-
run: docker save -o image.tar mavis:latest
80-
- name: Upload Docker image
81-
uses: actions/upload-artifact@v4
82-
with:
83-
name: image
84-
path: image.tar
8569
define-matrix:
8670
name: Determine AWS roles to push the image
8771
runs-on: ubuntu-latest
@@ -97,6 +81,37 @@ jobs:
9781
else
9882
echo 'aws-roles=["arn:aws:iam::393416225559:role/GithubDeployMavisAndInfrastructure"]' >> $GITHUB_OUTPUT
9983
fi
84+
build:
85+
needs: check-image-presence
86+
if: needs.check-image-presence.outputs.webapp-build-needed == 'true' || needs.check-image-presence.outputs.ops-build-needed == 'true'
87+
runs-on: ubuntu-latest
88+
permissions:
89+
id-token: write
90+
steps:
91+
- name: Checkout code
92+
uses: actions/checkout@v5
93+
with:
94+
ref: ${{ env.git_ref }}
95+
- name: Write build SHA
96+
run: git rev-parse HEAD > public/sha
97+
- name: Build webapp docker image
98+
run: docker build -t "mavis-webapp:latest" .
99+
- name: Save web image
100+
run: docker save -o image.tar mavis-webapp:latest
101+
- name: Upload web image
102+
uses: actions/upload-artifact@v4
103+
with:
104+
name: webapp-image
105+
path: image.tar
106+
- name: Build ops docker image
107+
run: docker build -f ops.Dockerfile -t "mavis-ops:latest" .
108+
- name: Save ops image
109+
run: docker save -o image.tar mavis-ops:latest
110+
- name: Upload ops image
111+
uses: actions/upload-artifact@v4
112+
with:
113+
name: ops-image
114+
path: image.tar
100115
push:
101116
runs-on: ubuntu-latest
102117
needs: [build, define-matrix]
@@ -105,11 +120,12 @@ jobs:
105120
strategy:
106121
matrix:
107122
aws-role: ${{ fromJSON(needs.define-matrix.outputs.aws-roles) }}
123+
image_type: ["webapp", "ops"]
108124
steps:
109125
- name: Download Docker image
110126
uses: actions/download-artifact@v5
111127
with:
112-
name: image
128+
name: ${{ matrix.image_type }}-image
113129
- name: Configure AWS Credentials
114130
uses: aws-actions/configure-aws-credentials@v5
115131
with:
@@ -121,6 +137,6 @@ jobs:
121137
- name: Load Docker image
122138
run: docker load -i image.tar
123139
- name: Tag Docker image
124-
run: docker tag mavis:latest "${{ steps.login-ecr.outputs.registry }}/mavis/webapp":"$git_ref"
140+
run: docker tag mavis-${{ matrix.image_type }}:latest "${{ steps.login-ecr.outputs.registry }}/mavis/${{ matrix.image_type }}":"$git_ref"
125141
- name: Push Docker image
126-
run: docker push "${{ steps.login-ecr.outputs.registry }}/mavis/webapp":"$git_ref"
142+
run: docker push "${{ steps.login-ecr.outputs.registry }}/mavis/${{ matrix.image_type }}":"$git_ref"

.github/workflows/deploy-application.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ on:
2424
- all
2525
- web
2626
- sidekiq
27+
- ops
2728
default: all
2829
git_ref_to_deploy:
2930
description:
@@ -81,7 +82,7 @@ jobs:
8182
id: get-git-sha
8283
run: echo "git-sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
8384

84-
build-and-push-image:
85+
build-and-push-images:
8586
permissions:
8687
id-token: write
8788
needs: determine-git-sha
@@ -92,13 +93,15 @@ jobs:
9293
prepare-deployment:
9394
name: Prepare deployment
9495
runs-on: ubuntu-latest
95-
needs: [ determine-git-sha, build-and-push-image ]
96+
needs: [ determine-git-sha, build-and-push-images ]
9697
permissions:
9798
id-token: write
9899
strategy:
99100
fail-fast: true
100101
matrix:
101-
service: ${{ inputs.server_types == 'all' && fromJSON('["web", "sidekiq"]') || fromJSON(format('["{0}"]', inputs.server_types)) }}
102+
service: ${{ inputs.server_types == 'all' && fromJSON('["web", "sidekiq", "ops"]') || fromJSON(format('["{0}"]', inputs.server_types)) }}
103+
env:
104+
repository_name: ${{ matrix.service == 'ops' && 'mavis/ops' || 'mavis/webapp' }}
102105
steps:
103106
- name: Checkout code
104107
uses: actions/checkout@v5
@@ -116,7 +119,7 @@ jobs:
116119
image_tag: ${{ needs.determine-git-sha.outputs.git-sha }}
117120
run: |
118121
digest=$(aws ecr describe-images \
119-
--repository-name mavis/webapp \
122+
--repository-name $repository_name \
120123
--image-ids imageTag=$image_tag \
121124
--query 'imageDetails[0].imageDigest' \
122125
--output text)
@@ -127,7 +130,7 @@ jobs:
127130
with:
128131
task-definition-family: "mavis-${{ matrix.service }}-task-definition-${{ inputs.environment }}-template"
129132
container-name: "application"
130-
image: "${{ env.aws_account_id }}.dkr.ecr.eu-west-2.amazonaws.com/mavis/webapp@${{ steps.get-image-digest.outputs.digest }}"
133+
image: "${{ env.aws_account_id }}.dkr.ecr.eu-west-2.amazonaws.com/${{ env.repository_name }}@${{ steps.get-image-digest.outputs.digest }}"
131134
environment-variables: |
132135
APP_VERSION=${{ env.app_version }}
133136
- name: Rename task definition file
@@ -145,7 +148,6 @@ jobs:
145148
environment: ${{ inputs.environment }}
146149
steps:
147150
- run: echo "Proceeding with deployment to $environment"
148-
149151
deploy-service:
150152
name: Deploy service
151153
runs-on: ubuntu-latest
@@ -155,7 +157,7 @@ jobs:
155157
strategy:
156158
fail-fast: false
157159
matrix:
158-
service: ${{ inputs.server_types == 'all' && fromJSON('["web", "sidekiq"]') || fromJSON(format('["{0}"]', inputs.server_types)) }}
160+
service: ${{ inputs.server_types == 'all' && fromJSON('["web", "sidekiq", "ops"]') || fromJSON(format('["{0}"]', inputs.server_types)) }}
159161
steps:
160162
- name: Configure AWS Credentials
161163
uses: aws-actions/configure-aws-credentials@v5

.github/workflows/deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ on:
4141
- all
4242
- web
4343
- sidekiq
44+
- ops
4445
- none
4546
default: all
4647

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- uses: ruby/setup-ruby@v1
1717
with:
1818
bundler-cache: true
19-
- uses: actions/setup-node@v5
19+
- uses: actions/setup-node@v6
2020
with:
2121
cache: yarn
2222
node-version-file: .tool-versions

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
RAILS_ENV: test
6363
steps:
6464
- uses: actions/checkout@v5
65-
- uses: actions/setup-node@v5
65+
- uses: actions/setup-node@v6
6666
with:
6767
node-version-file: .tool-versions
6868
cache: yarn
@@ -81,7 +81,7 @@ jobs:
8181
runs-on: ubuntu-latest
8282
steps:
8383
- uses: actions/checkout@v5
84-
- uses: actions/setup-node@v5
84+
- uses: actions/setup-node@v6
8585
with:
8686
node-version-file: .tool-versions
8787
cache: yarn

Gemfile.lock

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ GEM
113113
ast (2.4.3)
114114
attr_required (1.0.2)
115115
aws-eventstream (1.4.0)
116-
aws-partitions (1.1172.0)
116+
aws-partitions (1.1174.0)
117117
aws-sdk-accessanalyzer (1.78.0)
118118
aws-sdk-core (~> 3, >= 3.231.0)
119119
aws-sigv4 (~> 1.5)
@@ -125,7 +125,7 @@ GEM
125125
bigdecimal
126126
jmespath (~> 1, >= 1.6.1)
127127
logger
128-
aws-sdk-ec2 (1.561.0)
128+
aws-sdk-ec2 (1.564.0)
129129
aws-sdk-core (~> 3, >= 3.231.0)
130130
aws-sigv4 (~> 1.5)
131131
aws-sdk-ecr (1.110.0)
@@ -140,7 +140,7 @@ GEM
140140
aws-sdk-rds (1.296.0)
141141
aws-sdk-core (~> 3, >= 3.231.0)
142142
aws-sigv4 (~> 1.5)
143-
aws-sdk-s3 (1.199.1)
143+
aws-sdk-s3 (1.200.0)
144144
aws-sdk-core (~> 3, >= 3.231.0)
145145
aws-sdk-kms (~> 1)
146146
aws-sigv4 (~> 1.5)
@@ -218,7 +218,7 @@ GEM
218218
dry-cli (1.3.0)
219219
email_validator (2.2.4)
220220
activemodel
221-
erb (5.0.2)
221+
erb (5.1.1)
222222
erubi (1.13.1)
223223
et-orbi (1.3.0)
224224
tzinfo
@@ -246,8 +246,8 @@ GEM
246246
concurrent-ruby (~> 1.1)
247247
webrick (~> 1.7)
248248
websocket-driver (~> 0.7)
249-
ffi (1.17.1-arm64-darwin)
250-
ffi (1.17.1-x86_64-linux-gnu)
249+
ffi (1.17.2-arm64-darwin)
250+
ffi (1.17.2-x86_64-linux-gnu)
251251
fhir_models (5.0.0)
252252
bcp47 (>= 0.3)
253253
date_time_precision (>= 0.8)
@@ -288,7 +288,7 @@ GEM
288288
tilt
289289
hashdiff (1.1.2)
290290
hashie (5.0.0)
291-
hotwire-livereload (2.0.0)
291+
hotwire-livereload (2.1.1)
292292
actioncable (>= 7.0.0)
293293
listen (>= 3.0.0)
294294
railties (>= 7.0.0)
@@ -369,7 +369,7 @@ GEM
369369
mime-types-data (~> 3.2015)
370370
mime-types-data (3.2025.0107)
371371
mini_mime (1.1.5)
372-
minitest (5.25.5)
372+
minitest (5.26.0)
373373
msgpack (1.8.0)
374374
net-http (0.6.0)
375375
uri
@@ -429,7 +429,7 @@ GEM
429429
pg (1.6.2-arm64-darwin)
430430
pg (1.6.2-x86_64-linux)
431431
phonelib (0.10.12)
432-
pp (0.6.2)
432+
pp (0.6.3)
433433
prettyprint
434434
prettier_print (1.2.1)
435435
prettyprint (0.2.0)
@@ -516,9 +516,10 @@ GEM
516516
ffi (~> 1.0)
517517
rbs (3.9.5)
518518
logger
519-
rdoc (6.14.2)
519+
rdoc (6.15.0)
520520
erb
521521
psych (>= 4.0.0)
522+
tsort
522523
redcarpet (3.6.1)
523524
redis-client (0.26.1)
524525
connection_pool
@@ -606,7 +607,7 @@ GEM
606607
rubyzip (>= 1.3.0)
607608
rubyntlm (0.6.5)
608609
base64
609-
rubyzip (3.1.1)
610+
rubyzip (3.2.0)
610611
rufo (0.18.1)
611612
rufus-scheduler (3.9.2)
612613
fugit (~> 1.1, >= 1.11.1)
@@ -713,7 +714,7 @@ GEM
713714
unicode-display_width (3.2.0)
714715
unicode-emoji (~> 4.1)
715716
unicode-emoji (4.1.0)
716-
uri (1.0.3)
717+
uri (1.0.4)
717718
useragent (0.16.11)
718719
validate_url (1.0.15)
719720
activemodel (>= 3.0.0)

app/components/app_activity_log_component.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def initialize(team:, patient:, session: nil)
114114
:vaccination_records
115115

116116
def events_by_day
117-
all_events.sort_by { -it[:at].to_i }.group_by { it[:at].to_date }
117+
all_events.sort_by { it[:at] }.reverse.group_by { it[:at].to_date }
118118
end
119119

120120
def all_events

app/components/app_patient_programmes_table_component.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,10 @@ def status_for_programme(vaccination_status:, programme:, academic_year:)
112112
return "-"
113113
end
114114

115-
label = I18n.t(vaccination_status.status, scope: "status.programme.label")
116-
colour = I18n.t(vaccination_status.status, scope: "status.programme.colour")
115+
status = vaccination_status.status
116+
117+
label = I18n.t(status, scope: %i[status vaccination label])
118+
colour = I18n.t(status, scope: %i[status vaccination colour])
117119
tag.strong(label, class: "nhsuk-tag nhsuk-tag--#{colour}")
118120
end
119121

0 commit comments

Comments
 (0)