From 8f7df2c0ef814d22a7c225733507e3fb631f9daa Mon Sep 17 00:00:00 2001 From: Michael Chihlas Date: Sat, 25 Apr 2026 03:28:54 -0400 Subject: [PATCH] fix(ci): set DATABASE_TEST_URL + downgrade upload-artifact to v3 (Gitea Actions) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two CI-config issues blocking the gate from going green: 1. **Backend tests connect to localhost instead of postgres service.** conftest.py reads DATABASE_TEST_URL only — DATABASE_URL is intentionally not consulted (per dab740d's test-DB-isolation hardening — running pytest with DATABASE_URL set previously dropped the dev DB schema). The CI workflow only sets DATABASE_URL, so conftest falls back to its localhost default and every fixture-setup fails with `OSError: Connect call failed ('127.0.0.1', 5432)` — observed as 638 errors on the latest main run. Add DATABASE_TEST_URL pointing at the postgres service container. Same connection string as DATABASE_URL — the test DB and the app DB are the same physical postgres in CI; conftest's safety assertion is satisfied by the URL containing "test". 2. **Frontend artifact upload fails on Gitea Actions runner.** actions/upload-artifact@v4 (and v5) are not supported on Gitea Actions / GHES — the runner returns `GHESNotSupportedError: ... not currently supported on GHES`. Lint itself is now passing (0 errors after PR #149); the job exits 1 only because the upload step then fails. Pin upload-artifact + download-artifact to v3, the latest version compatible with Gitea Actions until they ship v4 support. After this lands, both backend and frontend CI gates should turn green — at which point we can also add backend to the required status checks on main. Co-Authored-By: Claude Opus 4.7 --- .gitea/workflows/ci.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 3fe3e2f8..cc471ba3 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -28,6 +28,12 @@ jobs: env: DATABASE_URL: postgresql+asyncpg://postgres:postgres@postgres:5432/resolutionflow_test DATABASE_URL_SYNC: postgresql://postgres:postgres@postgres:5432/resolutionflow_test + # conftest.py reads DATABASE_TEST_URL only (DATABASE_URL is intentionally + # not consulted after the dab740d test-isolation hardening). The CI test + # DB is the same postgres service, so point DATABASE_TEST_URL at it + # explicitly — without this, conftest falls back to localhost:5432 and + # all tests fail at fixture setup with "connection refused". + DATABASE_TEST_URL: postgresql+asyncpg://postgres:postgres@postgres:5432/resolutionflow_test SECRET_KEY: ci-test-secret-key-not-for-production DEBUG: "true" APP_NAME: ResolutionFlow @@ -88,7 +94,7 @@ jobs: run: cd frontend && NODE_OPTIONS="--max-old-space-size=4096" npm run build - name: Upload build artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: frontend-dist path: frontend/dist @@ -132,7 +138,7 @@ jobs: run: cd frontend && npm ci - name: Download frontend build - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v3 with: name: frontend-dist path: frontend/dist @@ -145,7 +151,7 @@ jobs: - name: Upload Playwright report if: always() - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: playwright-report path: |