Skip to content

test: verify schema integrity and PostgreSQL transactions in CI - #155

Open
DoRmAmMu1997 wants to merge 10 commits into
codex/scanner-ipo-scoring-statefrom
codex/scanner-database-verification
Open

DoRmAmMu1997 wants to merge 10 commits into
codex/scanner-ipo-scoring-statefrom
codex/scanner-database-verification

Conversation

@DoRmAmMu1997

@DoRmAmMu1997 DoRmAmMu1997 commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

Migration checks previously compared too little of the schema, and deployment smoke only proved the web process started. This adds semantic migration/ORM comparison, populated upgrade and repository smoke tests, and mandatory disposable PostgreSQL verification in each Python CI job and the final container image.

Stacked on #150 (codex/scanner-ipo-scoring-state) so the migration and transaction checks include IPO-013. The schema-changing chain remains VALID-005 → IPO-013 → the separate forthcoming IPO-014 package. This PR adds no ORM fields or migration revision and does not rewrite application history.

  • Compare defaults, checks, uniqueness, primary keys, complete reflected indexes and foreign keys. SQLite PRAGMAs retain index collations/directions and FK actions omitted by generic reflection; unsupported expression-index reflection fails closed.
  • Provision only UUID-named PostgreSQL databases through an explicit test-server setting. Refuse database-routing query overrides before connecting, preserve TLS settings, sanitize errors, and clean up owned databases even when connection cleanup fails after CREATE.
  • Verify upgrades preserve seeded IDs, Decimal prices and JSON, then exercise committed repository operations, rollback, uniqueness and database cascade. Final-image smoke also reads curated CSVs with relocated DATA_DIR.
  • Add real-session PostgreSQL tests for identical concurrent IPO publication, stale calculation retry, and caller rollback. No network providers or production databases are used.

Independent review closed the SQLite collation and PostgreSQL URL-override findings after demonstrated regressions. Google-style contracts, Beginner notes, inline transaction/safety explanations and test-intent documentation are included.

Validation at 17b86250 with current main 9ded279 dependency pins: 2,388 passed, seven skipped; 90.58% coverage including app.py, using twelve commit-locked restartable Python 3.12 groups. Pre-commit configuration, compileall, Ruff, full mypy, Bandit, dependency audit and diff checks passed. Fresh focused schema/migration/smoke/concurrency checks passed 48 tests with five local PostgreSQL skips on each of Python 3.13 and 3.14.

Hosted run 39584096696 executed 2,393 tests with two platform skips on each supported Python, including required PostgreSQL tests; the final-image Docker/Compose smoke passed. The quality jobs later failed the dependency audit: Pillow 12.3.0 now has eight reported advisories whose listed fix is 13.0.0. This is an unresolved shared dependency gate, not a PostgreSQL test failure. No local skip is treated as hosted execution evidence.

As verified on October 21, latest stable Streamlit 1.66.0 requires Pillow below 13. The official Pillow 13 compatibility change has merged upstream but is not in a stable release yet. No audit suppression, conflicting dependency override or unreleased framework substitution has been applied. Current full security-gate closure remains blocked pending a supported compatible release and re-verification.

The initial workflow validation failure was corrected by placing runner.temp at test-step scope, where GitHub exposes the runner context; the policy regression first failed and then passed. The workflow now starts and completes its required tests. Local Docker/PostgreSQL remain unavailable, so hosted results are the corresponding evidence. No merge or deployment is included.

Co-authored-by: Codex codex@openai.com

DoRmAmMu1997 and others added 7 commits September 28, 2026 16:47
Compare database enforcement contracts and prove drift sensitivity. Exercise
seeded history upgrades and repository transactions against private databases,
and require PostgreSQL plus final-image storage smoke in CI.

Co-authored-by: Codex <codex@openai.com>
Preserve forward-return migration coverage, align PostgreSQL18 service with Compose, and use runner-private SQLite for separate Alembic/session engines.

Co-authored-by: Codex <codex@openai.com>
Preserve the merged BSE transcript and agent-result compatibility fix fromPR147.

Co-authored-by: Codex <codex@openai.com>
…atabases

Keep URL and engine configuration failures secret-safe; record successful CREATE before connection cleanup can fail.

Co-authored-by: Codex <codex@openai.com>
Compose migration and repository verification with IPO-013 and the current dependency pins before PostgreSQL integration checks.

Co-authored-by: Codex <codex@openai.com>
Compare SQLite index collations and ordering, including implicit constraint indexes. Reject PostgreSQL query database overrides before provisioning. Add real PostgreSQL IPO concurrency and rollback scenarios, and document helper contracts and verification limits.

Co-authored-by: Codex <codex@openai.com>
DoRmAmMu1997 and others added 2 commits October 13, 2026 18:33
GitHub evaluates job-level environment before the runner context exists. Keep the private file database on the test step and guard its supported context in the workflow policy regression.

Co-authored-by: Codex <codex@openai.com>
Keep PostgreSQL verification stacked on the current reviewed IPO-013 implementation and main999d283 for fresh checks.

Co-authored-by: Codex <codex@openai.com>
Reconcile the reviewed package with main 9ded279 and its current dependency pins. Fresh verification follows this merge.

Co-authored-by: Codex <codex@openai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant