Antonio-RiveroMartnez commented on code in PR #37964:
URL: https://github.com/apache/superset/pull/37964#discussion_r2846033323
##########
superset/mcp_service/mcp_config.py:
##########
@@ -75,6 +75,38 @@
"config": None, # No additional config
}
+# ---------------------------------------------------------------------------
+# Known Superset UI features that may not exist in all deployments.
+# Use these constants when configuring MCP_UNAVAILABLE_FEATURES to ensure
+# consistent naming across deployments. Custom strings are also accepted.
+# ---------------------------------------------------------------------------
+MCP_FEATURE_ACTION_LOG = "Action Log (Settings > Security > Action Log)"
+MCP_FEATURE_LIST_USERS = "List Users page (Settings > List Users)"
+MCP_FEATURE_LIST_ROLES = "List Roles page (Settings > List Roles)"
+
+# Convenience list of all known Superset-only features for reference.
+MCP_ALL_KNOWN_FEATURES: list[str] = [
+ MCP_FEATURE_ACTION_LOG,
+ MCP_FEATURE_LIST_USERS,
+ MCP_FEATURE_LIST_ROLES,
+]
+
+# Features unavailable in this deployment that LLMs should not suggest.
+# Override in superset_config.py to list features not available in your
deployment.
+# You can use the constants above or pass custom strings.
+#
+# Example using constants:
+# from superset.mcp_service.mcp_config import (
+# MCP_FEATURE_ACTION_LOG, MCP_FEATURE_LIST_USERS, MCP_FEATURE_LIST_ROLES,
+# )
+# MCP_UNAVAILABLE_FEATURES = [
+# MCP_FEATURE_ACTION_LOG, MCP_FEATURE_LIST_USERS, MCP_FEATURE_LIST_ROLES,
+# ]
+#
+# Example using custom strings:
+# MCP_UNAVAILABLE_FEATURES = ["Action Log", "Some Custom Feature"]
+MCP_UNAVAILABLE_FEATURES: list[str] = []
Review Comment:
Seems to me we are using configs for this that could be feature flags?
(enable/disable features?), also, in case you are overriding superset to
disable features, you must be already checking perms or menu access, cannot
that be reused here to known what feature/menu is available to the user in the
app?
##########
superset/mcp_service/mcp_config.py:
##########
@@ -75,6 +75,38 @@
"config": None, # No additional config
}
+# ---------------------------------------------------------------------------
+# Known Superset UI features that may not exist in all deployments.
+# Use these constants when configuring MCP_UNAVAILABLE_FEATURES to ensure
+# consistent naming across deployments. Custom strings are also accepted.
+# ---------------------------------------------------------------------------
+MCP_FEATURE_ACTION_LOG = "Action Log (Settings > Security > Action Log)"
+MCP_FEATURE_LIST_USERS = "List Users page (Settings > List Users)"
+MCP_FEATURE_LIST_ROLES = "List Roles page (Settings > List Roles)"
+
+# Convenience list of all known Superset-only features for reference.
Review Comment:
What do you mean by superset-only features?
##########
superset/mcp_service/mcp_config.py:
##########
@@ -75,6 +75,38 @@
"config": None, # No additional config
}
+# ---------------------------------------------------------------------------
+# Known Superset UI features that may not exist in all deployments.
+# Use these constants when configuring MCP_UNAVAILABLE_FEATURES to ensure
+# consistent naming across deployments. Custom strings are also accepted.
+# ---------------------------------------------------------------------------
+MCP_FEATURE_ACTION_LOG = "Action Log (Settings > Security > Action Log)"
+MCP_FEATURE_LIST_USERS = "List Users page (Settings > List Users)"
+MCP_FEATURE_LIST_ROLES = "List Roles page (Settings > List Roles)"
+
+# Convenience list of all known Superset-only features for reference.
+MCP_ALL_KNOWN_FEATURES: list[str] = [
+ MCP_FEATURE_ACTION_LOG,
Review Comment:
This is static and prone to be outdated as we add/remove features form the
app, can we infer what features are available based on the available
menus/views?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]