Vitor-Avila opened a new pull request, #44992: URL: https://github.com/apache/superset/pull/44992
### SUMMARY This PR implements [SIP-209](https://github.com/apache/superset/issues/39642). With the new `ALERT_REPORT_DYNAMIC_EXECUTOR` FF off, existing execution behavior is unchanged (fully backwards compatible). When enabled, **Run as** field controls content generation, including RLS and database OAuth2 credentials. Alerts can separately set **Run alert query as** for the SQL condition execution, or inherit **Run as**. Admins can choose a specific user or **Application default**, which uses `ALERT_REPORTS_EXECUTORS`. New schedules default to their creator, and existing schedules retain the application default until changed. Non-admins can only select themselves. When editing a schedule that runs under another identity, they can change metadata but must switch execution to their own account before changing content or recipients. The new Alerts & Reports configuration modal lets admins manage alert attachments, minimum alert and report intervals, email-subject date formatting, and recipient restrictions. All these configs fall back to the existing FF/config until a value is saved. The migration adds nullable executor references to report schedules and a UUID-keyed `report_config` table. It does not backfill or change existing schedules. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF <!--- Skip this if not applicable --> ### TESTING INSTRUCTIONS 1. Apply `superset db upgrade` and keep `ALERT_REPORT_DYNAMIC_EXECUTOR` off. Run an existing alert and report to confirm they still use `ALERT_REPORTS_EXECUTORS`. 2. Enable the flag and edit an existing schedule. Confirm **Application default** preserves its behavior. Create a schedule and confirm it defaults to the creator. As an admin, select a different **Run as** user; for an alert, choose a separate **Run alert query as** user and verify both identities are used during execution. 3. As a non-admin editor of a schedule using another identity, confirm metadata edits are allowed and content/recipient edits require **Execute using my permissions**. Confirm the user picker is unavailable. 4. Change each global setting in the configuration modal. Try a shorter-than-allowed interval and recipients excluded by the users-only and domain policies, including both policies together. Confirm conflicting existing schedules are listed and disallowed delivery is blocked. 5. Turn off **Include attachment** for an alert and save it without an asset; then turn it on and confirm an asset and attachment settings are required. Put a `strftime` placeholder in an email subject and verify the date-format setting controls rendering. ### ADDITIONAL INFORMATION - [x] Has associated issue: https://github.com/apache/superset/issues/39642. - [x] Required feature flags: `ALERT_REPORT_DYNAMIC_EXECUTOR` for per-schedule executors. - [x] Changes UI - [x] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [x] Migration is atomic, supports rollback & is backwards-compatible - [x] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [x] Introduces new feature or API: `GET`/`PUT /api/v1/report/configuration/` - [ ] 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]
