You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "JCelento (via GitHub)" <gi...@apache.org> on 2026/02/05 11:30:24 UTC

[PR] feat(dashboard): add version history with one-click restore [superset]

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

   ### SUMMARY
   Adds dashboard version history: a snapshot is created on each save, and users can list versions and restore any one with a single click. Restore updates layout and metadata, syncs chart–dashboard links, and removes orphaned chart components; the UI refreshes without a full page reload.
   
   **Backend:** New `dashboard_versions` table and `DashboardVersion` model; `DashboardVersionDAO` (create, list, retention); snapshot-after-save in `UpdateDashboardCommand`; `RestoreDashboardVersionCommand`; API endpoints `GET .../versions`, `PUT .../versions/<id>` (description), `POST .../restore/<version_id>`.
   
   **Frontend:** History button in dashboard Header (edit mode); HistoryModal to list versions (number, comment, author, date) and restore with confirmation; optional version description editing; restore triggers re-hydration via `dashboardRestoreKey` (no full reload). Includes a fix for the hydration effect dependency array so it does not re-run in a loop when dashboard/charts refs change.
   
   Design and scope are documented in `docs/adr/0001-dashboard-version-history.md`.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   ### TESTING INSTRUCTIONS
   1. Open a dashboard in edit mode and save at least once.
   2. Click the History button in the header and confirm the version list appears (version number, comment if set, author, date).
   3. Restore an older version: click Restore, confirm; the dashboard should update to that version without a full page reload.
   4. Optionally edit a version description in the modal and save; confirm it persists.
   5. Run backend tests: `pytest superset/dashboards/ tests/unit_tests/dashboards/ -v`
   6. Run frontend tests: `npm run test -- DashboardPage.hydration.test.tsx`, `npm run test -- HistoryModal`, `npm run test -- DashboardRestore.integration`
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [x] Changes UI
   - [x] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [x] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [x] 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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(dashboard): add version history with one-click restore [superset]

Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #37697:
URL: https://github.com/apache/superset/pull/37697#issuecomment-3855044165

   ### <span aria-hidden="true">βœ…</span> Deploy Preview for *superset-docs-preview* ready!
   
   
   |  Name | Link |
   |:-:|------------------------|
   |<span aria-hidden="true">πŸ”¨</span> Latest commit | 1de26b68ca6ac0e46c9293442d87b56c2bf3463e |
   |<span aria-hidden="true">πŸ”</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6984cf9e78f3de0008afa6d0 |
   |<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-37697--superset-docs-preview.netlify.app](https://deploy-preview-37697--superset-docs-preview.netlify.app) |
   |<span aria-hidden="true">πŸ“±</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br />![QR Code](https://app.netlify.com/qr-code/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1cmwiOiJodHRwczovL2RlcGxveS1wcmV2aWV3LTM3Njk3LS1zdXBlcnNldC1kb2NzLXByZXZpZXcubmV0bGlmeS5hcHAifQ.c8xB8mlopLjKzuSQmLiJ9wYSkde-OfDf7NmRlREg5wQ)<br /><br />_Use your smartphone camera to open QR code link._</details> |
   ---
   <!-- [superset-docs-preview Preview](https://deploy-preview-37697--superset-docs-preview.netlify.app) -->
   _To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(dashboard): add version history with one-click restore [superset]

Posted by "Vitor-Avila (via GitHub)" <gi...@apache.org>.
Vitor-Avila commented on PR #37697:
URL: https://github.com/apache/superset/pull/37697#issuecomment-3897433466

   this is awesome!!! 😍 


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(dashboard): add version history with one-click restore [superset]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #37697:
URL: https://github.com/apache/superset/pull/37697#issuecomment-3855366807

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/37697?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `44.82759%` with `128 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 43.52%. Comparing base ([`4e4fa53`](https://app.codecov.io/gh/apache/superset/commit/4e4fa53c8d95a24e0c9777ea226c2f0c7d3dc096?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`e4265de`](https://app.codecov.io/gh/apache/superset/commit/e4265dec60968aaf5df21f4234abacde909305ee?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 4 commits behind head on master.
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/superset/pull/37697?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [superset/commands/dashboard/restore\_version.py](https://app.codecov.io/gh/apache/superset/pull/37697?src=pr&el=tree&filepath=superset%2Fcommands%2Fdashboard%2Frestore_version.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvY29tbWFuZHMvZGFzaGJvYXJkL3Jlc3RvcmVfdmVyc2lvbi5weQ==) | 27.58% | [63 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/37697?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [superset/dashboards/api.py](https://app.codecov.io/gh/apache/superset/pull/37697?src=pr&el=tree&filepath=superset%2Fdashboards%2Fapi.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9hcGkucHk=) | 39.06% | [39 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/37697?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [superset/daos/dashboard\_version.py](https://app.codecov.io/gh/apache/superset/pull/37697?src=pr&el=tree&filepath=superset%2Fdaos%2Fdashboard_version.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvZGFvcy9kYXNoYm9hcmRfdmVyc2lvbi5weQ==) | 50.00% | [19 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/37697?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [superset/commands/dashboard/update.py](https://app.codecov.io/gh/apache/superset/pull/37697?src=pr&el=tree&filepath=superset%2Fcommands%2Fdashboard%2Fupdate.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvY29tbWFuZHMvZGFzaGJvYXJkL3VwZGF0ZS5weQ==) | 40.00% | [6 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/37697?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [superset/commands/dashboard/exceptions.py](https://app.codecov.io/gh/apache/superset/pull/37697?src=pr&el=tree&filepath=superset%2Fcommands%2Fdashboard%2Fexceptions.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvY29tbWFuZHMvZGFzaGJvYXJkL2V4Y2VwdGlvbnMucHk=) | 80.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/37697?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #37697       +/-   ##
   ===========================================
   + Coverage        0   43.52%   +43.52%     
   ===========================================
     Files           0      649      +649     
     Lines           0    49703    +49703     
     Branches        0     5567     +5567     
   ===========================================
   + Hits            0    21632    +21632     
   - Misses          0    27772    +27772     
   - Partials        0      299      +299     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/37697/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Ξ” | |
   |---|---|---|
   | [hive](https://app.codecov.io/gh/apache/superset/pull/37697/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `41.80% <44.82%> (?)` | |
   | [presto](https://app.codecov.io/gh/apache/superset/pull/37697/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `41.82% <44.82%> (?)` | |
   | [python](https://app.codecov.io/gh/apache/superset/pull/37697/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `43.52% <44.82%> (?)` | |
   | [unit](https://app.codecov.io/gh/apache/superset/pull/37697/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `100.00% <ΓΈ> (?)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/superset/pull/37697?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(dashboard): add version history with one-click restore [superset]

Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #37697:
URL: https://github.com/apache/superset/pull/37697#issuecomment-3855006921

   ### <span aria-hidden="true">βœ…</span> Deploy Preview for *superset-docs-preview* ready!
   
   
   |  Name | Link |
   |:-:|------------------------|
   |<span aria-hidden="true">πŸ”¨</span> Latest commit | d0926bdec20ac6239b52286bfd3321d76bf5aa6e |
   |<span aria-hidden="true">πŸ”</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6984cd8f1c09cb0008817aa3 |
   |<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-37697--superset-docs-preview.netlify.app](https://deploy-preview-37697--superset-docs-preview.netlify.app) |
   |<span aria-hidden="true">πŸ“±</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br />![QR Code](https://app.netlify.com/qr-code/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1cmwiOiJodHRwczovL2RlcGxveS1wcmV2aWV3LTM3Njk3LS1zdXBlcnNldC1kb2NzLXByZXZpZXcubmV0bGlmeS5hcHAifQ.c8xB8mlopLjKzuSQmLiJ9wYSkde-OfDf7NmRlREg5wQ)<br /><br />_Use your smartphone camera to open QR code link._</details> |
   ---
   <!-- [superset-docs-preview Preview](https://deploy-preview-37697--superset-docs-preview.netlify.app) -->
   _To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(dashboard): add version history with one-click restore [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #37697:
URL: https://github.com/apache/superset/pull/37697#issuecomment-3853022776

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(dashboard): add version history with one-click restore [superset]

Posted by "JCelento (via GitHub)" <gi...@apache.org>.
JCelento closed pull request #37697: feat(dashboard): add version history with one-click restore
URL: https://github.com/apache/superset/pull/37697


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(dashboard): add version history with one-click restore [superset]

Posted by "LuisSanchez (via GitHub)" <gi...@apache.org>.
LuisSanchez commented on PR #37697:
URL: https://github.com/apache/superset/pull/37697#issuecomment-3899305723

   Excellent work πŸ‘ 


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(dashboard): add version history with one-click restore [superset]

Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #37697:
URL: https://github.com/apache/superset/pull/37697#issuecomment-3855035277

   ### <span aria-hidden="true">βœ…</span> Deploy Preview for *superset-docs-preview* ready!
   
   
   |  Name | Link |
   |:-:|------------------------|
   |<span aria-hidden="true">πŸ”¨</span> Latest commit | 9c6c5bf71a6729d57d3c4753b15f154dad978b05 |
   |<span aria-hidden="true">πŸ”</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6984cefb6d4278000824084a |
   |<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-37697--superset-docs-preview.netlify.app](https://deploy-preview-37697--superset-docs-preview.netlify.app) |
   |<span aria-hidden="true">πŸ“±</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br />![QR Code](https://app.netlify.com/qr-code/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1cmwiOiJodHRwczovL2RlcGxveS1wcmV2aWV3LTM3Njk3LS1zdXBlcnNldC1kb2NzLXByZXZpZXcubmV0bGlmeS5hcHAifQ.c8xB8mlopLjKzuSQmLiJ9wYSkde-OfDf7NmRlREg5wQ)<br /><br />_Use your smartphone camera to open QR code link._</details> |
   ---
   <!-- [superset-docs-preview Preview](https://deploy-preview-37697--superset-docs-preview.netlify.app) -->
   _To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org