Repository navigation
feat(soft-delete): enable soft delete by default and purge for real - #42800
Merged
eschutho merged 3 commits intoAug 6, 2026
Merged
Conversation
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
1 of 6 tasks
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #42800 +/- ##
=======================================
Coverage 65.73% 65.73%
=======================================
Files 2843 2843
Lines 162659 162659
Branches 37239 37239
=======================================
+ Hits 106921 106924 +3
+ Misses 53645 53642 -3
Partials 2093 2093
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
mikebridge
force-pushed
the
sc-111918-flip-soft-delete-defaults
branch
from
August 5, 2026 20:53
3f0e665 to
284e6fa
Compare
mikebridge
pushed a commit
to mikebridge/superset
that referenced
this pull request
Aug 5, 2026
Flips the two versioning release defaults for general availability
(sc-111918 stage 2b, FR-001/002/008):
VERSION_HISTORY False -> True
ENABLE_VERSIONING_CAPTURE false -> true (env-var default)
Every save of a chart, dashboard, or dataset now writes version rows, and
the history panel appears on Explore and Dashboard pages.
The two flip together by design (FR-008). The panel reads what capture
writes, so panel-on with capture-off renders an empty "No history yet"
that misrepresents an edited entity as unchanged — the one combination
that is worse than either switch being off.
ENABLE_VERSIONING_CAPTURE is RETAINED permanently (FR-002) as the
operational kill-switch, not removed with the rollout toggles. Its
comment previously read as an instruction for this change ("activated by
flipping this default to on once validated in production"); it now
describes the switch's standing purpose instead.
Scope: versioning only. The soft-delete flips are apache#42800 — FR-009
permits the two shipping in different releases, and they answer to
different gates: a SIP-210 [VOTE] here, an internal determination there.
UPDATING.md gains the FR-006 entry: storage growth and the retention beat
task that bounds it, the PUT response-shape change (old_version_uuid /
new_version_uuid and ETag are now populated), and the note that unlike
the soft-delete toggle, turning capture off is a *clean* stop — existing
rows stay readable and no entity state is altered. A stale "(ships off)"
parenthetical further down is corrected.
docs/static/feature-flags.json regenerated by the docs-sync hook.
Depends on: apache#42797 (shadow-row reads pinned to (id, uuid)). Capture
on by default widens the id-reuse window that PR closes — purge frequency
rises as soft delete graduates, and recycled ids are deterministic on
SQLite — so it must land first.
Verified: 164/164 unit (versioning, config, initialization), 84/84 + 4
skipped versioning integration, pre-commit green.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Flips the two soft-delete release defaults for general availability (sc-111918 stage 2a, FR-003 and FR-005): SOFT_DELETE False -> True SOFT_DELETE_PURGE_DRY_RUN True -> False Deleting a dashboard, chart, or dataset now archives it rather than removing it, and the nightly purge deletes for real once the retention window elapses instead of only logging would_purge counts. Both switches are RETAINED, deliberately. FR-003 keeps SOFT_DELETE as the move-back lever and defers its removal (with the hard-delete fallback and its both-state tests) to sc-115600 once post-flip confidence is established; FR-004 requires that fallback to keep being exercised, because the way back is only real if it stays tested. FR-005 keeps SOFT_DELETE_PURGE_DRY_RUN as an operational switch, so an operator can suspend purging without redeploying. Scope: soft delete only. The versioning flips (VERSION_HISTORY and ENABLE_VERSIONING_CAPTURE, FR-001/002/008) are a separate branch — FR-009 permits the two shipping in different releases, and they answer to different gates: an internal dev@ determination here, a SIP-210 vote there. test_default_config_is_safe asserted the pre-flip posture and is superseded by test_default_config_purges_for_real_after_the_retention_window, which pins the new defaults with the reasoning for why dry-run was the introducing release's choice. It is the only test in the unit suite that the flip breaks — verified by a full run (the 24 firebolt SQL-dialect failures are a different subsystem and unrelated). UPDATING.md gains the FR-006 breaking-change entry: what changes, how to size the first live purge (dry-run for one night and read the counts), the replaced-CELERY_CONFIG check, and the honest caveat that turning soft delete back off resurrects archived rows rather than cleanly reverting. The dry-run paragraph further down, which described dry-run as the shipped default, is corrected. docs/static/feature-flags.json is regenerated by the docs-sync hook. Depends on: apache#42641 (beat-schedule startup warning, FR-010) and apache#42642 (sc-112173 no-op migration, FR-010) landing first. Verified: 66/66 across the soft-delete unit suites, 24/24 integration purge tests, pre-commit green. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Flipping SOFT_DELETE on turns the delete confirmation modal recoverable: the action reads "Archive" and the type-to-confirm input is deliberately not rendered. The six delete-flow specs typed "DELETE" into that input unconditionally, so each timed out waiting for an element that no longer exists -- single and bulk delete, across charts, dashboards and datasets. Rather than rewrite them for the archive path, the mode is resolved where it actually lives. DeleteConfirmationModal gains confirmDeletion(), which reads SOFT_DELETE the same way the application does and picks the matching interaction. The specs then exercise whichever mode the instance is in, so they keep covering hard delete for deployments that turn the toggle back off -- the way back is only real if it stays exercised. The recoverable branch asserts the confirmation input is genuinely absent rather than skipping past it, so a regression dropping the typed confirmation from destructive mode still fails here. Also fixes a second assumption the timeout was masking: the dataset success toast reads "Archived: %s" under soft delete, so asserting "Deleted" would have failed as soon as the modal was navigable. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
mikebridge
force-pushed
the
sc-111918-flip-soft-delete-defaults
branch
from
August 6, 2026 14:06
284e6fa to
98b91be
Compare
mikebridge
pushed a commit
to mikebridge/superset
that referenced
this pull request
Aug 6, 2026
Flips the two versioning release defaults for general availability
(sc-111918 stage 2b, FR-001/002/008):
VERSION_HISTORY False -> True
ENABLE_VERSIONING_CAPTURE false -> true (env-var default)
Every save of a chart, dashboard, or dataset now writes version rows, and
the history panel appears on Explore and Dashboard pages.
The two flip together by design (FR-008). The panel reads what capture
writes, so panel-on with capture-off renders an empty "No history yet"
that misrepresents an edited entity as unchanged — the one combination
that is worse than either switch being off.
ENABLE_VERSIONING_CAPTURE is RETAINED permanently (FR-002) as the
operational kill-switch, not removed with the rollout toggles. Its
comment previously read as an instruction for this change ("activated by
flipping this default to on once validated in production"); it now
describes the switch's standing purpose instead.
Scope: versioning only. The soft-delete flips are apache#42800 — FR-009
permits the two shipping in different releases, and they answer to
different gates: a SIP-210 [VOTE] here, an internal determination there.
UPDATING.md gains the FR-006 entry: storage growth and the retention beat
task that bounds it, the PUT response-shape change (old_version_uuid /
new_version_uuid and ETag are now populated), and the note that unlike
the soft-delete toggle, turning capture off is a *clean* stop — existing
rows stay readable and no entity state is altered. A stale "(ships off)"
parenthetical further down is corrected.
docs/static/feature-flags.json regenerated by the docs-sync hook.
Depends on: apache#42797 (shadow-row reads pinned to (id, uuid)). Capture
on by default widens the id-reuse window that PR closes — purge frequency
rises as soft delete graduates, and recycled ids are deterministic on
SQLite — so it must land first.
Verified: 164/164 unit (versioning, config, initialization), 84/84 + 4
skipped versioning integration, pre-commit green.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
mikebridge
marked this pull request as ready for review
August 6, 2026 14:09
mikebridge
requested review from
eschutho,
geido,
mistercrunch,
rusackas and
sadpandajoe
as code owners
August 6, 2026 14:09
richardfogaca
approved these changes
Aug 6, 2026
eschutho
approved these changes
Aug 6, 2026
Contributor
|
Bito Automatic Review Skipped – PR Already Merged |
mikebridge
pushed a commit
to mikebridge/superset
that referenced
this pull request
Aug 6, 2026
Flips the two versioning release defaults for general availability
(sc-111918 stage 2b, FR-001/002/008):
VERSION_HISTORY False -> True
ENABLE_VERSIONING_CAPTURE false -> true (env-var default)
Every save of a chart, dashboard, or dataset now writes version rows, and
the history panel appears on Explore and Dashboard pages.
The two flip together by design (FR-008). The panel reads what capture
writes, so panel-on with capture-off renders an empty "No history yet"
that misrepresents an edited entity as unchanged — the one combination
that is worse than either switch being off.
ENABLE_VERSIONING_CAPTURE is RETAINED permanently (FR-002) as the
operational kill-switch, not removed with the rollout toggles. Its
comment previously read as an instruction for this change ("activated by
flipping this default to on once validated in production"); it now
describes the switch's standing purpose instead.
Scope: versioning only. The soft-delete flips are apache#42800 — FR-009
permits the two shipping in different releases, and they answer to
different gates: a SIP-210 [VOTE] here, an internal determination there.
UPDATING.md gains the FR-006 entry: storage growth and the retention beat
task that bounds it, the PUT response-shape change (old_version_uuid /
new_version_uuid and ETag are now populated), and the note that unlike
the soft-delete toggle, turning capture off is a *clean* stop — existing
rows stay readable and no entity state is altered. A stale "(ships off)"
parenthetical further down is corrected.
docs/static/feature-flags.json regenerated by the docs-sync hook.
Depends on: apache#42797 (shadow-row reads pinned to (id, uuid)). Capture
on by default widens the id-reuse window that PR closes — purge frequency
rises as soft delete graduates, and recycled ids are deterministic on
SQLite — so it must land first.
Verified: 164/164 unit (versioning, config, initialization), 84/84 + 4
skipped versioning integration, pre-commit green.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
mikebridge
pushed a commit
to mikebridge/superset
that referenced
this pull request
Aug 7, 2026
Flips the two versioning release defaults for general availability
(sc-111918 stage 2b, FR-001/002/008):
VERSION_HISTORY False -> True
ENABLE_VERSIONING_CAPTURE false -> true (env-var default)
Every save of a chart, dashboard, or dataset now writes version rows, and
the history panel appears on Explore and Dashboard pages.
The two flip together by design (FR-008). The panel reads what capture
writes, so panel-on with capture-off renders an empty "No history yet"
that misrepresents an edited entity as unchanged — the one combination
that is worse than either switch being off.
ENABLE_VERSIONING_CAPTURE is RETAINED permanently (FR-002) as the
operational kill-switch, not removed with the rollout toggles. Its
comment previously read as an instruction for this change ("activated by
flipping this default to on once validated in production"); it now
describes the switch's standing purpose instead.
Scope: versioning only. The soft-delete flips are apache#42800 — FR-009
permits the two shipping in different releases, and they answer to
different gates: a SIP-210 [VOTE] here, an internal determination there.
UPDATING.md gains the FR-006 entry: storage growth and the retention beat
task that bounds it, the PUT response-shape change (old_version_uuid /
new_version_uuid and ETag are now populated), and the note that unlike
the soft-delete toggle, turning capture off is a *clean* stop — existing
rows stay readable and no entity state is altered. A stale "(ships off)"
parenthetical further down is corrected.
docs/static/feature-flags.json regenerated by the docs-sync hook.
Depends on: apache#42797 (shadow-row reads pinned to (id, uuid)). Capture
on by default widens the id-reuse window that PR closes — purge frequency
rises as soft delete graduates, and recycled ids are deterministic on
SQLite — so it must land first.
Verified: 164/164 unit (versioning, config, initialization), 84/84 + 4
skipped versioning integration, pre-commit green.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
9 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
Flips the two soft-delete release defaults for general availability:
SOFT_DELETEFalseTrueSOFT_DELETE_PURGE_DRY_RUNTrueFalseDeleting a dashboard, chart, or dataset now archives it rather than removing it — hidden from normal listings, recoverable from Recently Archived (#41550), and permanently removed once
SOFT_DELETE_RETENTION_DAYS(default 30) elapses. The nightlydeletion_retention.purge_soft_deletedtask deletes for real instead of only loggingwould_purgecounts, which makes the retention promise in the docs true on a stock deployment.Both switches are retained, deliberately.
SOFT_DELETE = Falserestores hard-delete behaviour;SOFT_DELETE_PURGE_DRY_RUN = Truesuspends purging without a redeploy. The hard-delete fallback branch and the tests covering both flag states stay in place and keep passing — the way back is only real if it stays exercised. Removing the toggle is deliberately a separate, later change (sc-115600), not part of this one.Scope: soft delete only. The versioning flips (
VERSION_HISTORY,ENABLE_VERSIONING_CAPTURE) are a separate branch. They answer to a different gate — a SIP-210 [VOTE] rather than the internal determination behind this one — so the two are kept independently reviewable, independently shippable, and independently revertible.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A — configuration defaults. The UI this enables (Recently Archived, restore, permanent delete) shipped in #41550 and is unchanged here.
TESTING INSTRUCTIONS
Exactly one test in the unit suite changes behaviour under the flip, and it is the deliberate guard:
test_default_config_is_safeasserted the pre-flip posture. It is superseded bytest_default_config_purges_for_real_after_the_retention_window, which pins the new defaults and records why dry-run was the introducing release's choice.Verified before pushing:
tests/unit_testsrun — the flip breaks only that one test (the 24 firebolt SQL-dialect failures in that run are a different subsystem, unrelated and pre-existing)tests/unit_tests/{tasks/test_deletion_retention,config_test,views/test_soft_delete_filter,daos/test_base_dao_soft_delete,models/test_soft_delete_mixin}.py— 66/66tests/integration_tests/deletion_retention/purge_tests.py— 24/24, including thedry_run=Truebehavioural coverage that proves the retained lever still suppresses deletionpre-commit rungreen;docs/static/feature-flags.jsonregenerated by the docs-sync hookManual: with default config, delete a chart — it disappears from the list and appears under Recently Archived, recoverable. Set
FEATURE_FLAGS = {"SOFT_DELETE": False}and delete another — it is removed outright, as before.ADDITIONAL INFORMATION
SOFT_DELETE(this changes its default; the flag itself is retained)UPDATING.mdgains a breaking-change entry covering what changes and two things operators should do first:SOFT_DELETE_PURGE_DRY_RUN = True, read thewould_purgecounts from one nightly run, then set it back.CELERY_CONFIG. A deployment that redefines rather than inherits it must carry bothsuperset.tasks.deletion_retentioninimportsand the beat entry. feat(soft-delete): warn at startup when a retention task's Celery config is incomplete #42641 adds a startup warning naming whichever is absent — which is why it gated this PR.It also states the caveat plainly: turning soft delete back off resurrects objects archived while it was on, because those rows were never removed. That is an emergency stop, not a clean rollback, and operators should know it before they need it.
Dependencies:
🤖 Generated with Claude Code