Notify for ship-it revocations

Review Request #12045 — Created Feb. 4, 2022 and updated

gdehal
Review Board
master
reviewboard
  • Create boolean field in admin page for email
  • Connect handler to revoke signal
  • Prepare ship-it revoked email message
  • Create new email template for text and HTML
  • Modified email settings tests to include the new field.
  • Added email test to verify that the email has actually been sent and contains the right text.
Summary
Create boolean field in admin page for email
Connect handler to revoke signal
Prepare ship-it revoked email message
Add ship-it revoked email template
Add tests and docstrings
Addressed review comments
Changed label text
Description From Last Updated

F401 'importlib' imported but unused

reviewbotreviewbot

F401 'django.utils.six' imported but unused

reviewbotreviewbot

E501 line too long (87 > 79 characters)

reviewbotreviewbot

E302 expected 2 blank lines, found 1

reviewbotreviewbot

E302 expected 2 blank lines, found 1

reviewbotreviewbot

W291 trailing whitespace

reviewbotreviewbot

F401 'reviewboard.reviews.views.build_diff_comment_fragments' imported but unused

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

This should probably use the "Re:" logic from prepare_review_request_mail

daviddavid

F401 'reviewboard.reviews.models.review_request' imported but unused

reviewbotreviewbot

E231 missing whitespace after ','

reviewbotreviewbot

F811 redefinition of unused 'review_request' from line 17

reviewbotreviewbot

Would it be clearer to write the label as "Send e-mails to users when the reviews' ship-it status are revoked"?

sheenaNgsheenaNg

It looks good! One suggestion, could you include docstring for this method similar to other methods in this module?

sheenaNgsheenaNg

Could you also include docstring for this method?

sheenaNgsheenaNg

Is this supposed to be review.REVOKED_SHIP_IT_TEXT?

sheenaNgsheenaNg

I noticed that you included On {{review_request.time_emailed}}, {{review_request.submitter|user_displayname}} wrote: {% quoted_email "notifications/review_request_email.txt" %}} in the email.txt template. I wonder if …

sheenaNgsheenaNg

Please add a class docstring.

daviddavid

The description needs to go on the next line.

daviddavid

The description needs to go on the next line.

daviddavid

E501 line too long (81 > 79 characters)

reviewbotreviewbot

Description for the return type doesn't need to be indented (align with EmailMessage)

daviddavid

This needs a trailing comma. Please also use single quotes.

daviddavid

E501 line too long (81 > 79 characters)

reviewbotreviewbot

E501 line too long (80 > 79 characters)

reviewbotreviewbot

E501 line too long (81 > 79 characters)

reviewbotreviewbot
gdehal
Review request changed

Commits:

Summary
-
Create boolean field in admin page for email
+
Create boolean field in admin page for email
+
Connect handler to revoke signal

Diff:

Revision 2 (+2432 -1050)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

gdehal
Review request changed

Description:

   
  • Create boolean field in admin page for email
  +
  • Connect handler to revoke signal

Commits:

Summary
-
Create boolean field in admin page for email
-
Connect handler to revoke signal
+
Create boolean field in admin page for email
+
Connect handler to revoke signal

Diff:

Revision 3 (+140 -6)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

gdehal
Review request changed

Description:

   
  • Create boolean field in admin page for email
   
  • Connect handler to revoke signal
  +
  • Prepare ship-it revoked email message

Commits:

Summary
-
Create boolean field in admin page for email
-
Connect handler to revoke signal
+
Create boolean field in admin page for email
+
Connect handler to revoke signal
+
Prepare ship-it revoked email message

Diff:

Revision 4 (+265 -13)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

david
  1. Looks like everything is on the right track!

  2. This should probably use the "Re:" logic from prepare_review_request_mail

  3. 
      
gdehal
gdehal
sheenaNg
  1. 
      
  2. Would it be clearer to write the label as "Send e-mails to users when the reviews' ship-it status are revoked"?

  3. It looks good! One suggestion, could you include docstring for this method similar to other methods in this module?

  4. Could you also include docstring for this method?

  5. I noticed that the send_review_published_mail signal handler includes a parameter called to_owner_only that indicates whether or not the mail should only be sent to the review request
    submitter.
    I am just curious of why this field is not added to this method to enable the option to send it to the submitter only?

    1. Mainly because the signal does not come with this flag since in the UI there is no ability to select that option at this time.

  6. Is this supposed to be review.REVOKED_SHIP_IT_TEXT?

    1. No, I could have used that but for the HTML template I've opted to use strikethrough text with CSS.

  7. I noticed that you included
    On {{review_request.time_emailed}}, {{review_request.submitter|user_displayname}} wrote: {% quoted_email "notifications/review_request_email.txt" %}} in the email.txt template.

    I wonder if you should also include that in the .html similar to what is shown in the review_email.html block footer?

  8. 
      
gdehal
Review request changed

Testing Done:

   
  • Modified email settings tests to include the new field.
  +
  • Added email test to verify that the email has actually been sent and contains the right text.

Commits:

Summary
-
Create boolean field in admin page for email
-
Connect handler to revoke signal
-
Prepare ship-it revoked email message
-
Add ship-it revoked email template
+
Create boolean field in admin page for email
+
Connect handler to revoke signal
+
Prepare ship-it revoked email message
+
Add ship-it revoked email template
+
Add tests and docstrings

Diff:

Revision 6 (+687 -17)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

david
  1. 
      
  2. reviewboard/extensions/hooks.py (Diff revision 6)
     
     

    Please add a class docstring.

  3. reviewboard/extensions/hooks.py (Diff revision 6)
     
     

    The description needs to go on the next line.

  4. reviewboard/extensions/hooks.py (Diff revision 6)
     
     

    The description needs to go on the next line.

  5. reviewboard/notifications/email/message.py (Diff revision 6)
     
     
     

    Description for the return type doesn't need to be indented (align with EmailMessage)

  6. This needs a trailing comma. Please also use single quotes.

  7. 
      
gdehal
Review request changed

Commits:

Summary
-
Create boolean field in admin page for email
-
Connect handler to revoke signal
-
Prepare ship-it revoked email message
-
Add ship-it revoked email template
-
Add tests and docstrings
+
Create boolean field in admin page for email
+
Connect handler to revoke signal
+
Prepare ship-it revoked email message
+
Add ship-it revoked email template
+
Add tests and docstrings
+
Addressed review comments

Diff:

Revision 7 (+736 -26)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

gdehal
Review request changed

Commits:

Summary
-
Create boolean field in admin page for email
-
Connect handler to revoke signal
-
Prepare ship-it revoked email message
-
Add ship-it revoked email template
-
Add tests and docstrings
-
Addressed review comments
+
Create boolean field in admin page for email
+
Connect handler to revoke signal
+
Prepare ship-it revoked email message
+
Add ship-it revoked email template
+
Add tests and docstrings
+
Addressed review comments
+
Changed label text

Diff:

Revision 8 (+737 -27)

Show changes

Checks run (2 succeeded)

flake8 passed.
JSHint passed.
Loading...