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

   ### SUMMARY
   
   Adds a **temporary** rollout / kill-switch feature flag — `SOFT_DELETE` 
(default **off**) — so the soft-delete substrate can ship **dark** and be 
activated per-deploy once validated, separating deploy from release for a 
behavior change with cross-entity blast radius (DELETE semantics + read-path 
visibility filtering).
   
   This is **deployment scaffolding, not a permanent toggle**: it is removed 
once soft delete is stable, leaving the unconditional "always active once 
deployed" end state. Until an operator opts in, existing deployments retain 
byte-for-byte legacy `DELETE` (hard-delete) behavior.
   
   **Two gate points**, both no-op to legacy behavior when off:
   - `BaseDAO.delete()` routes to `soft_delete()` only when the flag is on; 
otherwise `hard_delete()`.
   - The `do_orm_execute` visibility listener attaches no `deleted_at IS NULL` 
criteria when off.
   
   Both the write path and the read path gate on the **same flag**, so they 
cannot diverge. Restore needs no explicit gate — with the flag off no row 
carries `deleted_at`, so a restore call has nothing to act on. The flag 
docstring documents the kill-switch semantics (flipping **off after** rows are 
soft-deleted resurrects them — emergency stop, not a clean rollback) and that 
the import pipeline's existing-row detection is gated transitively via the 
listener.
   
   The `deleted_at` migration (from the substrate PRs) stays **un-gated** 
(additive). Removal of this flag + its two gate points is a small follow-up 
once soaked.
   
   ### TESTING INSTRUCTIONS
   
   Unit tests cover both flag states (default-off and on):
   
   ```
   pytest tests/unit_tests/daos/test_base_dao_soft_delete.py \
          tests/unit_tests/models/test_soft_delete_mixin.py
   ```
   
   - With `FEATURE_FLAGS = {"SOFT_DELETE": False}` (default): a `DELETE` on a 
`SoftDeleteMixin` model hard-deletes, and the read-path listener does not hide 
soft-deleted rows.
   - With `SOFT_DELETE` on: `DELETE` soft-deletes and the listener filters 
soft-deleted rows out of reads (existing substrate behavior).
   
   ### ADDITIONAL INFORMATION
   
   - [x] Required feature flags: **`SOFT_DELETE`** (default off; temporary 
rollout/kill-switch — to be removed after stabilization)
   - [ ] Has associated issue:
   - [ ] Changes UI
   - [ ] Includes DB Migration
   - [ ] 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