aminghadersohi commented on PR #40344: URL: https://github.com/apache/superset/pull/40344#issuecomment-4557412096
Thanks for the review @richardfogaca! All three issues addressed in 946bb37adb159eafe86ea2138e93bd3bc1ad395d: **Issue 1 — Config guard for action-log tools** Added `_apply_config_guards()` helper in `app.py` that mirrors `LogRestApi.is_enabled()`: if `FAB_ADD_SECURITY_VIEWS` or `SUPERSET_LOG_VIEW` is `False`, `list_action_logs` and `get_action_log_info` are removed from the MCP server before it starts advertising tools. This prevents the MCP endpoint from serving log data when the REST API would return 404. **Issue 2 — GLOBAL_TASK_FRAMEWORK gate for task tools** The same `_apply_config_guards()` helper also checks `FEATURE_FLAGS["GLOBAL_TASK_FRAMEWORK"]`. If the flag is `False` (the default), `list_tasks` and `get_task_info` are removed from the MCP server — mirroring the conditional `appbuilder.add_api(TaskRestApi)` in `initialization/__init__.py`. **Issue 3 — dttm filter as datetime object** Changed `ActionLogFilter.value` to include `datetime` in its union type (`str | int | float | bool | datetime | list[...]`). The default 7-day cutoff in `list_action_logs` now passes a `datetime` object directly instead of an ISO string, so SQLAlchemy binds the parameter as TIMESTAMP rather than VARCHAR. Pydantic's `model_dump(mode="json")` serialises it to ISO string in the response, so the `filters_applied` output is unchanged. Tests added for all three guards in `test_mcp_tool_registration.py`. -- 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]
