From 337933280a3a94f54c3732fb21b8321d08157e41 Mon Sep 17 00:00:00 2001 From: BMustafa97 Date: Sun, 28 Sep 2025 23:10:06 +0100 Subject: [PATCH 1/2] tests fixed and cleanup.yaml too --- .github/workflows/cleanup.yml | 8 ++++---- src/app.py | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml index b68543e..71b0f1d 100644 --- a/.github/workflows/cleanup.yml +++ b/.github/workflows/cleanup.yml @@ -48,12 +48,12 @@ jobs: echo "Listing images older than 30 days (keeping latest 10)..." >> $GITHUB_STEP_SUMMARY - # Get images older than 30 days, excluding latest 10 + # Get all images, sort by date, exclude latest 10, then filter by date + THIRTY_DAYS_AGO=$(date -d '30 days ago' '+%Y-%m-%dT%H:%M:%S') OLD_IMAGES=$(aws ecr describe-images \ --repository-name $REPOSITORY \ - --query 'sort_by(imageDetails,&imagePushedAt)[:-10].imageDigest' \ - --output text \ - --filter "imageDetail.imagePushedAt < $(date -d '30 days ago' --iso-8601)") + --query "sort_by(imageDetails,&imagePushedAt)[:-10][?imagePushedAt<'$THIRTY_DAYS_AGO'].imageDigest" \ + --output text) if [[ -z "$OLD_IMAGES" ]]; then echo "✅ No old images found for cleanup" >> $GITHUB_STEP_SUMMARY diff --git a/src/app.py b/src/app.py index 922ea2a..d2b47f6 100644 --- a/src/app.py +++ b/src/app.py @@ -32,6 +32,7 @@ def health_check(): return jsonify({ 'status': 'healthy', 'service': 'document-categoriser', + 'version': '1.0.0', 'timestamp': datetime.utcnow().isoformat() }), 200 From f9fbd9fbc37b7defe50c34808469fb975e11b511 Mon Sep 17 00:00:00 2001 From: BMustafa97 Date: Sun, 28 Sep 2025 23:13:42 +0100 Subject: [PATCH 2/2] tests fixed and cleanup.yaml too --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0668921..5d95020 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -109,6 +109,7 @@ jobs: context: . push: false tags: document-categoriser:test + load: true cache-from: type=gha cache-to: type=gha,mode=max