fix: canonical schema.sql + integration test integrity#191
Merged
Conversation
schema.sql claimed to be canonical but had drifted from the migration chain that CI and production actually apply: - add missing tables audit_log (0006) and parse_errors (0008) - add system_state health columns (0002) and alert columns (0003) - replace the legacy soroban_events index set with the canonical 0004/0009 indexes (network, network_contract, contract_ledger, contract_topic0 partial, id_desc, ledger_timestamp) - drop uq_soroban_events_tx_index, which no migration defines Tables, columns and indexes now match the migration end-state exactly.
…g test services The rust-integration job built trident_test from database/schema.sql, so any drift in that mirror silently reduced integration coverage. Apply the real migration chain instead — the same artifact the rust job and production apply — validating it as an ordered, idempotent chain. Also arm REQUIRE_TEST_SERVICES in that job so require_services! panics instead of silently returning when TEST_DATABASE_URL/TEST_REDIS_URL are absent. A misconfigured integration job can no longer report green without actually exercising the DB/Redis tests. Local dev still skips.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Hardening fixes cut cleanly against
main. Full findings in REPORT.md.fix(db): schema.sql is now a faithful mirror of migrations 0001-0009
database/schema.sqlclaimed canonical but had drifted from the migration chain that CI and production apply. Onmaina DB bootstrapped from it is missing audit logging, parse-error isolation, and indexer health/alert state:uq_soroban_events_tx_index, which no migration definesVerified: tables, columns and indexes now match the migration end-state exactly.
fix(ci): validate integration DB from migrations + fail loud on missing test services
rust-integrationbuildstrident_testfrom the migration chain instead of the (drift-prone) schema.sql mirror — the same artifact therustjob and production apply.REQUIRE_TEST_SERVICESmakesrequire_services!panic instead of silentlyreturn-ing whenTEST_DATABASE_URL/TEST_REDIS_URLare absent. A misconfigured integration job can no longer report green without exercising the DB/Redis tests. Local dev still skips.Verification
cargo fmt --check,cargo clippy --all-targets -- -D warnings, structural schema-equality check all green.rust-integrationon this PR now builds from migrations and runs the DB/Redis tests with the fail-loud gate armed.