From 7c8f3683b556c74a310e350e4c96bb472d5c3a81 Mon Sep 17 00:00:00 2001 From: Elie Gambache Date: Fri, 26 Jun 2026 08:05:22 +0300 Subject: [PATCH] ci(release): skip delta production when DB schema changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A delta patch carries only data (upserts/deletes), not schema migrations. When prev and new seforim.db have different table/index DDL, producing a patch fails or mismatches. Compare the schemas in the patch-fan step and skip that offset on any difference — clients on the affected version fall back to the full bundle (the manifest's native behavior when no covering delta exists). Keeps CI green across schema changes without adding any migration logic to the producer. --- .github/workflows/manual-generate-release.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/manual-generate-release.yml b/.github/workflows/manual-generate-release.yml index cec225c1..04c37ed7 100644 --- a/.github/workflows/manual-generate-release.yml +++ b/.github/workflows/manual-generate-release.yml @@ -204,6 +204,22 @@ jobs: PREV_DB=$(find prev-dbs/extract -name seforim.db -type f | head -n1) test -s "$PREV_DB" || { echo "::error::seforim.db not found in bundle of $TAG"; exit 1; } + # Skip the delta whenever the schema changed: a delta can only carry + # data (upserts/deletes), not schema migrations. If prev and new + # don't have identical table/index DDL, clients on $TARGET_VER must + # re-download the full bundle — so we don't produce (or fail CI on) + # a patch for this offset. + schema_of() { + sqlite3 "$1" \ + "SELECT sql FROM sqlite_master WHERE type IN ('table','index') AND sql IS NOT NULL ORDER BY name;" \ + | tr -s '[:space:]' ' ' + } + if [ "$(schema_of "$PREV_DB")" != "$(schema_of "$PWD/build/seforim.db")" ]; then + echo "::notice::Schema differs v${TARGET_VER} → v${THIS_VER} — skipping delta, clients fall back to full bundle" + rm -rf prev-dbs + continue + fi + ./gradlew :generator-common:producePatchAndVerify \ -PprevDb=$PWD/$PREV_DB \ -PnewDb=$PWD/build/seforim.db \