Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bot/finish_message_generation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ def generate_messages(infos)
by_user.each do |user, infos|
infos.each do |info|
if info['aborted']
list << "#{user}: Your job for #{info['url']} was aborted."
list << "#{user}: Your job for #{info['url']} was aborted. #{info['ident']}"
else
list << "#{user}: Your job for #{info['url']} has finished."
list << "#{user}: Your job for #{info['url']} has finished. #{info['ident']}"
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions bot/finish_notifier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
#
# ArchiveBot users receive messages like this:
#
# someone: Your job for http://www.example.com has finished.
# someone: Your job for http://www.example.com has finished. f4pg9usx4j96ki3zczwlczu51
# someone: n of your jobs have finished.
#
# For aborted jobs, the messages are similar:
#
# someone: Your job for http://www.example.com was aborted.
# someone: Your job for http://www.example.com was aborted. f4pg9usx4j96ki3zczwlczu51
# someone: n of your jobs were aborted.
#
# We coalesce messages to avoid flooding channels with notifications.
Expand Down
1 change: 1 addition & 0 deletions pipeline/archivebot/seesaw/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ def process(self, item):
'queued_at': item['queued_at'],
'started_by': item['started_by'],
'started_in': item['started_in'],
'ident': item['ident'],
'url': item['url'],
'url_file': item['url_file']
}
Expand Down
20 changes: 10 additions & 10 deletions spec/bot/finish_message_generation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
it 'returns a message with the URL' do
vessel.generate_messages(infos).should == {
'#quux' => [
'foobar: Your job for http://www.example.org has finished.'
'foobar: Your job for http://www.example.org has finished. csu70nsn5y3k1jop4q6uptgyp'
]
}
end
Expand All @@ -41,7 +41,7 @@
it 'returns a message with the URL' do
vessel.generate_messages(infos).should == {
'#quux' => [
'foobar: Your job for http://www.example.org was aborted.'
'foobar: Your job for http://www.example.org was aborted. csu70nsn5y3k1jop4q6uptgyp'
]
}
end
Expand All @@ -66,10 +66,10 @@
it 'returns two messages with URLs' do
vessel.generate_messages(infos).should == {
'#quux' => [
'foobar: Your job for http://www.example.org has finished.'
'foobar: Your job for http://www.example.org has finished. csu70nsn5y3k1jop4q6uptgyp'
],
'#grault' => [
'quxbaz: Your job for http://www.example.net has finished.'
'quxbaz: Your job for http://www.example.net has finished. eywnxrf47xues9acq6xmy7xun'
]
}
end
Expand All @@ -93,8 +93,8 @@
messages_by_channel = vessel.generate_messages(infos)

messages_by_channel['#quux'].sort.should == [
'foobar: Your job for http://www.example.net has finished.',
'foobar: Your job for http://www.example.org has finished.'
'foobar: Your job for http://www.example.net has finished. eywnxrf47xues9acq6xmy7xun',
'foobar: Your job for http://www.example.org has finished. csu70nsn5y3k1jop4q6uptgyp'
]
end
end
Expand Down Expand Up @@ -127,10 +127,10 @@
messages_by_channel = vessel.generate_messages(infos)

messages_by_channel['#quux'].sort.should == [
'foobar: Your job for http://www.example.biz was aborted.',
'foobar: Your job for http://www.example.com was aborted.',
'foobar: Your job for http://www.example.net has finished.',
'foobar: Your job for http://www.example.org has finished.'
'foobar: Your job for http://www.example.biz was aborted. 12pjidkef5awcinlco5ol57xv',
'foobar: Your job for http://www.example.com was aborted. f4pg9usx4j96ki3zczwlczu51',
'foobar: Your job for http://www.example.net has finished. eywnxrf47xues9acq6xmy7xun',
'foobar: Your job for http://www.example.org has finished. csu70nsn5y3k1jop4q6uptgyp'
]
end
end
Expand Down