From 0ee81b95225a511dfb6412cc1cd632cfdd4fbd49 Mon Sep 17 00:00:00 2001 From: Bakery Admin Date: Fri, 23 Jan 2026 06:08:12 +0100 Subject: [PATCH] Fix resources isues 34 --- .../templates/task-detect-changes.yaml | 7 +++++-- .../tekton-helm/templates/task-kaniko-build.yaml | 16 +++++++++++----- shared/database/base.py | 2 +- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/infrastructure/cicd/tekton-helm/templates/task-detect-changes.yaml b/infrastructure/cicd/tekton-helm/templates/task-detect-changes.yaml index 4705876b..10b4c9e8 100644 --- a/infrastructure/cicd/tekton-helm/templates/task-detect-changes.yaml +++ b/infrastructure/cicd/tekton-helm/templates/task-detect-changes.yaml @@ -102,9 +102,12 @@ spec: add_service "frontend" fi - # Check for changes in shared/ directory (might affect multiple services) + # Check for changes in shared/ directory + # shared/ contains code used by services and gateway (NOT frontend), so rebuild them if echo "$CHANGED_FILES" | grep -q '^shared/'; then - add_service "shared" + echo "Detected changes in shared/ - triggering rebuild of all services and gateway" + echo "services-and-gateway" > $(results.changed-services.path) + exit 0 fi if [ -z "$CHANGED_SERVICES" ]; then diff --git a/infrastructure/cicd/tekton-helm/templates/task-kaniko-build.yaml b/infrastructure/cicd/tekton-helm/templates/task-kaniko-build.yaml index c2812982..09169899 100644 --- a/infrastructure/cicd/tekton-helm/templates/task-kaniko-build.yaml +++ b/infrastructure/cicd/tekton-helm/templates/task-kaniko-build.yaml @@ -86,9 +86,15 @@ spec: echo "Trimmed services param: '$SERVICES_PARAM'" - # Handle "all" case by discovering services from workspace - if [ "$SERVICES_PARAM" = "all" ]; then - echo "Building all services - discovering from workspace..." + # Handle special cases for service discovery + # "all" = all services + gateway + frontend + # "services-and-gateway" = all services + gateway (no frontend) - used when shared/ changes + if [ "$SERVICES_PARAM" = "all" ] || [ "$SERVICES_PARAM" = "services-and-gateway" ]; then + if [ "$SERVICES_PARAM" = "all" ]; then + echo "Building all services (including frontend) - discovering from workspace..." + else + echo "Building services and gateway (shared/ changed) - discovering from workspace..." + fi echo "Workspace contents:" ls -la "$WORKSPACE/" echo "Services directory contents:" @@ -115,8 +121,8 @@ spec: SERVICES="$SERVICES,gateway" fi fi - # Add frontend if it has Dockerfile.kubernetes - if [ -f "$WORKSPACE/frontend/Dockerfile.kubernetes" ]; then + # Add frontend ONLY for "all" (not for "services-and-gateway") + if [ "$SERVICES_PARAM" = "all" ] && [ -f "$WORKSPACE/frontend/Dockerfile.kubernetes" ]; then if [ -z "$SERVICES" ]; then SERVICES="frontend" else diff --git a/shared/database/base.py b/shared/database/base.py index 9d109187..58882240 100755 --- a/shared/database/base.py +++ b/shared/database/base.py @@ -1,5 +1,5 @@ """ -Test - Enhanced Base Database Configuration for All Microservices +Enhanced Base Database Configuration for All Microservices Provides DatabaseManager with connection pooling, health checks, and multi-database support Fixed: SSL configuration now uses connect_args instead of URL parameters to avoid asyncpg parameter parsing issues