superset icon indicating copy to clipboard operation
superset copied to clipboard

feat(alert/report): Added optional CC and BCC fields for email notifi…

Open nsivarajan opened this issue 1 year ago • 7 comments

SUMMARY

Addition of an option to provide cc and bcc list for email notifications along with email validation under Alerts and Reports.

SAMPLE SCREENSHOT

image

TESTING INSTRUCTIONS

  • Open Superset in browser > Click on the "Settings" menu on top right > Click on "Alerts & Reports"
  • Create a new alert/report or edit an existing alert/report. Enter the required details.
  • Select "Email" as the preferred notification method.
  • Enter valid/invalid email ids in the To field, CC and BCC fields and hit add/save to test the feature.

CONTRIBUTORS

nsivarajan, episkey24

ADDITIONAL INFORMATION

  • [ ] Has associated issue:
  • [ ] Required feature flags:
  • [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
  • [X] Introduces new feature or API
  • [ ] Removes existing feature or API

nsivarajan avatar Jun 05 '24 10:06 nsivarajan

Codecov Report

Attention: Patch coverage is 53.22581% with 29 lines in your changes missing coverage. Please review.

Project coverage is 70.40%. Comparing base (76d897e) to head (17b2cbe). Report is 1701 commits behind head on master.

Files with missing lines Patch % Lines
.../features/alerts/components/NotificationMethod.tsx 34.37% 14 Missing and 7 partials :warning:
...-frontend/src/features/alerts/AlertReportModal.tsx 61.90% 3 Missing and 5 partials :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #29088      +/-   ##
==========================================
+ Coverage   60.48%   70.40%   +9.91%     
==========================================
  Files        1931     1969      +38     
  Lines       76236    78901    +2665     
  Branches     8568     9009     +441     
==========================================
+ Hits        46114    55547    +9433     
+ Misses      28017    21142    -6875     
- Partials     2105     2212     +107     
Flag Coverage Δ
hive 49.10% <44.44%> (-0.06%) :arrow_down:
javascript 58.10% <45.28%> (∅)
mysql 76.91% <100.00%> (?)
postgres 76.99% <100.00%> (?)
presto 53.66% <44.44%> (-0.15%) :arrow_down:
python 83.69% <100.00%> (+20.19%) :arrow_up:
sqlite 76.48% <100.00%> (?)
unit 59.88% <44.44%> (+2.25%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Jun 05 '24 17:06 codecov[bot]

@nsivarajan can you please describe why this features is useful and what problem it's solving? I'm not sure it's clear why having someone cc'd on the notification email would be any different than just adding directly to the recipients list. For BCC I can see a use case where someone would silently like to know if the report is delivered as expected, but are there any others?

Please address the failing checks and add some unit/integration tests for this functionality

nytai avatar Jun 06 '24 02:06 nytai

@nytai Thanks for raising these points. In our use of Superset's alerts and reports feature, TO recipients receive actionable items, CC recipients—including leadership, hierarchical levels, and cross-functional teams—benefit from increased visibility into the communication without being directly responsible for action, while BCC recipients discreetly monitor email delivery and processes.

I've addressed the failing checks and added test cases,Could you please assist with triggering the workflow/checks again?

nsivarajan avatar Jun 08 '24 06:06 nsivarajan

@kasiazjc Could you please assist with the review of this PR when you have a moment? Your feedback would be greatly appreciated.

nsivarajan avatar Jun 23 '24 05:06 nsivarajan

@nsivarajan curious if you're looking for cc/bcc for each report, or if you want the same cc/bcc list for all reports. If it's the latter, there's a recent feature that would allow you to add cc to all emails. We could also add a bcc there.

eschutho avatar Jun 23 '24 21:06 eschutho

@eschutho Thanks for checking. Each report will have its own configurable CC and BCC recipients, allowing for specific recipients to be designated as needed.

For example, the Sales dashboard will have its own CC and BCC recipients, and similarly, the Manufacturing dashboard will have its own CC and BCC recipients. This approach provides flexibility and ensures that the appropriate people are included for each report.

nsivarajan avatar Jun 24 '24 04:06 nsivarajan

@kasiazjc Could you please assist with the review of this PR when you have a moment? Your feedback would be greatly appreciated.

Hi, thanks for this change! In terms of design, some general things:

  • we don't need "optional" in the label, as already the required fields are marked with "*", so it's one or the other
  • metadata text should be under the email field, not subject

Flow changes - agree with @villebro that we should save space and use "ghost/inline buttons", visual specs for these are:

  • 12px font
  • icon "mail" from ant-d; size of the icon 12px x 12px
  • spacing between the label and icon 4px
  • spacing between two buttons 16px

In terms of behavior: when you click on the button, it shows the field. There is no way to close it (not to overcomplicate), but if it's saved empty, when you open the modal back again it goes back to being a button

image

Hope this works, let me know!

kasiazjc avatar Jun 28 '24 07:06 kasiazjc

@kasiazjc Thank you for your great suggestions and detailed review! I've incorporated the feedback and completed the changes with a commit.

Could you please assist with reviewing the PR to ensure everything aligns correctly? Your help in getting this merged would be greatly appreciated.

Screenshot 2024-07-08 at 10 04 37 PM Screenshot 2024-07-08 at 10 06 07 PM Screenshot 2024-07-08 at 10 07 38 PM Screenshot 2024-07-08 at 10 08 50 PM

nsivarajan avatar Jul 08 '24 16:07 nsivarajan

@kasiazjc Thank you for your great suggestions and detailed review! I've incorporated the feedback and completed the changes with a commit.

Could you please assist with reviewing the PR to ensure everything aligns correctly? Your help in getting this merged would be greatly appreciated.

Screenshot 2024-07-08 at 10 04 37 PM Screenshot 2024-07-08 at 10 06 07 PM Screenshot 2024-07-08 at 10 07 38 PM Screenshot 2024-07-08 at 10 08 50 PM

Thank you for the changes, this looks good! I have two small things:

  • I think envelope icon might be bigger than 12px, can you make it smaller? Also align both text and icon to the center (should be looking similar to the "button" below with "+ add new notification method"
  • when you add one field, the button is not aligned to the left "add bcc..." and there is some space left, can it be in one line with all of the other fields etc aligned to the left? image
image

kasiazjc avatar Jul 09 '24 15:07 kasiazjc

@kasiazjc

Thank you for your feedback! I've incorporated the requested adjustments into the PR.

Could you please review the changes once more to confirm they meet the requirements? Additionally, I would appreciate your assistance in merging this PR.

Screenshot 2024-07-10 at 2 01 32 PM Screenshot 2024-07-10 at 4 30 45 PM Screenshot 2024-07-10 at 4 33 03 PM

nsivarajan avatar Jul 10 '24 11:07 nsivarajan

@nsivarajan I've started CI and I'll start an eph env once the Docker image is ready so we can poke around on the modal.

villebro avatar Jul 11 '24 17:07 villebro

restarted some failing tests... hoping they're just flaky 🤞

rusackas avatar Jul 11 '24 23:07 rusackas

Thanks @rusackas,

The Python-Integration tests for test-mysql (pull_request) and test-postgres (current) (pull_request) are failing, although both passed successfully on my local setup. A retrigger should resolve this.

Appreciate your assistance.

nsivarajan avatar Jul 12 '24 02:07 nsivarajan

/testenv up FLAG_ALERT_REPORTS=True

villebro avatar Jul 12 '24 09:07 villebro

@villebro Ephemeral environment spinning up at http://34.218.252.68:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

github-actions[bot] avatar Jul 12 '24 09:07 github-actions[bot]

/testenv up FEATURE_ALERT_REPORTS=true

eschutho avatar Jul 15 '24 20:07 eschutho

@eschutho Ephemeral environment spinning up at http://54.184.34.192:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

github-actions[bot] avatar Jul 15 '24 20:07 github-actions[bot]

@villebro @eschutho Thank you for spinning up the ephemeral environment. Could you please review and assist with merging this PR? Your support in moving this forward would be greatly appreciated.

nsivarajan avatar Jul 17 '24 03:07 nsivarajan

/testenv up FEATURE_ALERT_REPORTS=true

kgabryje avatar Jul 18 '24 11:07 kgabryje

@kgabryje Ephemeral environment spinning up at http://54.245.193.57:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

github-actions[bot] avatar Jul 18 '24 11:07 github-actions[bot]

Merged, thanks for the contribution @nsivarajan!

kgabryje avatar Jul 22 '24 17:07 kgabryje

Ephemeral environment shutdown and build artifacts deleted.

github-actions[bot] avatar Jul 22 '24 17:07 github-actions[bot]