aminghadersohi opened a new pull request, #40344: URL: https://github.com/apache/superset/pull/40344
### SUMMARY Adds 4 new MCP tools across two new domains: **Action Log domain** (`superset/mcp_service/action_log/`): - `list_action_logs`: Lists audit log entries with filtering, pagination, and a default 7-day dttm window to prevent oversized result sets on large instances. Admin-only. - `get_action_log_info`: Retrieves a single log entry by integer ID. Admin-only. **Task domain** (`superset/mcp_service/task/`): - `list_tasks`: Lists async tasks. Non-admin users are automatically scoped to tasks they are subscribed to via `TaskDAO.base_filter = TaskFilter`. Admins see all tasks. Supports `search` (matched against task_type, task_key, task_name, status, scope) and column-level `filters` (mutually exclusive). - `get_task_info`: Retrieves a single task by integer ID or UUID string. Both domains follow the established `ModelListCore` / `ModelGetInfoCore` patterns from the database domain. Response field filtering via `select_columns` uses `@model_serializer` context propagation, matching the `DatabaseInfo` pattern. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF N/A — backend-only MCP tools. ### TESTING INSTRUCTIONS Run the new unit tests: ```bash pytest tests/unit_tests/mcp_service/action_log/ pytest tests/unit_tests/mcp_service/task/ ``` Key behaviors verified by tests: - `list_action_logs` injects a `dttm >= now - 7 days` ISO-string filter when no `dttm` filter is provided - `list_action_logs` skips the default filter when the caller provides a `dttm` filter - `list_action_logs` defaults to `order_column=dttm, order_direction=desc` - `list_action_logs` `filters_applied` echoes the injected filter as an ISO string (not datetime) - `list_tasks` delegates to `TaskDAO.list()` so `TaskFilter` scoping applies automatically - `get_task_info` resolves by both integer ID and UUID string - Not-found cases return structured `error_type: not_found` responses - `select_columns` filtering drops non-requested fields from the response (not null) ### ADDITIONAL INFORMATION - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration - [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: [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]
