Fixing a pgvector CI mismatch in a FastAPI RAG backend
This is a submission for DEV's Summer Bug Smash: Clear the Lineup , powered by Sentry . Project Overview mini-agent is a public FastAPI backend for an AI support-agent demo. Its test suite covers API behavior, authentication, rate limiting, approval flows, and PostgreSQL/pgvector-backed retrieval. The GitHub Actions workflow starts PostgreSQL and Redis service containers before running the Python…
The GitHub Actions workflow for a FastAPI RAG backend named mini-agent encountered a failure during testing on August 12, 2026. The test environment lacked the pgvector extension required by the application due to the use of the general-purpose postgres:17-alpine service image. The failure was traced back to the database initialization step, which did not provision the necessary extension.
To resolve the issue, the CI workflow was updated to use the pgvector/pgvector:0.8.6-pg17 image alongside the postgres container. The change was minimal, adding only one line to the services section of the workflow. The PostgreSQL image version, credentials, port mapping, health check, application environment, dependency installation, and test command remained unchanged. This approach ensured the CI environment matched the application's database requirements.
The patch was straightforward, with no alterations to the application's core functionality. It restored the full CI test run, maintaining compatibility between the PostgreSQL service and the pgvector-backed model. The change did not affect PostgreSQL's major version, credentials, port mapping, health check, application environment, dependency installation, or test command.
Implementing this fix restored the CI's reliability, ensuring tests accurately reflect the application's behavior in a production-like environment. By treating database extensions as explicit runtime dependencies, the approach prevents issues arising from missing or incompatible extensions during CI runs. This method aligns with best practices, promoting a robust integration testing environment that accurately simulates the application's runtime dependencies.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.