Repository navigation
fix(cap): disable draft_admin_integrity under [development] profile (SQLite) - #2976
Merged
Merged
Conversation
…SQLite) cds.fiori.draft_admin_integrity: true requires DB-level ON DELETE CASCADE constraints on every draft table's DraftAdministrativeData_DraftUUID FK (generated as .hdbconstraint, HANA-only — see srv/lib/draft-integrity-preflight.js, which is explicitly isHanaKind-gated). Unit tests run under the `development` profile on in-memory SQLite, where those constraints do not exist. Without the cascade, activating a draft leaves the active row with HasDraftEntity=true and DELETE(IsActiveEntity=true) returns 403 DRAFT_ACTIVE_DELETE_FORBIDDEN_DRAFT_EXISTS. This is universal to every draft-enabled entity (reproduced on Missions as well as GridTemplates), not a per-test cleanup gap — the discard-then-delete band-aid in #2909 only passed where the delete sat in a swallowed afterAll. Scope the flag off under [development] only. hybrid (--profile hybrid) and production run on HANA and keep the flag ON, so the optimized-deletion behavior that #2909 depends on is unchanged in every environment that has the constraints. Fixes the puzzle-grid-templates unit failure introduced by the CAP 10.2 upgrade.
1 of 2 tasks
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
The CAP 10.2 upgrade (#2909, commits
76f2e3c64+b694d4565) turned oncds.fiori.draft_admin_integrity: trueunconditionally. That flag's optimized draft deletion requires DB-levelON DELETE CASCADEconstraints on each draft table'sDraftAdministrativeData_DraftUUIDFK — generated as.hdbconstraint, HANA-only (seesrv/lib/draft-integrity-preflight.js, which is explicitlyisHanaKind-gated).Unit tests run under the
developmentprofile on in-memory SQLite, where those constraints don't exist. Without the cascade,draftActivateleaves the active row withHasDraftEntity=true, andDELETE(IsActiveEntity=true)returns403 DRAFT_ACTIVE_DELETE_FORBIDDEN_DRAFT_EXISTS. That's what broketest/unit/puzzle-grid-templates.test.js.1fe4527c3) only "passed" where the delete sat in a swallowedafterAll; it can't actually clear the draft on SQLite because there's no cascade constraint to fire.Fix
Scope the flag off under
[development]only (one key inpackage.json).hybrid(--profile hybrid) and production run on HANA and keep it ON, so the optimized-deletion behavior #2909 relies on is unchanged everywhere the constraints actually exist.Test plan
test/unit/puzzle-grid-templates.test.jspasses (original Use new Draft Delete - cds.fiori.draft_admin_integrity: true in CAP #2909 test body, unmodified — fix is config-only)admin-drafts,admin-featured-candidatespassadmin-drafts-discard-reconcile,admin-service-reconcile,completion-reconcile,completion-reconcile-all,completion-rollup-emptyguard(DISCARD reconcile handlers are fail-open + additive)--profile hybrid; not run here — needscf login)