Skip to content

feat(soft-delete): enable soft delete by default and purge for real - #42800

Merged
eschutho merged 3 commits into
apache:masterfrom
mikebridge:sc-111918-flip-soft-delete-defaults
Aug 6, 2026
Merged

eschutho merged 3 commits into
apache:masterfrom
mikebridge:sc-111918-flip-soft-delete-defaults

Conversation

@mikebridge

@mikebridge mikebridge commented Aug 5, 2026 •

Copy link
Copy Markdown
Member

Dependencies satisfied. #42641 and #42642 (the FR-010 preconditions) both merged on 2026-08-05, so this PR is no longer gated by them.

SUMMARY

Flips the two soft-delete release defaults for general availability:

Setting Before After
SOFT_DELETE False True
SOFT_DELETE_PURGE_DRY_RUN True False

Deleting 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 nightly deletion_retention.purge_soft_deleted task deletes for real instead of only logging would_purge counts, which makes the retention promise in the docs true on a stock deployment.

Both switches are retained, deliberately. SOFT_DELETE = False restores hard-delete behaviour; SOFT_DELETE_PURGE_DRY_RUN = True suspends 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_safe asserted the pre-flip posture. It is superseded by test_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:

  • full tests/unit_tests run — 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/66
  • tests/integration_tests/deletion_retention/purge_tests.py — 24/24, including the dry_run=True behavioural coverage that proves the retained lever still suppresses deletion
  • pre-commit run green; docs/static/feature-flags.json regenerated by the docs-sync hook

Manual: 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

  • Has associated issue:
  • Required feature flags: SOFT_DELETE (this changes its default; the flag itself is retained)
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
  • Introduces new feature or API
  • Removes existing feature or API

UPDATING.md gains a breaking-change entry covering what changes and two things operators should do first:

  • Size the first live purge. The first real run removes everything that aged past the retention window since soft delete began capturing — on a busy deployment, potentially a large batch in a single window. Set SOFT_DELETE_PURGE_DRY_RUN = True, read the would_purge counts from one nightly run, then set it back.
  • Check a replaced CELERY_CONFIG. A deployment that redefines rather than inherits it must carry both superset.tasks.deletion_retention in imports and 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

@github-actions github-actions Bot added the doc Namespace | Anything related to documentation label Aug 5, 2026
@netlify

netlify Bot commented Aug 5, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 98b91be
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a749503951fba00082b376b
😎 Deploy Preview https://deploy-preview-42800--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Aug 5, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.73%. Comparing base (de93a19) to head (98b91be).
⚠️ Report is 2 commits behind head on master.

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           
Flag Coverage Δ
hive 38.01% <100.00%> (+0.04%) ⬆️
javascript 72.09% <ø> (ø)
mysql 57.80% <100.00%> (+<0.01%) ⬆️
postgres 57.84% <100.00%> (+<0.01%) ⬆️
presto 39.92% <100.00%> (+0.05%) ⬆️
python 59.21% <100.00%> (+<0.01%) ⬆️
sqlite 57.48% <100.00%> (+<0.01%) ⬆️
unit 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pull-request-size pull-request-size Bot added size/L and removed size/M labels Aug 5, 2026
@mikebridge
mikebridge force-pushed the sc-111918-flip-soft-delete-defaults branch from 3f0e665 to 284e6fa Compare August 5, 2026 20:53
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]>
Mike Bridge and others added 3 commits August 6, 2026 15:05
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
mikebridge force-pushed the sc-111918-flip-soft-delete-defaults branch from 284e6fa to 98b91be Compare August 6, 2026 14:06
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
mikebridge marked this pull request as ready for review August 6, 2026 14:09
@dosubot dosubot Bot added the risk:breaking-change Issues or PRs that will introduce breaking changes label Aug 6, 2026
@eschutho
eschutho merged commit ba09f39 into apache:master Aug 6, 2026
92 of 122 checks passed
@bito-code-review

Copy link
Copy Markdown
Contributor

Bito Automatic Review Skipped – PR Already Merged

Bito scheduled an automatic review for this pull request, but the review was skipped because this PR was merged before the review could be run.
No action is needed if you didn't intend to review it. To get a review, you can type /review in a comment and save it

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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Namespace | Anything related to documentation risk:breaking-change Issues or PRs that will introduce breaking changes size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants