Skip to content

Commit bb0a41a

Browse files
committed
Add job ident to IRC completion messages
This makes it easier to expire/retry jobs that were blocked by the website.
1 parent 9a0a8ad commit bb0a41a

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

bot/finish_message_generation.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ def generate_messages(infos)
1313
by_user.each do |user, infos|
1414
infos.each do |info|
1515
if info['aborted']
16-
list << "#{user}: Your job for #{info['url']} was aborted."
16+
list << "#{user}: Your job for #{info['url']} was aborted. #{info['ident']}"
1717
else
18-
list << "#{user}: Your job for #{info['url']} has finished."
18+
list << "#{user}: Your job for #{info['url']} has finished. #{info['ident']}"
1919
end
2020
end
2121
end

bot/finish_notifier.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
#
1212
# ArchiveBot users receive messages like this:
1313
#
14-
# someone: Your job for http://www.example.com has finished.
14+
# someone: Your job for http://www.example.com has finished. f4pg9usx4j96ki3zczwlczu51
1515
# someone: n of your jobs have finished.
1616
#
1717
# For aborted jobs, the messages are similar:
1818
#
19-
# someone: Your job for http://www.example.com was aborted.
19+
# someone: Your job for http://www.example.com was aborted. f4pg9usx4j96ki3zczwlczu51
2020
# someone: n of your jobs were aborted.
2121
#
2222
# We coalesce messages to avoid flooding channels with notifications.

pipeline/archivebot/seesaw/tasks.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ def process(self, item):
328328
'queued_at': item['queued_at'],
329329
'started_by': item['started_by'],
330330
'started_in': item['started_in'],
331+
'ident': item['ident'],
331332
'url': item['url'],
332333
'url_file': item['url_file']
333334
}

spec/bot/finish_message_generation_spec.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
it 'returns a message with the URL' do
2222
vessel.generate_messages(infos).should == {
2323
'#quux' => [
24-
'foobar: Your job for http://www.example.org has finished.'
24+
'foobar: Your job for http://www.example.org has finished. csu70nsn5y3k1jop4q6uptgyp'
2525
]
2626
}
2727
end
@@ -41,7 +41,7 @@
4141
it 'returns a message with the URL' do
4242
vessel.generate_messages(infos).should == {
4343
'#quux' => [
44-
'foobar: Your job for http://www.example.org was aborted.'
44+
'foobar: Your job for http://www.example.org was aborted. csu70nsn5y3k1jop4q6uptgyp'
4545
]
4646
}
4747
end
@@ -66,10 +66,10 @@
6666
it 'returns two messages with URLs' do
6767
vessel.generate_messages(infos).should == {
6868
'#quux' => [
69-
'foobar: Your job for http://www.example.org has finished.'
69+
'foobar: Your job for http://www.example.org has finished. csu70nsn5y3k1jop4q6uptgyp'
7070
],
7171
'#grault' => [
72-
'quxbaz: Your job for http://www.example.net has finished.'
72+
'quxbaz: Your job for http://www.example.net has finished. eywnxrf47xues9acq6xmy7xun'
7373
]
7474
}
7575
end
@@ -93,8 +93,8 @@
9393
messages_by_channel = vessel.generate_messages(infos)
9494

9595
messages_by_channel['#quux'].sort.should == [
96-
'foobar: Your job for http://www.example.net has finished.',
97-
'foobar: Your job for http://www.example.org has finished.'
96+
'foobar: Your job for http://www.example.net has finished. eywnxrf47xues9acq6xmy7xun',
97+
'foobar: Your job for http://www.example.org has finished. csu70nsn5y3k1jop4q6uptgyp'
9898
]
9999
end
100100
end
@@ -127,10 +127,10 @@
127127
messages_by_channel = vessel.generate_messages(infos)
128128

129129
messages_by_channel['#quux'].sort.should == [
130-
'foobar: Your job for http://www.example.biz was aborted.',
131-
'foobar: Your job for http://www.example.com was aborted.',
132-
'foobar: Your job for http://www.example.net has finished.',
133-
'foobar: Your job for http://www.example.org has finished.'
130+
'foobar: Your job for http://www.example.biz was aborted. 12pjidkef5awcinlco5ol57xv',
131+
'foobar: Your job for http://www.example.com was aborted. f4pg9usx4j96ki3zczwlczu51',
132+
'foobar: Your job for http://www.example.net has finished. eywnxrf47xues9acq6xmy7xun',
133+
'foobar: Your job for http://www.example.org has finished. csu70nsn5y3k1jop4q6uptgyp'
134134
]
135135
end
136136
end

0 commit comments

Comments
 (0)