-
Notifications
You must be signed in to change notification settings - Fork 382
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add note to NEEDS_WORK notifications. (#4684)
* Add note to NEEDS_WORK notifications. * Allow more time for creating a test feature * Commented out make_golden
- Loading branch information
Showing
7 changed files
with
96 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
# limitations under the License. | ||
from unittest import mock | ||
|
||
from api import converters | ||
from internals import notifier_helpers | ||
import testing_config # Must be imported before the module under test. | ||
from internals.core_models import FeatureEntry, Stage, MilestoneSet | ||
|
@@ -113,6 +114,28 @@ def test_vote_changes_activities__created(self, mock_task_helpers): | |
|
||
mock_task_helpers.assert_called_once() | ||
|
||
@mock.patch('framework.cloud_tasks_helpers.enqueue_task') | ||
def test_vote_changes_activities__needs_work_note(self, mock_task_helpers): | ||
"""When we notify about NEEDS_WORK, it has a process note.""" | ||
notifier_helpers.notify_subscribers_of_vote_changes( | ||
self.feature_1, self.gate_1, '[email protected]', | ||
Vote.NEEDS_WORK, Vote.NA) | ||
|
||
prop_change = { | ||
'prop_name': 'API Owners review status http://127.0.0.1:7777/feature/2925?gate=123', | ||
'old_val': 'na', | ||
'new_val': 'needs_work', | ||
'note': 'Feature owners must press the "Re-request review" button after requested changes have been completed.', | ||
} | ||
expected_params = { | ||
'changes': [prop_change], | ||
'is_update': True, | ||
'triggering_user_email': '[email protected]', | ||
'feature': converters.feature_entry_to_json_verbose(self.feature_1), | ||
} | ||
mock_task_helpers.assert_called_once_with( | ||
'/tasks/email-subscribers', expected_params) | ||
|
||
@mock.patch('framework.cloud_tasks_helpers.enqueue_task') | ||
def test_notify_subscribers_of_new_comments(self, mock_task_helpers): | ||
notifier_helpers.notify_subscribers_of_new_comments( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ | |
<section id="details" style="margin: 16px; padding: 16px; background: white; border: 2px solid #ccc; border-radius:8px;"> | ||
<div><b>Updates made by [email protected]:</b></div> | ||
<ul> | ||
<li><b>test_prop:</b><br/><b>old:</b> test <span style="background:#FDD">old</span> value<br/><b>new:</b> test <span style="background:#DFD">new</span> value<br/></li><br/> | ||
<li><b>test_prop:</b><br/><b>Old:</b> test <span style="background:#FDD">old</span> value<br/><b>New:</b> test <span style="background:#DFD">new</span> value<br/></li><br/> | ||
</ul> | ||
</section> | ||
|
||
|
43 changes: 43 additions & 0 deletions
43
internals/testdata/notifier_test/test_format_email_body__update_with_changes_and_note.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
|
||
<div style="background: #eee; padding: 0 16px 16px"> | ||
<div style="color: #666; padding: 8px 0 0 16px;">Local testing</div> | ||
|
||
<div style="padding: 8px; background: white; border-top: 4px solid #888; border-color: #01579b;"> | ||
<section id="context" style="margin: 16px; padding: 16px; background: white; border: 2px solid #ccc; border-radius:8px;"> | ||
<table> | ||
<tr> | ||
<td rowspan=2> | ||
|
||
<div style="border: 4px solid #01579b; border-radius: 50%; width: 32px; height: 32px; margin-right: 8px;"> | ||
</div> | ||
|
||
</td> | ||
<td><b>Updated</b> feature entry:</td> | ||
</tr> | ||
<tr> | ||
<td><a style="font-size: 140%;" | ||
href="http://127.0.0.1:7777/feature/123" | ||
>feature template</a> | ||
</td> | ||
</tr> | ||
</table> | ||
</section> | ||
|
||
|
||
<section id="details" style="margin: 16px; padding: 16px; background: white; border: 2px solid #ccc; border-radius:8px;"> | ||
<div><b>Updates made by [email protected]:</b></div> | ||
<ul> | ||
<li><b>test_prop:</b><br/><b>Old:</b> test <span style="background:#FDD">old</span> value<br/><b>New:</b> test <span style="background:#DFD">new</span> value<br/></li><br/><li><b>Enterprise review status URL:</b><br/><b>Old:</b> <span style="background:#FDD">review_started</span><br/><b>New:</b> <span style="background:#DFD">needs_work</span><br/><b>Note:</b> You need to press a button<br/></li><br/> | ||
</ul> | ||
</section> | ||
|
||
|
||
<section id="next-steps" style="margin: 16px; padding: 16px; background: white; border: 2px solid #ccc; border-radius:8px;"> | ||
<div><b>Your next steps:</b></div> | ||
<div style="margin: 16px;"> | ||
<a href="http://127.0.0.1:7777/feature/123" style="text-decoration: none; font-weight: bold; color: white; background: #01579b; border-radius: 8px; padding: 8px 16px; " | ||
>View feature details</a></div> | ||
</section> | ||
|
||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters