mikebridge opened a new pull request, #42888:
URL: https://github.com/apache/superset/pull/42888

   ### SUMMARY
   
   Replace the hard-coded soft-delete purge cascade with a declarative policy 
registry for charts, dashboards, and datasets.
   
   The registry classifies discovered dependencies as owned, association, 
preserved, blocked, version-owned, or listener-driven, then validates policy 
completeness before executing Core SQL deletes. It also makes persistent 
`after_delete` effects explicit through typed listener declarations and derives 
version-shadow cleanup from policy metadata.
   
   Key safeguards include:
   
   - a production-root tripwire requiring every scheduled `SoftDeleteMixin` 
model to have a purge policy
   - recursive owned/association traversal with deepest-first deletion
   - explicit blockers and preservation rules
   - runtime validation that supported-root deletion listeners are declared
   - SQLite, PostgreSQL, and MySQL statement compilation coverage
   - deterministic SQL-statement budgets and an opt-in fixed-cardinality timing 
protocol for all three roots
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Not applicable; this is a backend retention refactor with no UI changes.
   
   ### TESTING INSTRUCTIONS
   
   ```bash
   source ~/venv/superset-2/bin/activate
   pytest -q \
     tests/unit_tests/commands/deletion_retention/test_purge_policy.py \
     tests/integration_tests/deletion_retention/purge_tests.py \
     tests/integration_tests/deletion_retention/purge_performance_tests.py
   
   changed_files=(${(f)"$(git diff --name-only preset/master...HEAD)"})
   pre-commit run --files "${changed_files[@]}"
   ```
   
   Expected result: 60 passed, 1 opt-in timing benchmark skipped, and all 
applicable pre-commit hooks pass.
   
   To run the manual elapsed-time protocol, set `SUPERSET_PURGE_BENCHMARK=1` 
and supply the matching merge-base medians through:
   
   - `SUPERSET_PURGE_BASELINE_CHART_SECONDS`
   - `SUPERSET_PURGE_BASELINE_DASHBOARD_SECONDS`
   - `SUPERSET_PURGE_BASELINE_DATASET_SECONDS`
   
   ### ADDITIONAL INFORMATION
   
   - [x] Has associated issue: SC-115410
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to