@@ -56,25 +56,16 @@ def before_experiment_control(
56
56
secrets : Secrets ,
57
57
channel : Optional [str ] = None ,
58
58
) -> None :
59
- extra = configuration .get ("slack_extra" )
60
59
send (
61
60
"Experiment is starting" ,
62
61
context ,
63
62
get_state (),
64
63
channel ,
65
64
in_thread = False ,
66
- extra = extra ,
67
65
configuration = configuration ,
68
66
secrets = secrets ,
69
67
)
70
68
71
- if current_msg :
72
- c = context .setdefault ("configuration" , {})
73
- c ["slack_thread" ] = {
74
- "channel" : current_msg .get ("channel" ),
75
- "ts" : current_msg .get ("ts" ),
76
- }
77
-
78
69
79
70
def after_experiment_control (
80
71
context : Experiment ,
@@ -294,7 +285,6 @@ def send(
294
285
in_thread : bool ,
295
286
thread_data : Any = None ,
296
287
thread_text : str = None ,
297
- extra : Optional [List [str ]] = None ,
298
288
configuration : Configuration = None ,
299
289
secrets : Secrets = None ,
300
290
) -> None :
@@ -308,16 +298,18 @@ def send(
308
298
if not channel :
309
299
raise InvalidActivity ("missing slack channel name" )
310
300
301
+ extra = (configuration or {}).get ("slack_extra" )
302
+
311
303
if not current_msg :
312
304
current_msg = r = client .chat_postMessage (
313
305
channel = channel ,
314
306
fallback = message ,
315
307
text = message ,
316
- extra = extra ,
317
308
attachments = attachments (
318
309
state ,
319
310
message ,
320
311
experiment ,
312
+ extra ,
321
313
),
322
314
)
323
315
elif in_thread and thread_data :
@@ -343,7 +335,7 @@ def send(
343
335
channel = current_msg .get ("channel" ),
344
336
ts = current_msg .get ("ts" ),
345
337
text = message ,
346
- attachments = attachments (state , message , experiment ),
338
+ attachments = attachments (state , message , experiment , extra ),
347
339
reply_broadcast = False ,
348
340
)
349
341
0 commit comments