Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
a8b45df
[GPCAPIM-254]: Lift and shift of lambda functionality in to a Flask app.
davidhamill1-nhs Jan 14, 2026
73cdf4d
[GPCAPIM-254]: Lambda is no longer being used; move actions away from…
davidhamill1-nhs Jan 14, 2026
4e1ea55
[GPCAPIM-254]: Github not picking up unindented input
davidhamill1-nhs Jan 14, 2026
f89e719
[GPCAPIM-254]: Github not picking up unindented input
davidhamill1-nhs Jan 14, 2026
c321366
[GPCAPIM-254]: Add type hinting
davidhamill1-nhs Jan 14, 2026
bf390d8
[GPCAPIM-254]: Beginning of /patient/$gpc.getstructuredrecord endpoint.
davidhamill1-nhs Jan 15, 2026
4c7beef
[GPCAPIM-254]: Handle logic in request-specific class
davidhamill1-nhs Jan 19, 2026
92485cc
[GPCAPIM-254]: Move to handler class
davidhamill1-nhs Jan 19, 2026
8417c72
[GPCAPIM-254]: Update healthcheck endpoint to return simplier body.
davidhamill1-nhs Jan 20, 2026
8317bb7
[GPCAPIM-254]: Remove the lambda.
davidhamill1-nhs Jan 20, 2026
5e060c5
[GPCAPIM-254]: Clean up github actions.
davidhamill1-nhs Jan 20, 2026
5c5c82c
[GPCAPIM-254]: Clean up.
davidhamill1-nhs Jan 21, 2026
33326b5
[GPCAPIM-254]: Unit tests no loonger exist in the top level.
davidhamill1-nhs Jan 21, 2026
a78aa6b
[GPCAPIM-254]: Correct content-type header.
davidhamill1-nhs Jan 21, 2026
2f4f347
[GPCAPIM-254]: Handle response object, rather than just pass back dict.
davidhamill1-nhs Jan 21, 2026
d6d1018
[GPCAPIM-254]: Correct content-type header for healthcheck.
davidhamill1-nhs Jan 21, 2026
976dd3a
[GPCAPIM-254]: Add error hanlding in app.
davidhamill1-nhs Jan 21, 2026
859e54a
Revert "[GPCAPIM-254]: Force new deployment of ecs task in preview en…
davidhamill1-nhs Jan 21, 2026
cd6e96b
[GPCAPIM-254]: Make it clear which version is deployed in the health …
davidhamill1-nhs Jan 21, 2026
00f676a
[GPCAPIM-254]: Correct module name.
davidhamill1-nhs Jan 21, 2026
170a3cb
[GPCAPIM-254]: Use tech radars preferred alpine and run thorugh non-r…
davidhamill1-nhs Jan 21, 2026
6c0cbf0
[GPCAPIM-254]: APIM handles CSRF through its auth design; We don't ha…
davidhamill1-nhs Jan 22, 2026
0ed1834
[GPCAPIM-254]: Reduce fragility of code by pushing environment variab…
davidhamill1-nhs Jan 22, 2026
e0243b5
[GPCAPIM-254]: Reduce fragility of code by ensuring headers are corre…
davidhamill1-nhs Jan 22, 2026
2c80997
[GPCAPIM-254]: Reduce fragility of code by ensuring NHS number is cor…
davidhamill1-nhs Jan 22, 2026
8e85261
[GPCAPIM-254]: CSRF alert will be disabled in SonarQube; we do not ne…
davidhamill1-nhs Jan 26, 2026
82653af
[GPCAPIM-254]: Mock Request.geT_json() method by return the request_b…
davidhamill1-nhs Jan 26, 2026
34d02bb
[GPCAPIM-254]: Pytest, by default, runs all test_*.py files. Passing …
davidhamill1-nhs Jan 26, 2026
09ff41d
[GPCAPIM-254]: Move print lines in to test covered functions to stop …
davidhamill1-nhs Jan 26, 2026
1b3c02f
[GPCAPIM-254]: Make the behaviour of the payload more explicit.
davidhamill1-nhs Jan 26, 2026
fda4de3
[GPCAPIM-254]: Constants should be UPPERCASE for clarity.
davidhamill1-nhs Jan 26, 2026
d2a2617
[GPCAPIM-254]: No longer SSP-from/SSP-to headers; moving towards ODS-…
davidhamill1-nhs Jan 26, 2026
4fbda56
[GPCAPIM-254]: It's a numbers game.
davidhamill1-nhs Jan 26, 2026
47d4592
[GPCAPIM-254]: Correct name of test.
davidhamill1-nhs Jan 26, 2026
3238cd5
[GPCAPIM-254]: Correct step name.
davidhamill1-nhs Jan 26, 2026
76ee8f2
Change return type to flask response
Vox-Ben Jan 15, 2026
45dce95
Refactor things to make ruff happy
Vox-Ben Jan 16, 2026
9c928d7
Pass the request body & multiple SDS calls
Vox-Ben Jan 19, 2026
323d62a
Mypy happy, tests passing
Vox-Ben Jan 19, 2026
8ad53a6
Tests passing. Maybe got too many tests.
Vox-Ben Jan 20, 2026
700e4b1
Trim some unnecessary unit tests
Vox-Ben Jan 20, 2026
035faad
Sort out docstrings
Vox-Ben Jan 20, 2026
69a8bc2
Add tests for coverage
Vox-Ben Jan 20, 2026
2a0678e
Add tests for coverage
Vox-Ben Jan 20, 2026
57eccc3
Change GP Connect to GP provider
Vox-Ben Jan 20, 2026
3cd5111
Remove redundant parentheses
Vox-Ben Jan 20, 2026
ce8fe94
Fix expected response
Vox-Ben Jan 21, 2026
2c4f962
Address review comments
Vox-Ben Jan 27, 2026
a4d95ab
Integrate with real GpProviderClient
Vox-Ben Jan 27, 2026
89ebb4d
Integrate API handler with controller
Vox-Ben Jan 27, 2026
95adf64
One test passing with updated run signature
Vox-Ben Jan 28, 2026
857ae0e
Tests passing
Vox-Ben Jan 28, 2026
32bb69c
Tidy up todos
Vox-Ben Jan 28, 2026
5e5ec97
Make cleanup more robust
Vox-Ben Jan 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/actions/start-app/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: "Start local app"
description: "Start Flask app that will handle requests"
inputs:
deploy-command:
description: "Command to start app"
required: false
default: "make deploy"
health-path:
description: "Health check path"
required: false
default: "/health"
max-seconds:
description: "Maximum seconds to wait for readiness"
required: false
default: "60"
python-version:
description: "Python version to install"
required: true
runs:
using: "composite"
steps:
- name: "Start app"
shell: bash
env:
PYTHON_VERSION: ${{ inputs.python-version }}
run: |
set -euo pipefail
echo "Starting app: '${{ inputs.deploy-command }}'"
nohup ${{ inputs.deploy-command }} > /tmp/app.log 2>&1 &
echo $! > /tmp/app.pid
echo "PID: $(cat /tmp/app.pid)"
- name: "Wait for app to be ready"
shell: bash
run: |
set -euo pipefail
BASE_URL="${BASE_URL:-http://localhost:5000}"
HEALTH_URL="${BASE_URL}${{ inputs.health-path }}"
MAX="${{ inputs.max-seconds }}"
echo "Waiting for app at ${HEALTH_URL} (max ${MAX}s)..."
for i in $(seq 1 "${MAX}"); do
if curl -sSf -X GET "${HEALTH_URL}" >/dev/null; then
echo "App is ready"
exit 0
fi
sleep 1
done
echo "App did not become ready in time"
echo "---- recent app log ----"
tail -n 200 /tmp/app.log || true
exit 1
50 changes: 0 additions & 50 deletions .github/actions/start-local-lambda/action.yaml

This file was deleted.

16 changes: 8 additions & 8 deletions .github/workflows/stage-2-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ jobs:
uses: ./.github/actions/setup-python-project
with:
python-version: ${{ inputs.python_version }}
- name: "Start local Lambda"
uses: ./.github/actions/start-local-lambda
- name: "Start app"
uses: ./.github/actions/start-app
with:
python-version: ${{ inputs.python_version }}
- name: "Run contract tests"
Expand Down Expand Up @@ -98,8 +98,8 @@ jobs:
uses: ./.github/actions/setup-python-project
with:
python-version: ${{ inputs.python_version }}
- name: "Start local Lambda"
uses: ./.github/actions/start-local-lambda
- name: "Start app"
uses: ./.github/actions/start-app
with:
python-version: ${{ inputs.python_version }}
- name: "Run schema validation tests"
Expand Down Expand Up @@ -128,8 +128,8 @@ jobs:
uses: ./.github/actions/setup-python-project
with:
python-version: ${{ inputs.python_version }}
- name: "Start local Lambda"
uses: ./.github/actions/start-local-lambda
- name: "Start app"
uses: ./.github/actions/start-app
with:
python-version: ${{ inputs.python_version }}
- name: "Run integration test"
Expand Down Expand Up @@ -158,8 +158,8 @@ jobs:
uses: ./.github/actions/setup-python-project
with:
python-version: ${{ inputs.python_version }}
- name: "Start local Lambda"
uses: ./.github/actions/start-local-lambda
- name: "Start app"
uses: ./.github/actions/start-app
with:
python-version: ${{ inputs.python_version }}
max-seconds: 90
Expand Down
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ IMAGE_REPOSITORY := ${ECR_URL}
endif

