From cc4b40fd95b9843928486b04d11bf07847666e89 Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Mon, 29 Jun 2026 15:46:35 +0000 Subject: [PATCH] Package repositories/ into the address2UPRN lambda image so it imports at cold start main.py imports repositories.historic_epc.* after the re-plug; without the COPY the lambda fails at init with Runtime.ImportModuleError (caught by test_lambda_image_copies_full_import_closure). Co-Authored-By: Claude Opus 4.8 (1M context) --- backend/address2UPRN/handler/Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/address2UPRN/handler/Dockerfile b/backend/address2UPRN/handler/Dockerfile index fddbcaab2..f7b859730 100644 --- a/backend/address2UPRN/handler/Dockerfile +++ b/backend/address2UPRN/handler/Dockerfile @@ -39,6 +39,10 @@ COPY infrastructure/ infrastructure/ # EpcClientService -> datatypes.epc.domain.mapper -> domain.sap10_calculator; # without this the lambda fails at init with "No module named 'domain'". COPY domain/ domain/ +# main.py resolves historic-EPC UPRNs via repositories.historic_epc.* (the +# HistoricEpcResolver + S3 repository); without this the lambda fails at init +# with "No module named 'repositories'". +COPY repositories/ repositories/ # Copy the handler COPY backend/address2UPRN/main.py .