DEV Community
Follow
Fixing a pgvector CI mismatch in a FastAPI RAG backend
The mini-agent project, a FastAPI backend for an AI support agent demo, experienced a CI failure. This failure occurred because the test suite relied on the pgvector extension for PostgreSQL. The GitHub Actions workflow was mistakenly using a general-purpose PostgreSQL image that did not include this essential extension. Consequently, the database initialization step failed when attempting to create the vector extension. This mismatch between the test environment and application requirements caused the workflow to halt at the test execution phase. The fix involved changing the PostgreSQL service image in the GitHub Actions configuration. The updated image, pgvector/pgvector:0.8.6-pg17, specifically includes the required pgvector extension. This single-line change ensured that the database service in CI now matched the application's capabilities. Following this modification, the CI workflow completed successfully, restoring reliable integration testing. The lesson learned emphasizes treating database extensions as explicit runtime dependencies for CI.