Repository navigation
fix(versioning): show chart archival in dashboard history - #46479
rebenitez1802 merged 5 commits into
Conversation
Keep commit-time version-history finalization fail closed on unisolated DBAPI errors. This policy applies to ordinary chart, dashboard, and dataset saves as well as archives: a failed read can abort PostgreSQL's transaction, so swallowing it can report success after the user's changes were rolled back. Optional database capture failures isolated by a successful savepoint rollback may still omit history without rejecting the save. Document this policy in the user guide, upgrade notes, and finalization docstrings. Suppress expected missing-scope tracebacks while retaining error metrics; log and count fatal archive capture before propagating it. Restrict lost transaction diagnostics to database-driver errors and add null-UUID membership coverage. Scope CI workflows to their actual dependencies and make the versioning Testcontainers suite an explicit Python package.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #46479 +/- ##
==========================================
+ Coverage 85.93% 85.97% +0.03%
==========================================
Files 3123 3127 +4
Lines 217179 217726 +547
Branches 51489 51618 +129
==========================================
+ Hits 186634 187183 +549
Misses 27119 27119
+ Partials 3426 3424 -2
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:
|
aminghadersohi
left a comment
There was a problem hiding this comment.
Archive capture, membership scoping, visibility gating, purge cleanup and the migration look correct.
Nit: RelatedUpdateRow.test.tsx: the Preview/Restore/Open as new chart absence checks can never fail; that row never renders them.
|
@aminghadersohi Thanks for the review! Fixed the nit in 7a12fda: removed the three redundant action assertions and renamed the test to describe the navigation-link check it actually exercises. The button-absence assertion remains. All 11 focused tests and branch-wide pre-commit checks passed. |
The Canvas tip 638c287 merges master b13ab50 (#46479), so this brings the current master too. #46479's chart archive scope migration sits under the canvas migrations, as the Canvas tip re-points them. Conflicts: UPDATING.md (kept both sides' entries) and messages.pot (took master's creation date). Co-Authored-By: Claude Opus 5.5 <[email protected]>
SUMMARY
Archiving a chart does not create a content version, so dashboard version history previously gave no indication that the chart had been archived. This adds a separate Chart archived: related-activity entry for each dashboard containing the chart at archive time, including dashboards without a content baseline.
The event stores its historical chart identity/name and dashboard membership in the archive transaction. Membership remains accurate across capture-disabled attaches/detaches and later changes. Chart self-history stays content-only, preserving current-version detection after recovery without another save. Archived entries offer no content-version actions or Explore navigation; recovery enables navigation while retaining the archive headline. Related-resource read permissions, detail editorship, and deletion redaction still apply.
Two related transaction policies are explicit:
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before: the chart is archived, but dashboard history contains no archive announcement.
After: the same archive has a timestamped related entry, while the latest content save remains unchanged.
Screenshots use an isolated local test dashboard. Browser checks also verified that recovery restores chart navigation without changing the historical archive verb.
TESTING INSTRUCTIONS
superset db upgrade. EnableSOFT_DELETE,VERSION_HISTORY, and theENABLE_VERSIONING_CAPTUREconfiguration.Local validation across implementation and review rounds:
The dedicated PostgreSQL/MySQL workflow runs
pytest -m testcontainers tests/testcontainers/versioning/test_chart_archive.pyautomatically. Hosted checks are pending this PR.ADDITIONAL INFORMATION
SOFT_DELETEfor archive operations;VERSION_HISTORYfor displaying history.ENABLE_VERSIONING_CAPTUREis a separate capture configuration; turning offVERSION_HISTORYdoes not stop capture.Migration
a7d29bc4e681creates an empty archive-scope table and indexes; it does not backfill events or rewrite existing entity tables. Upgrade before new archive writes. Missing-table reads preserve content history, but skipped archives cannot be reconstructed. Downgrade removes archive scopes/events, preserves content history, and leaves empty transactions for normal retention. SQLite, PostgreSQL 17, and MySQL 8.0 upgrade/downgrade and rerun behavior were tested. The combined atomicity checkbox is intentionally unchecked because MySQL DDL is not transactional.Measured empty-database upgrade time was approximately 14–18 ms on PostgreSQL and 32–42 ms on MySQL; downgrade was approximately 7 ms and 17 ms respectively. These measurements exclude concurrent workload and metadata-lock waits. DDL needs metadata locks, so production lock waits remain deployment-dependent; zero downtime is not claimed.
Recheck migration parentage if #45022 lands first: both migrations descend from
dfa683969f48. Preserve both version-table cleanup inventory additions when resolving that integration.Explicit recovery events remain deferred. Non-Admin readers cannot see archived related actor/details under the existing policy; the panel labels a withheld actor as System. This targets master; no 7.0.x backport is included.
AI-assisted implementation and PR description. Three internal review rounds were completed, and their actionable findings were addressed. The local test and browser results above were executed during implementation; this does not claim hosted CI has passed.