Skip to content

Commit 9fbdef7

Browse files
committed
Merge branch 'master' into VED-303-REDIS-Cached-Mappings
# Conflicts: # recordprocessor/pyproject.toml
2 parents bed1eec + 6c4c6a8 commit 9fbdef7

19 files changed

Lines changed: 706 additions & 663 deletions

File tree

ack_backend/poetry.lock

Lines changed: 76 additions & 76 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ack_backend/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ readme = "README.md"
77

88
[tool.poetry.dependencies]
99
python = "~3.10"
10-
boto3 = "~1.38.29"
10+
boto3 = "~1.38.35"
1111
mypy-boto3-dynamodb = "^1.38.4"
1212
freezegun = "^1.5.2"
1313
moto = "^4"
14-
coverage = "^7.8.0"
14+
coverage = "^7.9.0"
1515

1616

1717
[build-system]

azure/templates/post-deploy.yml

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -84,38 +84,38 @@ steps:
8484
8585
- bash: |
8686
set -ex
87-
if ! [[ $APIGEE_ENVIRONMENT =~ .*-*sandbox ]]; then
88-
counter=0
89-
base_path="$SERVICE_BASE_PATH"
9087
91-
endpoint=""
88+
endpoint=""
89+
if [[ $APIGEE_ENVIRONMENT =~ "prod" ]]; then
90+
endpoint="https://api.service.nhs.uk/${SERVICE_BASE_PATH}/_status"
91+
else
92+
endpoint="https://${APIGEE_ENVIRONMENT}.api.service.nhs.uk/${SERVICE_BASE_PATH}/_status"
93+
fi
9294
93-
if [[ $APIGEE_ENVIRONMENT =~ "prod" ]]; then
94-
endpoint="https://api.service.nhs.uk/${base_path}/_status"
95+
counter=0
96+
while [[ $counter -lt 31 ]]; do
97+
response=$(curl -H "apikey: $(status-endpoint-api-key)" -s "$endpoint")
98+
response_code=$(jq -r '.checks.healthcheck.responseCode' <<< "$response")
99+
response_body=$(jq -r '.checks.healthcheck.outcome' <<< "$response")
100+
status=$(jq -r '.status' <<< "$response")
101+
if [ "$response_code" -eq 200 ] && [ "$response_body" == "OK" ] && [ "$status" == "pass" ]; then
102+
echo "Status test successful"
103+
break
95104
else
96-
endpoint="https://${APIGEE_ENVIRONMENT}.api.service.nhs.uk/${base_path}/_status"
105+
echo "Waiting for $endpoint to return a 200 response with 'OK' body..."
106+
((counter=counter+1)) # Increment counter by 1
107+
echo "Attempt $counter"
108+
sleep 30
97109
fi
110+
done
98111
99-
while [[ $counter -lt 11 ]]; do
100-
response=$(curl -H "apikey: $(status-endpoint-api-key)" -s "$endpoint")
101-
response_code=$(jq -r '.checks.healthcheck.responseCode' <<< "$response")
102-
response_body=$(jq -r '.checks.healthcheck.outcome' <<< "$response")
103-
if [ "$response_code" -eq 200 ] && [ "$response_body" == "OK" ]; then
104-
echo "Status test successful"
105-
break
106-
else
107-
echo "Waiting for $endpoint to return a 200 response with 'OK' body..."
108-
((counter=counter+1)) # Increment counter by 1
109-
echo "Attempt $counter"
110-
sleep 30
111-
fi
112-
done
113-
if [ $counter -eq 11 ]; then
114-
echo "Status test failed: Maximum number of attempts reached"
115-
exit 1
116-
fi
112+
if [ $counter -eq 31 ]; then
113+
echo "Status test failed: Maximum number of attempts reached"
114+
echo "Last response received:"
115+
echo "$response"
116+
exit 1
117117
fi
118-
displayName: Waiting for TF resources to be UP
118+
displayName: Wait for API to be available
119119
workingDirectory: "$(Pipeline.Workspace)/s/$(SERVICE_NAME)/$(SERVICE_ARTIFACT_NAME)"
120120
121121
- bash: |
@@ -168,7 +168,7 @@ steps:
168168
export DEFAULT_CLIENT_SECRET="$(INT_CLIENT_SECRET)"
169169
echo "running: $test_cmd -v -c test_deployment.py test_proxy.py"
170170
$test_cmd -v -c test_deployment.py test_proxy.py
171-
171+
172172
elif [[ $APIGEE_ENVIRONMENT == "prod" ]]; then
173173
echo "Proxy test completed successfully as part of terraform resource up status check"
174174
@@ -179,35 +179,35 @@ steps:
179179
workingDirectory: "$(Pipeline.Workspace)/s/$(SERVICE_NAME)/$(SERVICE_ARTIFACT_NAME)/e2e"
180180
displayName: Run Full Test Suite
181181
182-
182+
183183
184184
- bash: |
185185
set -e
186186
if ! [[ "$APIGEE_ENVIRONMENT" == "prod" || "$APIGEE_ENVIRONMENT" == "int" || "$APIGEE_ENVIRONMENT" == *"sandbox" ]]; then
187187
echo "Running E2E batch folder test cases"
188-
188+
189189
export AWS_PROFILE="apim-dev"
190190
aws_account_no="$(aws sts get-caller-identity --query Account --output text)"
191191
echo "Using AWS Account: $aws_account_no"
192-
192+
193193
service_name="${FULLY_QUALIFIED_SERVICE_NAME}"
194-
194+
195195
pr_no=$(echo "$service_name" | { grep -oE '[0-9]+$' || true; })
196196
if [ -z "$pr_no" ]; then
197197
workspace="$APIGEE_ENVIRONMENT"
198198
else
199199
workspace="pr-$pr_no"
200200
fi
201-
201+
202202
poetry install --no-root # Install dependencies defined in pyproject.toml
203-
203+
204204
ENV="$workspace" poetry run python -m unittest -v -c
205-
205+
206206
echo "E2E batch folder test cases executed successfully"
207207
else
208208
echo "Skipping E2E batch folder test cases as the environment is prod-int-sandbox"
209209
fi
210-
210+
211211
displayName: Run full batch test suite
212212
workingDirectory: "$(Pipeline.Workspace)/s/$(SERVICE_NAME)/$(SERVICE_ARTIFACT_NAME)/e2e_batch"
213213
condition: eq(1, 2) # Disable task but make this step visible in the pipeline
@@ -217,4 +217,4 @@ steps:
217217
condition: always()
218218
inputs:
219219
testResultsFiles: '$(Pipeline.Workspace)/s/$(SERVICE_NAME)/$(SERVICE_ARTIFACT_NAME)/tests/test-report.xml'
220-
failTaskOnFailedTests: true
220+
failTaskOnFailedTests: true

backend/poetry.lock

Lines changed: 87 additions & 86 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ packages = [{include = "src"}]
99
[tool.poetry.dependencies]
1010
python = "~3.11"
1111
"fhir.resources" = "~7.0.2"
12-
boto3 = "~1.38.17"
13-
boto3-stubs-lite = {extras = ["dynamodb"], version = "~1.38.29"}
12+
boto3 = "~1.38.35"
13+
boto3-stubs-lite = {extras = ["dynamodb"], version = "~1.38.35"}
1414
aws-lambda-typing = "~2.20.0"
1515
moto = "^5.1.4"
16-
requests = "~2.32.3"
16+
requests = "~2.32.4"
1717
responses = "~0.25.7"
1818
pydantic = "~1.10.13"
1919
pyjwt = "~2.10.1"
@@ -24,7 +24,7 @@ simplejson = "^3.19.2"
2424
structlog = "^24.1.0"
2525
python-stdnum = "^2.1"
2626
freezegun = "^1.5.1"
27-
coverage = "^7.8.0"
27+
coverage = "^7.9.0"
2828

2929
[build-system]
3030
requires = ["poetry-core ~= 1.5.0"]

0 commit comments

Comments
 (0)