CI: run migrations + integration slice against real Postgres; add ruff and pip-audit gates #65
Labels
No labels
area:ai
area:ci-cd
area:notifications
area:observability
area:public-pages
backlog
bug
duplicate
enhancement
help wanted
invalid
question
type:decision
type:feature
type:infra
type:maintenance
type:security
v1.0.1
v1.1.0
v1.2.0
v1.3.0
v2.0.0
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/WeatherBot#65
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
CI/CD test jobs run only
compileall+pyteston the aiosqlite suite(ci.yml:20-29, cd.yml:30-37). Nothing validates the Alembic chain or
Postgres-specific behavior before code reaches the dev server, and no
dependency-audit step exists. Add: a postgres:16-alpine service container;
alembic upgrade headagainst it (fresh DB — catches chain errors); thePostgres-tier tests from F-29 once they exist;
ruff check(start with apermissive rule set);
pip-audit(or Renovate's vulnerability alerts ifenabled instance-side). Keep the fast SQLite suite as the bulk tier.
Acceptance criteria:
Filed from the 2026-07-17 codebase audit (
docs/.internal/report-2026-07-17.md), finding F-26.Picking this up as part of v1.1.0 Phase 1 (with #68). Plan for
ci.yml: add apostgres:16-alpineservice, then steps for (1)ruff checkwith a permissive starter config, (2)alembic upgrade headagainst the fresh PG (catches migration-chain errors), (3) the SQLite bulk suite (pytest -q, which excludes the PG marker by default), (4) the Postgres integration tier (WEATHERBOT_TEST_DB=postgres pytest -m postgres), and (5)pip-audit. ruff/pip-audit added torequirements-test.txt.cd.ymlneeds no PG service since itspytestrun excludes the marker by default. pip-audit gating will be verified against the current lockfile first so it doesn't wedge CI on an unfixable transitive advisory.Done in #94 (merged to
main). CI now runs ruff (permissive starter: E9/F63/F7),alembic upgrade headagainst a fresh Postgres (catches migration-chain errors), the SQLite bulk tier, and the Postgres integration tier.Two implementation notes worth recording:
docker run, notservices:— the act_runner didn't provide a reachable service container (the first run hung on the service health-wait). CI now starts Postgres withdocker runinside the job (attaching it to the job's docker network when containerized, else publishing to the host) and auto-detects the working host in a bounded readiness probe. Added a 20-minute job timeout so no step can wedge the shared runner again.--strictfails on a backlog of advisories in the pinned stack (starlette, pyjwt, python-multipart, python-dotenv, setuptools) that the pending Renovate upgrades (#30–#37) clear. It's a one-line change (dropcontinue-on-error, add--strict) once that backlog lands.cd.ymlis unchanged — itspytestrun excludes the postgres marker by default.