You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ru...@apache.org on 2026/07/06 15:57:19 UTC

(superset) branch master updated: chore(mcp): drop legacy /superset prefix from dashboard URLs (#41758)

This is an automated email from the ASF dual-hosted git repository.

rusackas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new fd8d7009a5b chore(mcp): drop legacy /superset prefix from dashboard URLs (#41758)
fd8d7009a5b is described below

commit fd8d7009a5bcaa86483a56acf8031aed8ff5930c
Author: Joe Li <jo...@preset.io>
AuthorDate: Mon Jul 6 08:57:08 2026 -0700

    chore(mcp): drop legacy /superset prefix from dashboard URLs (#41758)
    
    Co-authored-by: Claude Opus 4.8 (1M context) <no...@anthropic.com>
---
 superset/mcp_service/dashboard/schemas.py                         | 4 ++--
 superset/mcp_service/dashboard/tool/duplicate_dashboard.py        | 6 ++----
 superset/mcp_service/dashboard/tool/manage_native_filters.py      | 4 +---
 .../mcp_service/dashboard/tool/remove_chart_from_dashboard.py     | 8 +++-----
 .../mcp_service/dashboard/tool/test_duplicate_dashboard.py        | 6 +++---
 .../dashboard/tool/test_remove_chart_from_dashboard.py            | 2 +-
 6 files changed, 12 insertions(+), 18 deletions(-)

diff --git a/superset/mcp_service/dashboard/schemas.py b/superset/mcp_service/dashboard/schemas.py
index 91df24e8f91..340eb5f71f6 100644
--- a/superset/mcp_service/dashboard/schemas.py
+++ b/superset/mcp_service/dashboard/schemas.py
@@ -706,8 +706,8 @@ class GenerateDashboardRequest(BaseModel):
         max_length=255,
         description=(
             "Optional URL slug for the dashboard. When set, the dashboard "
-            "is reachable at /superset/dashboard/<slug>/ instead of "
-            "/superset/dashboard/<id>/. Must be unique across the instance."
+            "is reachable at /dashboard/<slug>/ instead of "
+            "/dashboard/<id>/. Must be unique across the instance."
         ),
     )
     position_json: Dict[str, Any] | None = Field(
diff --git a/superset/mcp_service/dashboard/tool/duplicate_dashboard.py b/superset/mcp_service/dashboard/tool/duplicate_dashboard.py
index 706a11682e6..ae5bb501fe8 100644
--- a/superset/mcp_service/dashboard/tool/duplicate_dashboard.py
+++ b/superset/mcp_service/dashboard/tool/duplicate_dashboard.py
@@ -116,7 +116,7 @@ def _serialize_new_dashboard(dashboard: Any) -> tuple[DashboardInfo, str]:
     """Build the response ``DashboardInfo`` and URL for the new dashboard."""
     from superset.mcp_service.dashboard.schemas import serialize_tag_object
 
-    dashboard_url = f"{get_superset_base_url()}/superset/dashboard/{dashboard.id}/"
+    dashboard_url = f"{get_superset_base_url()}/dashboard/{dashboard.id}/"
     include_data_model_metadata = user_can_view_data_model_metadata()
     info = DashboardInfo(
         id=dashboard.id,
@@ -202,9 +202,7 @@ def _refetch_and_serialize(
             exc_info=True,
         )
         _safe_rollback("dashboard re-fetch")
-        dashboard_url = (
-            f"{get_superset_base_url()}/superset/dashboard/{new_dashboard.id}/"
-        )
+        dashboard_url = f"{get_superset_base_url()}/dashboard/{new_dashboard.id}/"
         info = _sanitize_dashboard_info_for_llm_context(
             DashboardInfo(
                 id=new_dashboard.id,
diff --git a/superset/mcp_service/dashboard/tool/manage_native_filters.py b/superset/mcp_service/dashboard/tool/manage_native_filters.py
index 7f01c42baf6..6b9ec15c0bc 100644
--- a/superset/mcp_service/dashboard/tool/manage_native_filters.py
+++ b/superset/mcp_service/dashboard/tool/manage_native_filters.py
@@ -452,9 +452,7 @@ def manage_native_filters(
                 request.dashboard_id, payload
             ).run()
 
-        dashboard_url = (
-            f"{get_superset_base_url()}/superset/dashboard/{request.dashboard_id}/"
-        )
+        dashboard_url = f"{get_superset_base_url()}/dashboard/{request.dashboard_id}/"
         logger.info(
             "Managed native filters on dashboard %s (added=%d updated=%d removed=%d)",
             request.dashboard_id,
diff --git a/superset/mcp_service/dashboard/tool/remove_chart_from_dashboard.py b/superset/mcp_service/dashboard/tool/remove_chart_from_dashboard.py
index 51f5a1e9f56..dc8bd80a7e2 100644
--- a/superset/mcp_service/dashboard/tool/remove_chart_from_dashboard.py
+++ b/superset/mcp_service/dashboard/tool/remove_chart_from_dashboard.py
@@ -391,7 +391,7 @@ def remove_chart_from_dashboard(  # noqa: C901 — complexity is structural (lay
                     exc_info=True,
                 )
             dashboard_url = (
-                f"{get_superset_base_url()}/superset/dashboard/{updated_dashboard.id}/"
+                f"{get_superset_base_url()}/dashboard/{updated_dashboard.id}/"
             )
             return RemoveChartFromDashboardResponse(
                 dashboard=DashboardInfo(
@@ -466,7 +466,7 @@ def remove_chart_from_dashboard(  # noqa: C901 — complexity is structural (lay
             created_on=updated_dashboard.created_on,
             changed_on=updated_dashboard.changed_on,
             uuid=str(updated_dashboard.uuid) if updated_dashboard.uuid else None,
-            url=f"{get_superset_base_url()}/superset/dashboard/{updated_dashboard.id}/",
+            url=f"{get_superset_base_url()}/dashboard/{updated_dashboard.id}/",
             chart_count=len(updated_dashboard.slices),
             tags=[
                 serialize_tag_object(tag)
@@ -486,9 +486,7 @@ def remove_chart_from_dashboard(  # noqa: C901 — complexity is structural (lay
             ],
         )
 
-        dashboard_url = (
-            f"{get_superset_base_url()}/superset/dashboard/{updated_dashboard.id}/"
-        )
+        dashboard_url = f"{get_superset_base_url()}/dashboard/{updated_dashboard.id}/"
 
         logger.info(
             "Removed chart %s from dashboard %s",
diff --git a/tests/unit_tests/mcp_service/dashboard/tool/test_duplicate_dashboard.py b/tests/unit_tests/mcp_service/dashboard/tool/test_duplicate_dashboard.py
index 15b622540d3..d321750fd1d 100644
--- a/tests/unit_tests/mcp_service/dashboard/tool/test_duplicate_dashboard.py
+++ b/tests/unit_tests/mcp_service/dashboard/tool/test_duplicate_dashboard.py
@@ -187,7 +187,7 @@ async def test_duplicate_referencing_same_charts(
     # Response text is wrapped in LLM-context delimiters (prompt-injection
     # defense), matching the standard dashboard serializers.
     assert content["dashboard"]["dashboard_title"] == _wrapped("Staging Copy")
-    assert "/superset/dashboard/2/" in content["dashboard_url"]
+    assert "/dashboard/2/" in content["dashboard_url"]
 
     # The copy data contract must mirror what the frontend "Save as" sends:
     # required json_metadata containing the source's metadata + positions.
@@ -237,7 +237,7 @@ async def test_duplicate_with_duplicate_slices(
     assert content["error"] is None
     assert content["duplicated_slices"] is True
     assert content["dashboard"]["id"] == 3
-    assert "/superset/dashboard/3/" in content["dashboard_url"]
+    assert "/dashboard/3/" in content["dashboard_url"]
 
     _, cmd_data = mock_copy_cmd_cls.call_args.args
     assert cmd_data["duplicate_slices"] is True
@@ -449,7 +449,7 @@ async def test_refetch_failure_rolls_back_and_returns_minimal_response(
     assert content["error"] is None
     assert content["dashboard"]["id"] == 7
     assert content["dashboard"]["dashboard_title"] == _wrapped("Copy")
-    assert "/superset/dashboard/7/" in content["dashboard_url"]
+    assert "/dashboard/7/" in content["dashboard_url"]
 
 
 @patch("superset.commands.dashboard.copy.CopyDashboardCommand")
diff --git a/tests/unit_tests/mcp_service/dashboard/tool/test_remove_chart_from_dashboard.py b/tests/unit_tests/mcp_service/dashboard/tool/test_remove_chart_from_dashboard.py
index f1ec37e7434..c98de5c8bee 100644
--- a/tests/unit_tests/mcp_service/dashboard/tool/test_remove_chart_from_dashboard.py
+++ b/tests/unit_tests/mcp_service/dashboard/tool/test_remove_chart_from_dashboard.py
@@ -371,7 +371,7 @@ async def test_simple_grid_removal_prunes_empty_row(
     assert content["error"] is None
     assert content["permission_denied"] is False
     assert content["dashboard_url"] is not None
-    assert "/superset/dashboard/1/" in content["dashboard_url"]
+    assert "/dashboard/1/" in content["dashboard_url"]
     assert set(content["removed_layout_keys"]) == {"CHART-aaa", "ROW-1"}
 
     dashboard_id, update_data = mock_update_cmd_cls.call_args.args