fix(deploy): distinguish core migration drift
CI / Rust Checks (push) Successful in 12m35s
CI / UI Checks (push) Successful in 6s
CI / Community Image Smoke (push) Successful in 6m14s
CI / Frontend E2E (push) Successful in 7m6s
CI / Deploy (push) Failing after 40s

This commit is contained in:
2026-09-01 20:30:09 +03:00
parent 66b9bfd875
commit 527efb510f
3 changed files with 22 additions and 3 deletions
@@ -410,7 +410,7 @@ async fn inspect(connection: &mut PgConnection) -> Result<MigrationPreflight, Mi
if owned_exists {
return Err(MigrationError::new(
"partial_sequence",
"preflight.core",
"preflight.core_missing",
None,
"restore_known_good_backup",
));
@@ -549,7 +549,7 @@ async fn validate_core_ledger(connection: &mut PgConnection) -> Result<(), Migra
if rows.len() != 1 {
return Err(MigrationError::new(
"partial_sequence",
"preflight.core",
"preflight.core_cardinality",
None,
"restore_known_good_backup",
));
@@ -937,6 +937,20 @@ async fn any_owned_relation_without_core_ledger_is_partial() {
.unwrap();
let error = MigrationAuthority::preflight(&pool).await.unwrap_err();
assert_eq!(error.code(), "partial_sequence");
assert_eq!(error.stage(), "preflight.core_missing");
}
#[tokio::test]
async fn empty_core_ledger_is_reported_separately() {
let database_url = crank_test_support::postgres_schema_url("test_empty_core_ledger").await;
let pool = sqlx::PgPool::connect(&database_url).await.unwrap();
MigrationAuthority::apply(&pool).await.unwrap();
sqlx::query("delete from __crank_core_migrations")
.execute(&pool)
.await
.unwrap();
let error = MigrationAuthority::preflight(&pool).await.unwrap_err();
assert_eq!(error.code(), "partial_sequence");
assert_eq!(error.stage(), "preflight.core_cardinality");
}
#[tokio::test]
async fn current_ledger_with_structural_drift_fails_closed() {