Antonio-RiveroMartnez opened a new pull request, #44426:
URL: https://github.com/apache/superset/pull/44426
### SUMMARY
Separate Global Task Framework installation from request-time feature
enablement.
- Add `GLOBAL_TASK_FRAMEWORK_ENABLED = False` as explicit, process-wide
deployment configuration. Task API/view, TaskManager and task MCP installation
use this setting, not a runtime feature-flag decision. No compatibility
inference from static or dynamic flags.
- Require deployment configuration **and** effective `GLOBAL_TASK_FRAMEWORK`
for Task API access, direct page/menu access, synchronous/asynchronous wrapper
admission, the shared submission command, and MCP invocation. Existing
authentication, Task permissions and subscription filters are unchanged.
- Require installed infrastructure and effective GTF/GAQ flags before
selecting asynchronous chart execution; otherwise retain synchronous execution.
Leave FeatureFlagManager and its GAQ-implies-GTF derivation unchanged.
- Expose the deployment boolean in public bootstrap configuration; gate the
task list and async-query UI/request predicates explicitly.
- Document the breaking configuration change and lifecycle contract: stop
new submissions and drain work before disabling effective GTF.
Polling/cancellation are gated too, while workers can finish admitted work.
Admission audit: both wrapper paths and `TaskManager.submit_task` converge
on `SubmitTaskCommand.run_with_info`. `TaskDAO.create_task` is the persistence
primitive called by that command, not an independent scheduling entry point.
Worker execution uses the registered executor directly and does not re-enter
admission. Frontend response/completion handling remains intact for requests
already admitted.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Not included: this changes availability predicates, not the enabled UI
layout. The Task List disabled-state rendering is covered by a component test;
no live browser validation was performed.
### TESTING INSTRUCTIONS
1. Start with each combination of `GLOBAL_TASK_FRAMEWORK_ENABLED` and
effective `GLOBAL_TASK_FRAMEWORK`. Config-off must not install task
routes/tools. Config-on must install them regardless of the runtime flag.
2. With config on, switch a dynamic runtime flag off/on/off without
restarting. Verify API access (including `_info`, list/detail,
related/distinct, polling and cancellation), direct `/tasks/list/`, menu
visibility and MCP invocation follow the runtime decision without changing
route/permission registration. Existing RBAC/subscriber restrictions must still
apply when enabled.
3. Submit chart requests with `async_mode=true`. Config-off, or a customized
resolver returning GAQ true/GTF false, must use synchronous execution rather
than return 202. With all prerequisites present, check cached and cold-cache
queries, authenticated/guest identities, Task-read grants and task failures.
4. Admit a task, disable the effective runtime flag, and verify its worker
can reach a terminal state while user-facing task access is denied. For
operational rollout, drain first rather than using this as the normal disable
procedure.
5. Run migrations and permission synchronization with matching deployment
configuration, then restart web/worker/MCP processes. Verify both clean and
existing metadata databases before deployment.
Automated validation:
- `pytest -q tests/unit_tests/tasks
tests/unit_tests/charts/test_chart_data_api.py
tests/unit_tests/mcp_service/test_mcp_tool_registration.py
tests/unit_tests/mcp_service/task/tool/test_task_tools.py` — **605 passed**.
- `pytest -q tests/unit_tests/tasks/test_runtime_config.py` after the final
synchronous-fallback cases — **33 passed** (overlaps the suite above).
- From `superset-frontend`: `npx jest --runInBand --silent
src/dashboard/components/PropertiesModal/PropertiesModal.test.tsx
src/utils/asyncMode.test.ts src/pages/TaskList/TaskList.test.tsx` — **31
passed**.
- `pre-commit run` on staged changes — all applicable hooks passed **except
frontend type-checking**. That check reports unbuilt workspace declaration
outputs (`TS6305`, including core/chart-controls) and related type errors; it
is not claimed passing. Frontend formatting/lint/custom-rules/stylelint and
Python mypy/ruff passed.
- Direct pylint on changed backend source files — passed (10.00/10). `git
diff --check` — passed.
Validation limitations: no running local Superset service, live Celery/Redis
workflow, browser smoke test, or clean/existing metadata-database permission
provisioning test. Frontend tests ran on Node 22 rather than the repository's
Node 24 toolchain. Python test dependencies were installed without optional
native MySQL/LDAP/SASL packages because their system build prerequisites were
unavailable. Full integration and frontend type-check validation remain
required.
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [x] Required feature flags: existing `GLOBAL_TASK_FRAMEWORK`;
`GLOBAL_ASYNC_QUERIES` for async charts. Both also require
`GLOBAL_TASK_FRAMEWORK_ENABLED=True`.
- [x] 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
Breaking deployment configuration change; no schema or permission-name
migration. This PR remains draft pending full integration validation.
--
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]