Skip to content
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): Added optional CC and BCC fields for email notifi… #29088

Merged
merged 12 commits into from
Jul 22, 2024

Conversation

nsivarajan
Copy link
Contributor

@nsivarajan nsivarajan commented Jun 5, 2024

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:
  • 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

@nsivarajan nsivarajan marked this pull request as ready for review June 5, 2024 10:53
@dosubot dosubot bot added the alert-reports Namespace | Anything related to the Alert & Reports feature label Jun 5, 2024
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congrats on making your first PR and thank you for contributing to Superset! 🎉 ❤️

We hope to see you in our Slack community too! Not signed up? Use our Slack App to self-register.

Copy link

codecov bot commented Jun 5, 2024

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 469 commits behind head on master.

Files Patch % Lines
.../features/alerts/components/NotificationMethod.tsx 34.37% 14 Missing and 7 partials ⚠️
...-frontend/src/features/alerts/AlertReportModal.tsx 61.90% 3 Missing and 5 partials ⚠️
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.07%) ⬇️
javascript 58.10% <45.28%> (+0.38%) ⬆️
mysql 76.91% <100.00%> (?)
postgres 76.99% <100.00%> (?)
presto 53.66% <44.44%> (-0.15%) ⬇️
python 83.69% <100.00%> (+20.20%) ⬆️
sqlite 76.48% <100.00%> (?)
unit 59.88% <44.44%> (+2.26%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nytai
Copy link
Member

nytai commented Jun 6, 2024

@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

@nsivarajan
Copy link
Contributor Author

@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?

@villebro villebro requested a review from kasiazjc June 18, 2024 18:31
Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM. However, given all the design work on this modal lately, it'd be nice to get @kasiazjc feedback on the new elements. One thing I believe I've seen elsewhere is CC and BCC are text/button like objects, and they expand into an input field when clicked, so as to save real estate when not needed.

@nsivarajan
Copy link
Contributor Author

nsivarajan commented Jun 23, 2024

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

@eschutho
Copy link
Member

eschutho commented Jun 23, 2024

@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.

@nsivarajan
Copy link
Contributor Author

@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.

@kasiazjc
Copy link
Contributor

@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!

@nsivarajan
Copy link
Contributor Author

@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

@kasiazjc
Copy link
Contributor

kasiazjc commented Jul 9, 2024

@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

@nsivarajan
Copy link
Contributor Author

@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

@villebro
Copy link
Member

@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.

@rusackas
Copy link
Member

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

@nsivarajan
Copy link
Contributor Author

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.

@villebro
Copy link
Member

/testenv up FLAG_ALERT_REPORTS=True

Copy link
Contributor

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

@eschutho
Copy link
Member

/testenv up FEATURE_ALERT_REPORTS=true

Copy link
Contributor

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

@nsivarajan
Copy link
Contributor Author

@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.

@kgabryje
Copy link
Member

/testenv up FEATURE_ALERT_REPORTS=true

Copy link
Contributor

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

@nsivarajan nsivarajan force-pushed the feature-adding-cc-bcc-in-reports branch from 9638baa to 1bc8426 Compare July 19, 2024 09:24
Copy link
Member

@kgabryje kgabryje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for addressing the feedback!

@@ -437,7 +437,7 @@ export const NotificationMethod: FunctionComponent<NotificationMethodProps> = ({
/>
{index !== 0 && !!onRemove ? (
<span
role="button"
role="delbutton"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

role attribute should only use aria roles since the application's accessibility depends on it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kgabryje ! Updated test case and validated to be success.

npm run test -- --silent src/features/alerts/components/NotificationMethod.test.tsx

 PASS  src/features/alerts/components/NotificationMethod.test.tsx

Test Suites: 1 passed, 1 total
Tests:       7 passed, 7 total
Snapshots:   0 total
Time:        4.149 s, estimated 7 s

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kgabryje

The "Python-Integration / test-mysql (pull_request)" job is failing intermittently and appears to be flaky. A retrigger or reattempt should succeed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah its definitely flaky... I re-run it, hopefully it passes now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again, @kgabryje! All tests are now successful. Please assist with merging this PR.

@kgabryje kgabryje merged commit 27dde2a into apache:master Jul 22, 2024
38 checks passed
@kgabryje
Copy link
Member

Merged, thanks for the contribution @nsivarajan!

Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

eschutho pushed a commit that referenced this pull request Jul 24, 2024
#29088)

Co-authored-by: Sivarajan Narayanan <[email protected]>
Co-authored-by: Sivarajan Narayanan <[email protected]>
sadpandajoe pushed a commit that referenced this pull request Aug 13, 2024
#29088)

Co-authored-by: Sivarajan Narayanan <[email protected]>
Co-authored-by: Sivarajan Narayanan <[email protected]>
(cherry picked from commit 27dde2a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alert-reports Namespace | Anything related to the Alert & Reports feature size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants