Skip to content

fix(cap): disable draft_admin_integrity under [development] profile (SQLite) - #2976

Merged
jung-thomas merged 1 commit into
DEVfrom
worktree-fix-gridtemplates-draft-delete-flake
Nov 2, 2026
Merged

jung-thomas merged 1 commit into
DEVfrom
worktree-fix-gridtemplates-draft-delete-flake

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

Summary

The CAP 10.2 upgrade (#2909, commits 76f2e3c64 + b694d4565) turned on cds.fiori.draft_admin_integrity: true unconditionally. That flag's optimized draft deletion requires DB-level ON DELETE CASCADE constraints on each 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 don't exist. Without the cascade, draftActivate leaves the active row with HasDraftEntity=true, and DELETE(IsActiveEntity=true) returns 403 DRAFT_ACTIVE_DELETE_FORBIDDEN_DRAFT_EXISTS. That's what broke test/unit/puzzle-grid-templates.test.js.

  • Reproduced deterministically (not a flake) and confirmed universal — Missions 403s the same way, so this is not a per-test cleanup gap.
  • The discard-then-delete patch in Use new Draft Delete - cds.fiori.draft_admin_integrity: true in CAP #2909 (1fe4527c3) only "passed" where the delete sat in a swallowed afterAll; 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 in package.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.js passes (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-candidates pass
  • Flag-dependent reconcile/rollup suites pass with flag off: admin-drafts-discard-reconcile, admin-service-reconcile, completion-reconcile, completion-reconcile-all, completion-rollup-emptyguard (DISCARD reconcile handlers are fail-open + additive)
  • Full unit suite — CI gate (local full-suite run is hook-blocked by design)
  • hybrid unaffected (flag stays ON under --profile hybrid; not run here — needs cf login)

…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.
@jung-thomas
jung-thomas merged commit 392710e into DEV Nov 2, 2026
5 of 6 checks passed
@jung-thomas
jung-thomas deleted the worktree-fix-gridtemplates-draft-delete-flake branch November 2, 2026 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant