fix(ci): set DATABASE_TEST_URL + pin upload-artifact to v3 for Gitea Actions #150
Reference in New Issue
Block a user
Delete Branch "fix/ci-workflow-config"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Two CI-config issues unmasked by PR #149's lint/test fixes. Both are workflow-file changes only — no code touched.
1. Backend:
Connect call failed ('127.0.0.1', 5432)× 638backend/tests/conftest.py(afterdab740d's test-DB-isolation hardening) readsDATABASE_TEST_URLonly.DATABASE_URLis intentionally not consulted — the safety guard is there because runningpytestwithDATABASE_URLpointing at the dev/prod DB previously dropped the dev schema (real outage, see commitdab740d).The CI workflow only set
DATABASE_URL. Result: conftest fell back to itslocalhost:5432default, no postgres there from the runner's perspective, and every fixture-setup failed with the same connection error — 638 cascading errors visible in the latest main run onf27f671.Fix: explicitly set
DATABASE_TEST_URLto the postgres service container URL. Same connection string asDATABASE_URL(test DB is the app DB in CI) — conftest's"test" in db_namesafety assertion is satisfied byresolutionflow_test.2. Frontend:
upload-artifact@v4not supported on Gitea ActionsThe frontend lint job actually passes (
0 errors / 23 warningsafter PR #149). The job exits 1 because the next step uploads the build artifact viaactions/upload-artifact@v4, which the Gitea Actions runner rejects with:Pin both
upload-artifactanddownload-artifacttov3(the latest version Gitea Actions supports today). Same artifact format, same downstream e2e job.Expected CI state after this PR
CI / frontend (push)andCI / frontend (pull_request)— green (lint already passes; artifact step now works)CI / backend (push)andCI / backend (pull_request)— should match the local1018 passed / 54 failed / 4 errorsfrom PR #149's verification (down from 438/1/638 today)CI / backend (pull_request)to the required status checks on main.Test plan
🤖 Generated with Claude Code
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 <noreply@anthropic.com>261814a) in HANDOFF