Repository navigation
#2993: re-enable draft_admin_integrity via native NOT VALIDATED cascade constraints - #3136
Merged
Merged
Conversation
- Bump .deploy/mta.yaml 1.44.2 -> 1.44.3 (patch; deploy source of truth per deploy-mta.cjs). Headline: external-content journaling fix (#3130/#3132) -- schema changes to the 17 external-content tables now actually deploy (hdbtable->hdbmigrationtable adopt-in-place, verified zero data loss on DEV). Also carries #3131 docs (close #2810 as foundation). Promotes origin/DEV (8e5283c) to main. Data-loss audit on DEV: 0 row-count mismatches across 18 external tables, 0 invalid views/procs.
release 1.44.3: external-content journaling fix (#3130) — isolated PROD promotion
Approved design: deliver CAP's native NOT VALIDATED draft cascade constraints through the hdbmigrationtable build, re-enable draft_admin_integrity + draft_orphan_cleanup + deleteStrategy:dad, with a dad handler-firing audit + HANA-level reconcile test. Spike findings: constraints are CAP-native (46, NOT VALIDATED), the real blocker was the to.hana/hdbmigrationtable build path (not HDI make-graph or hand-authoring).
…ntable build Pin @sap/cds-compiler to 7.2.1 via package.json overrides. The project's hoisted @sap/cds-compiler was stuck at 7.0.1 (lockfile dedup artifact), which predates createDraftAdminDataConstraints; so cds build --production emitted 0 draft cascade constraints even with draft_admin_integrity on. Compiler 7.2.1 (bundled under cds-dk, now pinned at root) emits all 46 *_drafts_DraftAdministrativeData.hdbconstraint files (ON DELETE CASCADE, NOT VALIDATED). draft_admin_integrity stays OFF in both fiori blocks; the runtime flip is a later task.
Save/restore process.env.CDS_ENV around cds.load + compiler.to.hdi in a finally block so the production-profile flag does not leak into co-running unit tests that share the same vitest worker process.
…tegy Flips the three CAP 10.2 Optimized Draft Deletion flags in both base and [development] profiles: - cds.fiori.draft_admin_integrity: true (emits 46 NOT VALIDATED draft cascade constraints at build time; requires the 7.2.1 compiler pin) - cds.fiori.draft_orphan_cleanup: true (background orphan sweep) - cds.drafts.deleteStrategy: dad (single-cascade draft deletion) Generation of the cascade constraints is gated on draft_admin_integrity being true, so constraints + runtime behavior ship together in one build. Verified: production build emits 46/46 NOT VALIDATED constraints. DEV HANA deploy + preflight + dad hook audit pending (Tasks 3-6).
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.
What & why
Re-enables CAP 10.2 Optimized Draft Deletion correctly, closing the #2909 gap (flag was enabled without the DB cascade, orphaning drafts → 2026-11-02 PROD outage).
Root cause (the real one)
Prior re-enable attempts failed not on HDI make-graph (as #3003/#2993 notes assumed) but because the project root deduped
@sap/cds-compilerto 7.0.1 (no draft-constraint code) while cds-dk bundles 7.2.1 (hascreateDraftAdminDataConstraints). Fixed by a one-linepackage.jsonoverrides pin to 7.2.1.Changes
434e401pin@sap/cds-compiler7.2.1 (overrides + lockfile) — the fixfcf75c4/1830251regression test asserting 46NOT VALIDATED ON DELETE CASCADEdraft constraints emit6a2a17eenabledraft_admin_integrity+draft_orphan_cleanup+deleteStrategy: dad(both profiles)5a188fd/fcba7ffrewrite re-enable runbook + correct CLAUDE.md gotcha to the real root causedocs/superpowers/Key facts
NOT VALIDATED→ pre-existing orphans do NOT block deploy (no pre-sweep gate). Independent ofassert_integrity.draft_admin_integrity: true, so constraints + runtime behavior ship in one build (welded — can't get the flag without the constraints).Verified
cds build --productionemits 46/46NOT VALIDATEDdraft cascade constraints (post-7.2.1-install).Pending on DEV (this PR's verification gate — NOT yet done)
NOT VALIDATEDverified (46/46)after('DISCARD')/after('DELETE')reconcile hooks still fire underdad(HANA-level)Runbook:
docs/developers/operations/draft-integrity-reenable.md