-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(alert/report): add ALERTS_ATTACH_REPORTS feature flags + feature #13894
feat(alert/report): add ALERTS_ATTACH_REPORTS feature flags + feature #13894
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quick pass
@@ -359,6 +359,7 @@ def _try_json_readsha( # pylint: disable=unused-argument | |||
"OMNIBAR": False, | |||
"DASHBOARD_RBAC": False, | |||
"ENABLE_EXPLORE_DRAG_AND_DROP": False, | |||
"ALERTS_ATTACH_REPORTS": True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: would be nice to have a small explanation here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another nit, does it make sense for this to be a feature flag? I mean ALERT_REPORTS
is a feature flag, with lot's of other configuration options that live outside the feature flag dict. Also it may be more clear to call this flag ALERTS_ATTACH_SCREENSHOT
@@ -750,6 +750,10 @@ def test_email_dashboard_report_fails( | |||
) | |||
@patch("superset.reports.notifications.email.send_email_smtp") | |||
@patch("superset.utils.screenshots.ChartScreenshot.get_screenshot") | |||
@patch.dict( | |||
"superset.extensions.feature_flag_manager._feature_flags", | |||
ALERTS_ATTACH_REPORTS=True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add some tests for the inverse so we have confidence that everything works as expected with the feature flag disabled as well.
Codecov Report
@@ Coverage Diff @@
## master #13894 +/- ##
==========================================
- Coverage 77.53% 77.01% -0.52%
==========================================
Files 935 938 +3
Lines 47319 47727 +408
Branches 5907 6039 +132
==========================================
+ Hits 36689 36758 +69
- Misses 10486 10826 +340
+ Partials 144 143 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a small comment
@@ -359,6 +359,7 @@ def _try_json_readsha( # pylint: disable=unused-argument | |||
"OMNIBAR": False, | |||
"DASHBOARD_RBAC": False, | |||
"ENABLE_EXPLORE_DRAG_AND_DROP": False, | |||
"ALERTS_ATTACH_REPORTS": True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another nit, does it make sense for this to be a feature flag? I mean ALERT_REPORTS
is a feature flag, with lot's of other configuration options that live outside the feature flag dict. Also it may be more clear to call this flag ALERTS_ATTACH_SCREENSHOT
@dpgaspar we're actually adding a CSV attachment type, so "SCREENSHOT" is soon to be an inaccurate term, hence the "REPORT" language. Not perfect either way I suppose. The additional feature flag was a simple way to accomplish the task - I'm also not sure if this will continue being an option or not at this point, and I think we may have a little more flexibility with feature flags at release time than configuration. |
…apache#13894) * Add a feature flag ALERTS_ATTACH_REPORTS * update test * update feature flag * add comment for feature flag * add unit tests for alerts with attachments disabled * fix lint Co-authored-by: samtfm <sam@preset.io> (cherry picked from commit 7621010)
* master: (26 commits) chore: bump to new superset-ui version (#13932) fix: do not run containers as root by default in Helm chart (#13917) feat(explore): adhoc column formatting for Table chart (#13758) fix(sqla-query): order by aggregations in Presto and Hive (#13739) feat(alert/report): add ALERTS_ATTACH_REPORTS feature flags + feature (#13894) test: Fixes PropertiesModal_spec (#13548) fix: Pin Prophet dependency after breaking changes (#13852) test: Adds tests to dnd controls (#13650) test: Adds tests to the AnnotationLayer component (#13748) test: Refactor and enhance tests for the Explore DatasourcePanel Component (#13799) Add tests (#13778) test: DisplayQueryButton (#13750) Fixing condition around left margin for dashboard layout. Fixes #13863 (#13905) Revert "fix: select table overlay (#13694)" (#13901) test: Adds tests to the OptionControls component (#13729) test: DatasourceControl (#13605) tests for function handleScroll (#13896) test: Adds tests to the CustomFrame component (#13675) test: Adds tests to the AdvancedFrame component (#13664) test: DataTableControl (#13668) ...
…apache#13894) * Add a feature flag ALERTS_ATTACH_REPORTS * update test * update feature flag * add comment for feature flag * add unit tests for alerts with attachments disabled * fix lint Co-authored-by: samtfm <sam@preset.io> (cherry picked from commit 7621010)
…apache#13894) * Add a feature flag ALERTS_ATTACH_REPORTS * update test * update feature flag * add comment for feature flag * add unit tests for alerts with attachments disabled * fix lint Co-authored-by: samtfm <sam@preset.io>
…apache#13894) * Add a feature flag ALERTS_ATTACH_REPORTS * update test * update feature flag * add comment for feature flag * add unit tests for alerts with attachments disabled * fix lint Co-authored-by: samtfm <sam@preset.io>
SUMMARY
Add a feature flag to control dashboard and chart for disabling the screenshot for emails + slack
when
ALERTS_ATTACH_REPORTS = True
(behaves as it does now):type: alert
: emails+slack of chart and dashboard include screenshot + urltype: report
: emails+slack of chart and dashboard include screenshot + urlwhen
ALERTS_ATTACH_REPORTS = False
:type: alert
: system DOES NOT generate screenshot; emails+slack of chart and dashboard include url onlytype: report
: emails+slack of chart and dashboard include screenshot + urlBEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TEST PLAN
ADDITIONAL INFORMATION
cc: @samtfm