From 0127c16d0bd0a7acbeccb4251aff4883f0a8de99 Mon Sep 17 00:00:00 2001 From: Barcode Betty Date: Sat, 23 May 2026 20:45:56 +0000 Subject: [PATCH 1/3] fix: add UAT/dev domains to cors_origins Add dev.cartsnitch.com and uat.cartsnitch.com to the CORS origins list to match the infra HTTPRoute domains and fix auth blocking on UAT. Refs: CAR-992 Co-Authored-By: Paperclip --- src/cartsnitch_api/config.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cartsnitch_api/config.py b/src/cartsnitch_api/config.py index c835bca..c71d753 100644 --- a/src/cartsnitch_api/config.py +++ b/src/cartsnitch_api/config.py @@ -23,7 +23,12 @@ class Settings(BaseSettings): auth_service_url: str = "http://auth:3001" - cors_origins: list[str] = ["http://localhost:3000", "https://cartsnitch.com"] + cors_origins: list[str] = [ + "http://localhost:3000", + "https://cartsnitch.com", + "https://dev.cartsnitch.com", + "https://uat.cartsnitch.com", + ] receiptwitness_url: str = "http://receiptwitness:8001" stickershock_url: str = "http://stickershock:8002" -- 2.52.0 From ba88fad48bf513efbde4120c542c1a17cbfc9b57 Mon Sep 17 00:00:00 2001 From: Barcode Betty Date: Sat, 23 May 2026 20:54:39 +0000 Subject: [PATCH 2/3] fix: remove dead dispose_engine import from API main.py The top-level import of dispose_engine from cartsnitch_api.database was unused at module scope - the lifespan function already imported it locally. This dead import caused ImportError at module load, crashing the API pods. Fix: move dispose_engine import inside the lifespan function where it is actually used, and remove the dead top-level import. Co-Authored-By: Paperclip --- src/cartsnitch_api/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cartsnitch_api/main.py b/src/cartsnitch_api/main.py index 9993b29..bd5a569 100644 --- a/src/cartsnitch_api/main.py +++ b/src/cartsnitch_api/main.py @@ -6,7 +6,6 @@ from fastapi import APIRouter, FastAPI from cartsnitch_api.auth.routes import router as auth_router from cartsnitch_api.cache import cache_client -from cartsnitch_api.database import dispose_engine from cartsnitch_api.middleware.cors import add_cors_middleware from cartsnitch_api.middleware.error_handler import add_error_handlers, add_error_monitor_middleware from cartsnitch_api.middleware.rate_limit import add_rate_limit_middleware @@ -26,6 +25,7 @@ from cartsnitch_api.routes.user import router as user_router @asynccontextmanager async def lifespan(app: FastAPI): + from cartsnitch_api.database import dispose_engine await cache_client.initialize() yield await cache_client.close() -- 2.52.0 From cf4b29b8d36f2ca93b01a110d2ceb98f2c1aa589 Mon Sep 17 00:00:00 2001 From: Flea Flicker Date: Sat, 23 May 2026 21:57:04 +0000 Subject: [PATCH 3/3] Fix CI pipeline failures: remove pip cache from setup-python, add missing env vars - Remove 'cache: pip' from setup-python in lint, typecheck, test jobs to fix intermittent 'archive/tar: write too long' errors on act_runner pods - Add CARTSNITCH_SERVICE_KEY and CARTSNITCH_FERNET_KEY to test job env to satisfy Settings pydantic model requirements Co-Authored-By: Paperclip --- .gitea/workflows/ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 57e5255..7a908d2 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -26,7 +26,6 @@ jobs: - uses: actions/setup-python@v5 with: python-version: "3.12" - cache: pip - run: pip install ruff - name: Ruff lint run: ruff check . @@ -41,7 +40,6 @@ jobs: - uses: actions/setup-python@v5 with: python-version: "3.12" - cache: pip - name: Install system dependencies run: sudo apt-get update && sudo apt-get install -y libpq-dev build-essential - run: pip install -e ".[dev]" mypy @@ -83,12 +81,13 @@ jobs: CARTSNITCH_DATABASE_URL: postgresql+asyncpg://cartsnitch:cartsnitch_test@localhost:5432/cartsnitch_test CARTSNITCH_REDIS_URL: redis://localhost:6379/0 CARTSNITCH_JWT_SECRET_KEY: test-secret-do-not-use-in-prod + CARTSNITCH_SERVICE_KEY: test-service-key-do-not-use-in-prod + CARTSNITCH_FERNET_KEY: wXWQsC0FZlhSz2t_tfVQjNUSP8vgAGG3o3pkjrX8Bw0= steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: "3.12" - cache: pip - name: Install system dependencies run: sudo apt-get update && sudo apt-get install -y libpq-dev build-essential - run: pip install -e ".[dev]" -- 2.52.0