Vitor-Avila opened a new pull request, #28176: URL: https://github.com/apache/superset/pull/28176
### SUMMARY It's currently possible to create alerts and reports configured to be executed every minute. While it might be a suitable implementation for some use-cases, some users might create assets with a more recurrent frequency needed, leading to additional load to the DB which can cause slowness, timeouts, etc. This PR introduces two configs that can be specified in `superset_config.py`: ``` python # Set a minimum interval threshold between executions (for each Alert/Report) # Value should be the amount of minutes (integer). Min: 1, Max: 60 ALERT_MINIMUM_INTERVAL_MINUTES = None REPORT_MINIMUM_INTERVAL_MINUTES = None ``` This minimum interval is validated for both creation of new reports and also the modification of existing ones. Note that this PR doesn't include a migration, so changing this config won't automatically change existing reports. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF No UI changes. ### TESTING INSTRUCTIONS Both integration and unit tests added. For manual testing: 1. Specify a minimum interval in config: ``` python ALERT_MINIMUM_INTERVAL_MINUTES = 2 REPORT_MINIMUM_INTERVAL_MINUTES = 2 ``` 2. Try creating a report/alert that exceeds this limit. ### ADDITIONAL INFORMATION - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [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]
