Skip to content

Re-enable draft_admin_integrity only after deploying real ADMINSERVICE_*_DRAFTS cascade constraints #2993

Open

Description

@jung-thomas

Context

#2909 enabled CAP 10.2 cds.fiori.draft_admin_integrity: true to get optimized (DB-level cascade) draft deletion. But the required ON DELETE CASCADE .hdbconstraint files were never generated or deployed, so the flag ran with no supporting DB structure and corrupted drafts — every mission draft activate/discard orphaned child draft rows, making missions un-editable in PROD (2026-11-02 outage).

#2992 (merged to DEV) disabled the flag for all profiles and fixed the preflight check (which had been validating non-existent com_sap_developers_ims_*_drafts table names instead of the real ADMINSERVICE_*_DRAFTS). That stops the bleeding but does not deliver the #2909 optimization.

What this issue tracks

Re-enabling draft_admin_integrity correctly, if we still want the cascade benefit. Required before the flag can be turned back on:

  1. Generate the real cascade constraints. Confirm how cds build emits the ON DELETE CASCADE FK on each ADMINSERVICE_<ENTITY>_DRAFTS.DRAFTADMINISTRATIVEDATA_DRAFTUUID → DRAFT_DRAFTADMINISTRATIVEDATA(DRAFTUUID). If the build does not emit them for HANA, author the .hdbconstraint artifacts explicitly (NOT VALIDATED first, per the deploy-before-serve ordering in CLAUDE.md gotcha "Optimized draft deletion").
  2. Deploy constraints to HANA BEFORE flipping the flag (DEV → prod), on all *_DRAFTS tables that carry the FK column.
  3. Verify via the now-fixed preflight — srv/lib/draft-integrity-preflight.js discovers draft tables from SYS.TABLE_COLUMNS and reports found/total. It must log verified (N/N) (not a WARN) on the target env.
  4. Then set cds.fiori.draft_admin_integrity: true again (package.json) and redeploy.
  5. Add a smoke/integration check that draftEdit→discard on a Mission leaves zero orphaned child draft rows.

Guardrails

  • Do NOT re-enable the flag until steps 1–3 are green on the target environment.
  • The runtime CDS_* env override does NOT work on the deployed build (verified during the outage) — the flag state is whatever is baked into package.json at build time.

Related: #2909 (introduced), #2968 (preflight), #2992 (disable + preflight fix).

Activity

  1. added 3 commits that reference this issue on Nov 2, 2026
  2. jung-thomas commented on Nov 3, 2026

    @jung-thomas
    ContributorAuthor

    Update (2026-11-02): the build-time cascade-constraint patch was reverted in #3003 because it blocked every MTA deploy and isn't needed while draft_admin_integrity is off.

    Findings for whoever picks up the dad-strategy re-enable:

    1. Inline FK in .hdbtable → HDI error 8250014 "this artifact type must not have references to other objects". Not allowed.
    2. Standalone .hdbconstraint (format confirmed from SAP-samples hana-shine-xsa): got past 8250014, but on a delta deploy to an existing container → HDI error 8212001 "the file requires db://AdminService_X_drafts which is not provided by any file" + 8212012 "Could not compose a consistent make graph." The ON "<table>" clause makes HDI require the base .hdbtable in the same make set, which a delta deploy (unchanged tables not re-provided) doesn't satisfy.
    3. Verified empirically: DRAFT_DRAFTADMINISTRATIVEDATA does exist in the HDI container schema (same schema as the draft tables, PK DRAFTUUID) — so the referenced table resolves; the blocker is the base-table make-graph dependency, not the FK target.
    4. Confirmed CAP 10.2.2 / cds-dk 10.2.0 does not emit the cascade FK in the generated .hdbtable even with draft_admin_integrity: true — so a hand-rolled artifact (or a CAP upgrade/config that generates+manages it) is required.

    Next step before re-enabling: solve the HDI make-graph co-deploy (force the base .hdbtables into the make set with the constraints, or find the CAP-native mechanism). The flag must stay OFF until a full deploy to a real HANA container succeeds. Orphan cleanup meanwhile: scripts/cleanup-draft-orphans.cjs --commit (#2994).

  3. added 2 commits that reference this issue on Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions