bots: Remove feedback cross realm bot.

This completes the remaining pieces of removing this missed in
d70e799466 (mostly in tests).
This commit is contained in:
Vishnu KS 2020-01-18 13:26:19 +05:30 committed by Tim Abbott
parent 122e11c678
commit 05b4610381
9 changed files with 26 additions and 39 deletions

View File

@ -6,7 +6,7 @@ There are three disjoint sets of users you care about
for typical Zulip realms:
- active users in your realm
- cross-realm users like feedback@zulip.com
- cross-realm users like welcome-bot@zulip.com
- deactivated users in your realm
You can also think in terms of these user populations:

View File

@ -143,7 +143,7 @@ casper.then(function () {
casper.then(function () {
casper.click('*[title="Narrow to your private messages with Cordelia Lear"]');
});
casper.waitUntilVisible('li[data-user-ids-string="9"].expanded_private_message.active-sub-filter', function () {
casper.waitUntilVisible('li[data-user-ids-string="8"].expanded_private_message.active-sub-filter', function () {
casper.page.sendEvent('keypress', 'c');
});

View File

@ -265,15 +265,15 @@ run_test('validate', () => {
});
run_test('get_invalid_recipient_emails', () => {
const feedback_bot = {
email: 'feedback@example.com',
const welcome_bot = {
email: 'welcome-bot@example.com',
user_id: 124,
full_name: 'Feedback Bot',
full_name: 'Welcome Bot',
};
page_params.cross_realm_bots = [feedback_bot];
page_params.cross_realm_bots = [welcome_bot];
page_params.user_id = 30;
people.initialize();
compose_state.private_message_recipient('feedback@example.com');
compose_state.private_message_recipient('welcome-bot@example.com');
assert.deepEqual(compose.get_invalid_recipient_emails(), []);
});

View File

@ -30,8 +30,7 @@
</ol>
<h2>You're done!</h2>
<p>If you have any questions, please contact us using the "Send feedback" button in Zulip or e-mail us at
<a href="mailto:{{ support_email }}">{{ support_email }}</a></p>
<p>If you have any questions, please e-mail us at <a href="mailto:{{ support_email }}">{{ support_email }}</a></p>
<h2>If you want to automatically transfer your existing Zephyr subscriptions</h2>

View File

@ -978,13 +978,13 @@ def remove_alert_words(client):
@openapi_test_function("/user_groups/create:post")
def create_user_group(client):
# type: (Client) -> None
ensure_users([7, 8, 9, 10], ['aaron', 'zoe', 'cordelia', 'hamlet'])
ensure_users([6, 7, 8, 9], ['aaron', 'zoe', 'cordelia', 'hamlet'])
# {code_example|start}
request = {
'name': 'marketing',
'description': 'The marketing team.',
'members': [7, 8, 9, 10],
'members': [6, 7, 8, 9],
}
result = client.create_user_group(request)
@ -1020,12 +1020,12 @@ def remove_user_group(client, group_id):
@openapi_test_function("/user_groups/{group_id}/members:post")
def update_user_group_members(client, group_id):
# type: (Client, int) -> None
ensure_users([9, 10, 11], ['cordelia', 'hamlet', 'iago'])
ensure_users([8, 9, 10], ['cordelia', 'hamlet', 'iago'])
request = {
'group_id': group_id,
'delete': [9, 10],
'add': [11]
'delete': [8, 9],
'add': [10]
}
result = client.update_user_group_members(request)

View File

@ -566,7 +566,7 @@ class HomeTest(ZulipTestCase):
self.assertNotIn('defunct-1@zulip.com', active_emails)
cross_bots = page_params['cross_realm_bots']
self.assertEqual(len(cross_bots), 4)
self.assertEqual(len(cross_bots), 3)
cross_bots.sort(key=lambda d: d['email'])
for cross_bot in cross_bots:
# These are either nondeterministic or boring
@ -587,14 +587,6 @@ class HomeTest(ZulipTestCase):
bot_owner_id=None,
is_bot=True
),
dict(
user_id=get_system_bot('feedback@zulip.com').id,
is_admin=False,
email='feedback@zulip.com',
full_name='Zulip Feedback Bot',
bot_owner_id=None,
is_bot=True
),
dict(
user_id=notification_bot.id,
is_admin=False,

View File

@ -349,7 +349,7 @@ class TestCrossRealmPMs(ZulipTestCase):
return get_user(email, get_realm(subdomain))
@slow("Sends a large number of messages")
@override_settings(CROSS_REALM_BOT_EMAILS=['feedback@zulip.com',
@override_settings(CROSS_REALM_BOT_EMAILS=['notification-bot@zulip.com',
'welcome-bot@zulip.com',
'support@3.example.com'])
def test_realm_scenarios(self) -> None:
@ -370,15 +370,15 @@ class TestCrossRealmPMs(ZulipTestCase):
user1a_email = 'user1a@1.example.com'
user2_email = 'user2@2.example.com'
user3_email = 'user3@3.example.com'
feedback_email = 'feedback@zulip.com'
notification_bot_email = 'notification-bot@zulip.com'
support_email = 'support@3.example.com' # note: not zulip.com
user1 = self.create_user(user1_email)
user1a = self.create_user(user1a_email)
user2 = self.create_user(user2_email)
self.create_user(user3_email)
feedback_bot = get_system_bot(feedback_email)
with self.settings(CROSS_REALM_BOT_EMAILS=['feedback@zulip.com', 'welcome-bot@zulip.com']):
notification_bot = get_system_bot(notification_bot_email)
with self.settings(CROSS_REALM_BOT_EMAILS=['notification-bot@zulip.com', 'welcome-bot@zulip.com']):
# HACK: We should probably be creating this "bot" user another
# way, but since you can't register a user with a
# cross-realm email, we need to hide this for now.
@ -396,15 +396,15 @@ class TestCrossRealmPMs(ZulipTestCase):
# (They need lower level APIs to do this.)
internal_send_private_message(
realm=r2,
sender=get_system_bot(feedback_email),
sender=get_system_bot(notification_bot_email),
recipient_user=get_user(user2_email, r2),
content='bla',
)
assert_message_received(user2, feedback_bot)
assert_message_received(user2, notification_bot)
# All users can PM cross-realm bots in the zulip.com realm
self.send_personal_message(user1_email, feedback_email, sender_realm="1.example.com")
assert_message_received(feedback_bot, user1)
self.send_personal_message(user1_email, notification_bot_email, sender_realm="1.example.com")
assert_message_received(notification_bot, user1)
# Users can PM cross-realm bots on non-zulip realms.
# (The support bot represents some theoretical bot that we may
@ -417,9 +417,9 @@ class TestCrossRealmPMs(ZulipTestCase):
# already individually send PMs to cross-realm bots, we shouldn't
# prevent them from sending multiple bots at once. We may revisit
# this if it's a nuisance for huddles.)
self.send_huddle_message(user1_email, [feedback_email, support_email],
self.send_huddle_message(user1_email, [notification_bot_email, support_email],
sender_realm="1.example.com")
assert_message_received(feedback_bot, user1)
assert_message_received(notification_bot, user1)
assert_message_received(support_bot, user1)
# Prevent old loophole where I could send PMs to other users as long
@ -431,11 +431,11 @@ class TestCrossRealmPMs(ZulipTestCase):
# Users on three different realms can't PM each other,
# even if one of the users is a cross-realm bot.
with assert_invalid_email():
self.send_huddle_message(user1_email, [user2_email, feedback_email],
self.send_huddle_message(user1_email, [user2_email, notification_bot_email],
sender_realm="1.example.com")
with assert_invalid_email():
self.send_huddle_message(feedback_email, [user1_email, user2_email],
self.send_huddle_message(notification_bot_email, [user1_email, user2_email],
sender_realm=settings.SYSTEM_BOT_REALM)
# Users on the different realms cannot PM each other

View File

@ -613,9 +613,6 @@ def create_internal_realm() -> None:
internal_realm_bots = [(bot['name'], bot['email_template'] % (settings.INTERNAL_BOT_DOMAIN,))
for bot in settings.INTERNAL_BOTS]
internal_realm_bots += [
("Zulip Feedback Bot", "feedback@zulip.com"),
]
create_users(internal_realm, internal_realm_bots, bot_type=UserProfile.DEFAULT_BOT)
# Initialize the email gateway bot as an API Super User

View File

@ -1044,7 +1044,6 @@ if PRODUCTION:
PROFILE_ALL_REQUESTS = False
CROSS_REALM_BOT_EMAILS = {
'feedback@zulip.com',
'notification-bot@zulip.com',
'welcome-bot@zulip.com',
'emailgateway@zulip.com',