Skip to content

Commit 0192131

Browse files
committed
review fixes
1 parent c88218d commit 0192131

File tree

5 files changed

+16
-25
lines changed

5 files changed

+16
-25
lines changed

lambdas/ack_backend/Dockerfile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@ RUN mkdir -p /home/appuser && \
55
echo 'appuser:x:1001:' >> /etc/group && \
66
chown -R 1001:1001 /home/appuser && pip install "poetry~=2.1.4"
77

8+
# Install ack_backend dependencies
9+
WORKDIR /var/task
10+
RUN poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi --no-root --only main
11+
812
# Install Poetry dependencies
913
# Copy ack_backend Poetry files
1014
COPY ./ack_backend/poetry.lock ./ack_backend/pyproject.toml ./
11-
COPY ./shared/src/common ./src/common
1215

13-
RUN echo "Listing /var/task after source code copy:" && ls -R /var/task
14-
15-
# Install ack_backend dependencies
16-
WORKDIR /var/task
17-
RUN poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi --no-root --only main
1816
# -----------------------------
1917
FROM base AS build
2018

lambdas/ack_backend/src/logging_decorators.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from functools import wraps
77
from common.log_decorator import generate_and_send_logs
88

9-
prefix = "ack_processor"
9+
PREFIX = "ack_processor"
1010
STREAM_NAME = os.getenv("SPLUNK_FIREHOSE_NAME", "immunisation-fhir-api-internal-dev-splunk-firehose")
1111

1212

@@ -15,7 +15,7 @@ def convert_message_to_ack_row_logging_decorator(func):
1515

1616
@wraps(func)
1717
def wrapper(message, created_at_formatted_string):
18-
base_log_data = {"function_name": f"{prefix}_{func.__name__}", "date_time": str(datetime.now())}
18+
base_log_data = {"function_name": f"{PREFIX}_{func.__name__}", "date_time": str(datetime.now())}
1919
start_time = time.time()
2020

2121
try:
@@ -55,7 +55,7 @@ def upload_ack_file_logging_decorator(func):
5555
@wraps(func)
5656
def wrapper(*args, **kwargs):
5757

58-
base_log_data = {"function_name": f"{prefix}_{func.__name__}", "date_time": str(datetime.now())}
58+
base_log_data = {"function_name": f"{PREFIX}_{func.__name__}", "date_time": str(datetime.now())}
5959
start_time = time.time()
6060

6161
# NB this doesn't require a try-catch block as the wrapped function never throws an exception
@@ -76,7 +76,7 @@ def ack_lambda_handler_logging_decorator(func):
7676
@wraps(func)
7777
def wrapper(event, context, *args, **kwargs):
7878

79-
base_log_data = {"function_name": f"{prefix}_{func.__name__}", "date_time": str(datetime.now())}
79+
base_log_data = {"function_name": f"{PREFIX}_{func.__name__}", "date_time": str(datetime.now())}
8080
start_time = time.time()
8181

8282
try:

lambdas/ack_backend/tests/test_splunk_logging.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ def test_splunk_logging_missing_data(self):
156156
self.assertEqual(first_logger_info_call_args, expected_first_logger_info_data)
157157
self.assertEqual(first_logger_error_call_args, expected_first_logger_error_data)
158158

159-
print(mock_send_log_to_firehose.call_args_list)
160159
print(call(expected_first_logger_info_data))
161160
print(call(expected_first_logger_error_data))
162161
self.assertEqual(

lambdas/id_sync/Dockerfile

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,14 @@ RUN mkdir -p /home/appuser && \
66
echo 'appuser:x:1001:' >> /etc/group && \
77
chown -R 1001:1001 /home/appuser && pip install "poetry~=2.1.4"
88

9-
# Install Poetry dependencies
10-
# Copy id_sync Poetry files
11-
COPY ./id_sync/poetry.lock ./id_sync/pyproject.toml ./
12-
COPY ./shared/src/common ./src/common
13-
14-
RUN echo "Listing /var/task after source code copy:" && ls -R /var/task
15-
169
# Install id_sync dependencies
1710
WORKDIR /var/task
1811
RUN poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi --no-root --only main
1912

13+
# Install Poetry dependencies
14+
# Copy id_sync Poetry files
15+
COPY ./id_sync/poetry.lock ./id_sync/pyproject.toml ./
16+
2017
# -----------------------------
2118
FROM base AS build
2219

lambdas/redis_sync/Dockerfile

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,14 @@ RUN mkdir -p /home/appuser && \
66
echo 'appuser:x:1001:' >> /etc/group && \
77
chown -R 1001:1001 /home/appuser && pip install "poetry~=2.1.4"
88

9-
# Install Poetry dependencies
10-
# Copy redis_sync Poetry files
11-
COPY ./redis_sync/poetry.lock ./redis_sync/pyproject.toml ./
12-
COPY ./shared/src/common ./src/common
13-
14-
RUN echo "Listing /var/task after source code copy:" && ls -R /var/task
15-
169
# Install redis_sync dependencies
1710
WORKDIR /var/task
1811
RUN poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi --no-root --only main
1912

13+
# Install Poetry dependencies
14+
# Copy redis_sync Poetry files
15+
COPY ./redis_sync/poetry.lock ./redis_sync/pyproject.toml ./
16+
2017
# -----------------------------
2118
FROM base AS build
2219

0 commit comments

Comments
 (0)