Skip to content

Commit 56c763e

Browse files
committed
fix: resolve ruff PLR2004 lint error and Windows integration test failure
- Extract magic number 3 to _ECS_SERVICE_ARN_PARTS constant - Switch test Dockerfile to public.ecr.aws alpine (multi-arch, no rate limits)
1 parent 2eeb2b3 commit 56c763e

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

samcli/lib/sync/flows/ecs_container_sync_flow.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222
LOG = logging.getLogger(__name__)
2323

24+
# Minimum number of parts expected when splitting an ECS service ARN by "/"
25+
# e.g. arn:aws:ecs:region:account:service/cluster/name -> [..., "cluster", "name"]
26+
_ECS_SERVICE_ARN_PARTS = 3
27+
2428

2529
class ECSContainerSyncFlow(SyncFlow):
2630
"""SyncFlow for ECS TaskDefinition and AgentCore container image resources.
@@ -174,7 +178,7 @@ def _force_ecs_deployment(self) -> None:
174178
try:
175179
# Extract cluster and service from the ARN
176180
parts = resource_physical_id.rsplit("/", 2)
177-
if len(parts) < 3:
181+
if len(parts) < _ECS_SERVICE_ARN_PARTS:
178182
continue
179183
cluster = parts[-2]
180184
service_name = parts[-1]
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.12-slim
1+
FROM public.ecr.aws/docker/library/alpine:3.19
22
WORKDIR /app
33
RUN echo "hello" > /app/test.txt
4-
CMD ["python", "-c", "print('test')"]
4+
CMD ["echo", "test"]

0 commit comments

Comments
 (0)