Skip to content

fix(semantic): name the assets that block a semantic layer or view delete - #45642

Open
mikebridge wants to merge 22 commits into
apache:masterfrom
mikebridge:sc-128878-delete-blocker-names
Open

mikebridge wants to merge 22 commits into
apache:masterfrom
mikebridge:sc-128878-delete-blocker-names

Conversation

@mikebridge

@mikebridge mikebridge commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

TL;DR: when deleting a semantic layer or view is refused because other assets depend on it, the dialog now names those assets, including archived ones, so you can find and fix them. You only see names you could already see elsewhere; anything else is shown as a count with a hint to ask an admin.

SUMMARY

The delete refusal (409) already returned up to 20 dependents, but the dialogs showed counts only. Archived dependents were never named, even to admins, because visibility was computed over live rows only.

  • Archived blockers are named to the people who could restore them. Archived charts and dashboards are named to the users Recently Archived would show them to: admins see every archived item, and others see the items they edit. The live visibility filters are unchanged. Each dependent carries an archived flag, and the rest are counted in inaccessible_count as before.
  • The dialogs list the dependents. The layer and view delete dialogs show:
    • the dependents' names and types, with "archived" where it applies;
    • links to live charts and dashboards;
    • "and N more" past the 20 listed;
    • a note to ask an admin when some dependents are hidden.
  • Copy:
    • the refusal no longer says "Semantic source";
    • the view dialog gets the trash icon and the bold name the layer dialog has;
    • "Recently Archived" capitalisation is consistent in the database dialog;
    • an empty layer reads "has no semantic views".

The deletion policy itself is unchanged.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before: "Deletion is blocked by 15 dependent assets (2 archived)", with no names. After: the same line plus a list of the blocking charts and dashboards, archived ones marked, live ones linked.

TESTING INSTRUCTIONS

  • pytest tests/unit_tests/commands/semantic_layer/delete_test.py tests/unit_tests/semantic_layers/api_test.py
  • npm run test -- src/pages/DatasetList src/pages/DatabaseList
  • Manually, with SEMANTIC_LAYERS and SOFT_DELETE on:
    1. Create a chart on a semantic view, archive it, and try to delete the view as an admin. The dialog names the archived chart.
    2. As a non-admin who doesn't edit that chart, the chart is counted, with the ask-an-admin note.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags: SEMANTIC_LAYERS (and SOFT_DELETE for archived assets)
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

The 409 gains one additive field per dependent (archived); existing fields keep their meaning.

mikebridge and others added 10 commits October 20, 2026 16:22
…lete

The deletion refusal already returns up to 20 visible dependents, but the
dialogs showed counts only, and archived dependents were never named, even
to admins, because visibility was computed over live rows only.

Name archived charts and dashboards to the audience Recently Archived
shows them to (admins and the asset's editors), flag each dependent as
archived, and list the dependents in the layer and view delete dialogs
with links for live assets, an "and N more" overflow, and an "ask an
admin" hint when some dependents are hidden. Also replace "Semantic
source" in the refusal, bold the view name and add the trash icon to the
view dialog, and align "Recently Archived" capitalisation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Retain both the semantic deletion guidance and upstream bulk-create messages in the translation catalog; no runtime conflict resolution.
Bypassing the soft-delete listener for charts and dashboards across the
whole dependents statement also changed the live access filters: the
dashboard filter's chart join started counting archived charts. Keep the
live filters as they were and add archived rows through a separate
audience read from the editor tables, which is the Recently Archived
audience (admins see every archived row, others the rows they edit).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An Admin-role guest token skipped straight to the admin branch of the
archived audience, naming more than Recently Archived would show it.
Fail closed for guests first, as the restore gate does, and pin that
editorship names archived rows only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…names

# Conflicts:
#	superset/translations/messages.pot
@github-actions github-actions Bot added i18n Namespace | Anything related to localization api Related to the REST API doc Namespace | Anything related to documentation packages labels Oct 22, 2026
@netlify

netlify Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit a3cd6b9
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6ae294a19347388e1ec5fc05
😎 Deploy Preview https://deploy-preview-45642--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.

Use /dashboard/<id>/ rather than a hard-coded /superset/ path, as the
navigation invariant requires; ensureAppRoot applies the deployment root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.71%. Comparing base (a8c13c6) to head (03cda6a).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #45642       +/-   ##
===========================================
+ Coverage   65.62%   84.71%   +19.09%     
===========================================
  Files        3069     3070        +1     
  Lines      205661   205699       +38     
  Branches    48336    48349       +13     
===========================================
+ Hits       134956   174268    +39312     
+ Misses      67624    28139    -39485     
- Partials     3081     3292      +211     
Flag Coverage Δ
hive 34.51% <26.66%> (-0.01%) ⬇️
javascript 80.96% <100.00%> (+0.01%) ⬆️
mysql 52.58% <26.66%> (-0.01%) ⬇️
postgres 52.58% <26.66%> (-0.01%) ⬇️
presto 36.24% <26.66%> (-0.01%) ⬇️
python 87.76% <100.00%> (+34.89%) ⬆️
sqlite 52.35% <26.66%> (-0.01%) ⬇️
unit 82.49% <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.

The blocker ids come from the error response, so a non-numeric id
could steer the link off the app. Build links only from whole-number
ids and keep names as plain text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the requires:rebase Requires rebasing on top of current master label Oct 23, 2026
@github-actions github-actions Bot removed the requires:rebase Requires rebasing on top of current master label Oct 23, 2026
@mikebridge
mikebridge marked this pull request as ready for review October 23, 2026 23:35
@codeant-ai-for-open-source

codeant-ai-for-open-source Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

CodeAnt  CodeAnt PR Risk

🟢  Low Risk

  • The PR appears safe to merge; no actionable issues were identified in the review.

Assessed commit: 03cda6a70623

@aminghadersohi aminghadersohi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Archived charts and dashboards now block the delete, are named only to users who can restore them, and the counts and API schema are consistent. CI green.

@github-actions github-actions Bot added the requires:rebase Requires rebasing on top of current master label Oct 26, 2026
Preserve the restore-audience naming rule and its permission matrix while retaining upstream delete wording and regenerating the API and translation artifacts.
@github-actions github-actions Bot removed packages requires:rebase Requires rebasing on top of current master labels Oct 26, 2026
Preserve the master archive-message updates alongside blocker details. Local candidate only: owned DatasetList, archive documentation and translation files auto-merged and require independent review before publication.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Related to the REST API doc Namespace | Anything related to documentation i18n Namespace | Anything related to localization size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants