From 7debf8a3d1974559ea8b99dee8d66231260ad8e9 Mon Sep 17 00:00:00 2001
From: Kyle Ju
Date: Tue, 5 Nov 2024 13:23:19 -0800
Subject: [PATCH] Simplify feature accuracy notification email (#4510)
* Change outdated feature notification emails
* Address comments
* Address more nits
---
internals/reminders.py | 15 +++--
internals/reminders_test.py | 16 ++---
...mail_tasks_escalated_feature_accuracy.html | 59 ++++++-------------
...st_build_email_tasks_feature_accuracy.html | 51 +++++-----------
...ail_tasks_feature_accuracy_enterprise.html | 51 +++++-----------
templates/accuracy_notice_email.html | 52 ++++++----------
6 files changed, 86 insertions(+), 158 deletions(-)
diff --git a/internals/reminders.py b/internals/reminders.py
index d9a130d67133..143aa6507cb7 100644
--- a/internals/reminders.py
+++ b/internals/reminders.py
@@ -40,6 +40,7 @@
WEBSTATUS_EMAIL = 'webstatus@google.com'
CBE_ESCLATION_EMAIL = 'cbe-releasenotes@google.com'
STAGING_EMAIL = 'jrobbins-test@googlegroups.com'
+EMAIL_SUBJECT_PREFIX = 'Action requested'
def get_current_milestone_info(anchor_channel: str):
@@ -101,7 +102,10 @@ def build_email_tasks(
html = render_template(body_template_path, **body_data)
subject = subject_format % fe.name
if is_escalated:
- subject = f'ESCALATED: {subject}'
+ if EMAIL_SUBJECT_PREFIX in subject:
+ subject = subject.replace(EMAIL_SUBJECT_PREFIX, 'Escalation request')
+ else:
+ subject = f'ESCALATED: {subject}'
recipients = choose_email_recipients(fe, is_escalated)
for recipient in recipients:
email_tasks.append({
@@ -223,7 +227,7 @@ class FeatureAccuracyHandler(AbstractReminderHandler):
# This grace period needs to be consistent with
# ACCURACY_GRACE_PERIOD in client-src/elements/utils.ts.
ACCURACY_GRACE_PERIOD = timedelta(weeks=4)
- SUBJECT_FORMAT = '[Action requested] Update %s'
+ SUBJECT_FORMAT = EMAIL_SUBJECT_PREFIX + ' - Verify %s'
EMAIL_TEMPLATE_PATH = 'accuracy_notice_email.html'
FUTURE_MILESTONES_TO_CONSIDER = 2
MILESTONE_FIELDS = [
@@ -270,7 +274,7 @@ def changes_after_sending_notifications(
class PrepublicationHandler(AbstractReminderHandler):
"""Give feature owners a final preview just before publication."""
- SUBJECT_FORMAT = '[Action requested] Review %s'
+ SUBJECT_FORMAT = EMAIL_SUBJECT_PREFIX + ' - Review %s'
EMAIL_TEMPLATE_PATH = 'prepublication-notice-email.html'
MILESTONE_FIELDS = [
'shipped_android_milestone',
@@ -396,7 +400,10 @@ def build_gate_email_tasks(
html = render_template(self.BODY_TEMPLATE_PATH, **body_data)
subject = self.SUBJECT_FORMAT % fe.name
if is_escalated:
- subject = f'ESCALATED: {subject}'
+ if EMAIL_SUBJECT_PREFIX in subject:
+ subject = subject.replace(EMAIL_SUBJECT_PREFIX, 'Escalation request')
+ else:
+ subject = f'ESCALATED: {subject}'
recipients = self.choose_reviewers(gate, is_escalated)
for recipient in recipients:
email_tasks.append({
diff --git a/internals/reminders_test.py b/internals/reminders_test.py
index 5c548df3737c..f2408ed51c85 100644
--- a/internals/reminders_test.py
+++ b/internals/reminders_test.py
@@ -145,7 +145,7 @@ def test_build_email_tasks_feature_accuracy(self):
handler = reminders.FeatureAccuracyHandler()
actual = reminders.build_email_tasks(
[(self.feature_template, 100)],
- '[Action requested] Update %s',
+ 'Action requested - Verify %s',
handler.EMAIL_TEMPLATE_PATH,
self.current_milestone_info,
handler.should_escalate_notification)
@@ -153,7 +153,7 @@ def test_build_email_tasks_feature_accuracy(self):
self.assertEqual(1, len(actual))
task = actual[0]
self.assertEqual('feature_owner@example.com', task['to'])
- self.assertEqual('[Action requested] Update feature one', task['subject'])
+ self.assertEqual('Action requested - Verify feature one', task['subject'])
self.assertEqual(None, task['reply_to'])
# TESTDATA.make_golden(task['html'], 'test_build_email_tasks_feature_accuracy.html')
self.assertMultiLineEqual(
@@ -164,7 +164,7 @@ def test_build_email_tasks_feature_accuracy__enterprise(self):
handler = reminders.FeatureAccuracyHandler()
actual = reminders.build_email_tasks(
[(self.feature_template, 110)],
- '[Action requested] Update %s',
+ 'Action requested - Verify %s',
handler.EMAIL_TEMPLATE_PATH,
self.current_milestone_info,
handler.should_escalate_notification)
@@ -172,7 +172,7 @@ def test_build_email_tasks_feature_accuracy__enterprise(self):
self.assertEqual(1, len(actual))
task = actual[0]
self.assertEqual('feature_owner@example.com', task['to'])
- self.assertEqual('[Action requested] Update feature one', task['subject'])
+ self.assertEqual('Action requested - Verify feature one', task['subject'])
self.assertEqual(None, task['reply_to'])
# TESTDATA.make_golden(task['html'], 'test_build_email_tasks_feature_accuracy_enterprise.html')
self.assertMultiLineEqual(
@@ -187,7 +187,7 @@ def test_build_email_tasks_feature_accuracy__escalated(self):
handler = reminders.FeatureAccuracyHandler()
actual = reminders.build_email_tasks(
[(self.feature_template, 100)],
- '[Action requested] Update %s',
+ 'Action requested - Verify %s',
handler.EMAIL_TEMPLATE_PATH,
self.current_milestone_info,
handler.should_escalate_notification)
@@ -195,7 +195,7 @@ def test_build_email_tasks_feature_accuracy__escalated(self):
self.assertEqual(5, len(actual))
task = actual[0]
self.assertEqual(
- 'ESCALATED: [Action requested] Update feature one', task['subject'])
+ 'Escalation request - Verify feature one', task['subject'])
self.assertEqual(None, task['reply_to'])
# TESTDATA.make_golden(task['html'], 'test_build_email_tasks_escalated_feature_accuracy.html')
self.assertMultiLineEqual(
@@ -205,13 +205,13 @@ def test_build_email_tasks_prepublication(self):
with test_app.app_context():
handler = reminders.PrepublicationHandler()
actual = reminders.build_email_tasks(
- [(self.feature_template, 100)], '[Action requested] Update %s',
+ [(self.feature_template, 100)], 'Action requested - Verify %s',
handler.EMAIL_TEMPLATE_PATH,
self.current_milestone_info, handler.should_escalate_notification)
self.assertEqual(1, len(actual))
task = actual[0]
self.assertEqual('feature_owner@example.com', task['to'])
- self.assertEqual('[Action requested] Update feature one', task['subject'])
+ self.assertEqual('Action requested - Verify feature one', task['subject'])
self.assertEqual(None, task['reply_to'])
# TESTDATA.make_golden(task['html'], 'test_build_email_tasks_prepublication.html')
self.assertMultiLineEqual(
diff --git a/internals/testdata/reminders_test/test_build_email_tasks_escalated_feature_accuracy.html b/internals/testdata/reminders_test/test_build_email_tasks_escalated_feature_accuracy.html
index 6aeefea63128..49894ef1b615 100644
--- a/internals/testdata/reminders_test/test_build_email_tasks_escalated_feature_accuracy.html
+++ b/internals/testdata/reminders_test/test_build_email_tasks_escalated_feature_accuracy.html
@@ -6,42 +6,20 @@
-
-
-
-
-
- |
- Your update is needed on feature entry: |
+ Your feature is slated to launch soon for M100. Please verify the accuracy of feature one: |
- feature one
+ |
+
|
-
-
-
-
- In order to ensure feature data accuracy, this notification has been
- escalated to extended contributors of this feature and to the WebStatus team.
-
-
-
-
- You are receiving this notification because you are listed as
- a contributor
- of the ChromeStatus feature entry.
-
-
-
-
- Your feature is slated to launch soon for m100:
@@ -78,23 +56,24 @@
Your feature entry is an important resource for
cross functional teams that help drive adoption of new features and
- enterprise IT admins who might be affected by web platform changes.
+ enterprise IT admins who might be affected by web platform changes. We
+ need to have a record of whether your plans are changing or staying the same.
+
+
+
- We need to know whether your plans are changing or staying
- the same. Please click the link below to update and confirm key
- fields of your feature entry.
+ In order to ensure feature data accuracy, this notification has been
+ escalated to extended contributors of this feature and to the Chromestatus team.
-
-
-
-
- Your next steps:
+
-
+
+ You are receiving this notification because you are listed as
+ a contributor
+ of the ChromeStatus feature entry.
+
diff --git a/internals/testdata/reminders_test/test_build_email_tasks_feature_accuracy.html b/internals/testdata/reminders_test/test_build_email_tasks_feature_accuracy.html
index 63d5e64e9e98..5d4dc5c06b4b 100644
--- a/internals/testdata/reminders_test/test_build_email_tasks_feature_accuracy.html
+++ b/internals/testdata/reminders_test/test_build_email_tasks_feature_accuracy.html
@@ -6,37 +6,20 @@
-
-
-
-
-
- |
- Your update is needed on feature entry: |
+ Your feature is slated to launch soon for M100. Please verify the accuracy of feature one: |
- feature one
+ |
+
|
-
-
-
-
-
- You are receiving this notification because you are listed as
- an owner
- of the ChromeStatus feature entry.
-
-
-
-
- Your feature is slated to launch soon for m100:
@@ -73,23 +56,19 @@
Your feature entry is an important resource for
cross functional teams that help drive adoption of new features and
- enterprise IT admins who might be affected by web platform changes.
-
-
-
- We need to know whether your plans are changing or staying
- the same. Please click the link below to update and confirm key
- fields of your feature entry.
+ enterprise IT admins who might be affected by web platform changes. We
+ need to have a record of whether your plans are changing or staying the same.
+
+
-
- Your next steps:
-
-
+
+ You are receiving this notification because you are listed as
+ an owner
+ of the ChromeStatus feature entry.
+
diff --git a/internals/testdata/reminders_test/test_build_email_tasks_feature_accuracy_enterprise.html b/internals/testdata/reminders_test/test_build_email_tasks_feature_accuracy_enterprise.html
index a6ee5ee07aba..10fa33c3628c 100644
--- a/internals/testdata/reminders_test/test_build_email_tasks_feature_accuracy_enterprise.html
+++ b/internals/testdata/reminders_test/test_build_email_tasks_feature_accuracy_enterprise.html
@@ -6,37 +6,20 @@
-
-
-
-
-
- |
- Your update is needed on feature entry: |
+ Your feature is slated to launch soon for M110. Please verify the accuracy of feature one: |
- feature one
+ |
+
|
-
-
-
-
-
- You are receiving this notification because you are listed as
- an owner
- of the ChromeStatus feature entry.
-
-
-
-
- Your feature is slated to launch soon for m110:
@@ -73,23 +56,19 @@
Your feature entry is an important resource for
cross functional teams that help drive adoption of new features and
- enterprise IT admins who might be affected by web platform changes.
-
-
-
- We need to know whether your plans are changing or staying
- the same. Please click the link below to update and confirm key
- fields of your feature entry.
+ enterprise IT admins who might be affected by web platform changes. We
+ need to have a record of whether your plans are changing or staying the same.
+
+
-
- Your next steps:
-
-
+
+ You are receiving this notification because you are listed as
+ an owner
+ of the ChromeStatus feature entry.
+
diff --git a/templates/accuracy_notice_email.html b/templates/accuracy_notice_email.html
index 2bf65f858312..6c4059ec58f6 100644
--- a/templates/accuracy_notice_email.html
+++ b/templates/accuracy_notice_email.html
@@ -6,24 +6,36 @@
- {{styles.icon_alert()}} |
- Your update is needed on feature entry: |
+ Your feature is slated to launch soon for M{{milestone}}. Please verify the accuracy of {{feature.name}}: |
- {{feature.name}}
+ |
+
|
+
+
+ {% include "estimated-milestones-table.html" %}
+
+
+ Your feature entry is an important resource for
+ cross functional teams that help drive adoption of new features and
+ enterprise IT admins who might be affected by web platform changes. We
+ need to have a record of whether your plans are changing or staying the same.
+
+
{% if is_escalated %}
In order to ensure feature data accuracy, this notification has been
- escalated to extended contributors of this feature and to the WebStatus team.
+ escalated to extended contributors of this feature and to the Chromestatus team.
{% endif %}
@@ -34,33 +46,5 @@
-
-
- Your feature is slated to launch soon for m{{milestone}}:
-
- {% include "estimated-milestones-table.html" %}
-
-
- Your feature entry is an important resource for
- cross functional teams that help drive adoption of new features and
- enterprise IT admins who might be affected by web platform changes.
-
-
-
- We need to know whether your plans are changing or staying
- the same. Please click the link below to update and confirm key
- fields of your feature entry.
-
-
-
-
-
-