Repository navigation
feat(cap): adopt draft_admin_integrity (optimized draft deletion) #2909 - #2967
Merged
Merged
Conversation
…dmin_integrity)
With cds.fiori.draft_admin_integrity on, discarding a Mission/Group draft
cascade-deletes its draft CompletionPathItems/GroupPathItems at the DB level,
bypassing the per-row after('DELETE') reconcile hooks. Adds root
after('DISCARD', '<Entity>.drafts') handlers that fire reconcile for the active
entity's legacyId, restoring rollup correctness. The existing child DELETE
handlers stay (they still fire for direct programmatic deletes).
Also updates admin-drafts.test.js cleanup: under the flag, deleting an active
entity immediately after draftActivate hits "a draft exists" (403) on SQLite
until the residual draft is discarded first.
This was referenced Nov 1, 2026
Closed
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.
Closes #2909
Summary
cds.fiori.draft_admin_integrity: true— CAP 10.2 optimized draft deletion.cds buildgeneratesON DELETE CASCADEconstraints on each draft table'sDraftAdministrativeData_DraftUUIDFK; draft activation/root-cancel delete only the admin record and the DB cascades the child draft rows.after('DISCARD', 'Missions.drafts'|'Groups.drafts')reconcile handlers inAdminService. Under the flag, discarding a draft cascade-deletes childCompletionPathItems/GroupPathItemsat the DB level, bypassing the per-rowafter('DELETE')reconcile. These DISCARD handlers re-firereconcileEntityForUsersfor the active entity's legacyId, restoring Mission/Group rollup correctness. The existing child DELETE handlers stay — they still fire for direct programmatic deletes the cascade doesn't touch.test/admin-drafts-discard-reconcile.test.js: DISCARD-reconcile for Missions + Groups (incl. nesting missions), empty-draft no-op, fail-open.Behavior change surfaced (documented)
Under the flag, deleting an active entity immediately after
draftActivatecan return403 — a draft exists(seen on SQLite) until the residual draft is discarded first. Updatedadmin-drafts.test.jscleanup accordingly. This is the documented CAP 10.2 change, not a bug; normal Fiori UX doesn't delete-active-right-after-activate.The flag is committed ON, so the next deploy to any env serves with it on. Land the generated HANA cascade constraints (
.hdbconstraint,NOT VALIDATED) BEFORE the flag serves in that env — if the runtime serves flag-on before the constraints exist, the DB won't cascade and orphaned draft rows accumulate (draft-table cruft, not active-content data loss). Follow the runbook's DEV → test → PROD ordering; confirm scope with the maintainer. The actual PROD rollout is a separate authorized deploy.Test plan
test/admin-drafts-discard-reconcile.test.js(new) — 3/3test/admin-drafts.test.js+admin-service-reconcile.test.js— no regression (12/12 total, SQLite)npm run static-guards— 17/17