IMAGE_NAME := ${IMAGE_REPOSITORY}:${IMAGE_TAG}
COMMIT_VERSION := $(shell git rev-parse --short HEAD)
BUILD_DATE := $(shell date -u +"%Y%m%d")
# ==============================================================================

# Example CI/CD targets are: dependencies, build, publish, deploy, clean, etc.
Expand All @@ -34,9 +36,8 @@ build-gateway-api: dependencies
@poetry run mypy --no-namespace-packages .
@echo "Packaging dependencies..."
@poetry build --format=wheel
@pip install "dist/gateway_api-0.1.0-py3-none-any.whl" --target "./target/gateway-api" --platform musllinux_1_1_x86_64 --only-binary=:all:
@pip install "dist/gateway_api-0.1.0-py3-none-any.whl" --target "./target/gateway-api" --platform musllinux_1_2_x86_64 --only-binary=:all:
# Copy main file separately as it is not included within the package.
@cp lambda_handler.py ./target/gateway-api/
@rm -rf ../infrastructure/images/gateway-api/resources/build/
@mkdir ../infrastructure/images/gateway-api/resources/build/
@cp -r ./target/gateway-api ../infrastructure/images/gateway-api/resources/build/
Expand All @@ -46,7 +47,7 @@ build-gateway-api: dependencies
.PHONY: build
build: build-gateway-api # Build the project artefact @Pipeline
@echo "Building Docker x86 image using Docker. Utilising python version: ${PYTHON_VERSION} ..."
@$(docker) buildx build --platform linux/amd64 --load --provenance=false --build-arg PYTHON_VERSION=${PYTHON_VERSION} -t ${IMAGE_NAME} infrastructure/images/gateway-api
@$(docker) buildx build --platform linux/amd64 --load --provenance=false --build-arg PYTHON_VERSION=${PYTHON_VERSION} --build-arg COMMIT_VERSION=${COMMIT_VERSION} --build-arg BUILD_DATE=${BUILD_DATE} -t ${IMAGE_NAME} infrastructure/images/gateway-api
@echo "Docker image '${IMAGE_NAME}' built successfully!"

publish: # Publish the project artefact @Pipeline
Expand Down
38 changes: 0 additions & 38 deletions gateway-api/lambda_handler.py

This file was deleted.

Loading
Loading