@@ -271,7 +271,7 @@ def buildDivider(cls) -> dict:
271271 Returns:
272272 dict: Slack block kit divider element
273273 """
274- def createThreadConfigMap (cls , namespace : str , instanceId : str , pipelineRunName : str ) -> bool :
274+ def createThreadConfigMap (cls , namespace : str , channelId : str , threadId : str , instanceId : str ) -> bool :
275275 """
276276 Create a ConfigMap to store Slack thread information for a pipeline run.
277277
@@ -291,14 +291,15 @@ def createThreadConfigMap(cls, namespace: str, instanceId: str, pipelineRunName:
291291 except Exception :
292292 config .load_kube_config ()
293293 v1 = client .CoreV1Api ()
294- configmap_name = f"slack-thread-{ instanceId } - { pipelineRunName } "
294+ configmap_name = f"slack-thread-{ instanceId } "
295295 configmap = client .V1ConfigMap (
296296 metadata = client .V1ObjectMeta (
297297 name = configmap_name ,
298298 namespace = namespace
299299 ),
300300 data = {
301- "pipelineName" : pipelineRunName ,
301+ "threadId" : threadId ,
302+ "channelId" : channelId ,
302303 "instanceId" : instanceId ,
303304 "startTime" : datetime .now (timezone .utc )
304305 }
@@ -310,7 +311,7 @@ def createThreadConfigMap(cls, namespace: str, instanceId: str, pipelineRunName:
310311 logger .error (f"Failed to create ConfigMap: { e } " )
311312 return False
312313
313- def getThreadConfigMap (cls , namespace : str , instanceId : str , pipelineRunName : str ) -> dict | None :
314+ def getThreadConfigMap (cls , namespace : str , instanceId : str ) -> dict | None :
314315 """
315316 Retrieve Slack thread information from a ConfigMap.
316317
@@ -328,7 +329,7 @@ def getThreadConfigMap(cls, namespace: str, instanceId: str, pipelineRunName: st
328329 except Exception :
329330 config .load_kube_config ()
330331 v1 = client .CoreV1Api ()
331- configmap_name = f"slack-thread-{ instanceId } - { pipelineRunName } "
332+ configmap_name = f"slack-thread-{ instanceId } "
332333 configmap = v1 .read_namespaced_config_map (name = configmap_name , namespace = namespace )
333334 logger .debug (f"Retrieved ConfigMap { configmap_name } from namespace { namespace } " )
334335 return configmap .data
@@ -342,7 +343,7 @@ def getThreadConfigMap(cls, namespace: str, instanceId: str, pipelineRunName: st
342343 logger .error (f"Failed to retrieve ConfigMap: { e } " )
343344 return None
344345
345- def updateThreadConfigMap (cls , namespace : str , instanceId : str , updates : dict , pipelineRunName : str ) -> bool :
346+ def updateThreadConfigMap (cls , namespace : str , instanceId : str , updates : dict ) -> bool :
346347 """
347348 Update the ConfigMap with additional data (e.g., task message timestamps).
348349
@@ -361,7 +362,7 @@ def updateThreadConfigMap(cls, namespace: str, instanceId: str, updates: dict, p
361362 except Exception :
362363 config .load_kube_config ()
363364 v1 = client .CoreV1Api ()
364- configmap_name = f"slack-thread-{ instanceId } - { pipelineRunName } "
365+ configmap_name = f"slack-thread-{ instanceId } "
365366
366367 # Get existing ConfigMap
367368 configmap = v1 .read_namespaced_config_map (name = configmap_name , namespace = namespace )
@@ -379,7 +380,7 @@ def updateThreadConfigMap(cls, namespace: str, instanceId: str, updates: dict, p
379380 logger .error (f"Failed to update ConfigMap: { e } " )
380381 return False
381382
382- def deleteThreadConfigMap (cls , namespace : str , instanceId : str , pipelineRunName : str ) -> bool :
383+ def deleteThreadConfigMap (cls , namespace : str , instanceId : str ) -> bool :
383384 """
384385 Delete the ConfigMap containing Slack thread information.
385386
@@ -398,7 +399,7 @@ def deleteThreadConfigMap(cls, namespace: str, instanceId: str, pipelineRunName:
398399 config .load_kube_config ()
399400
400401 v1 = client .CoreV1Api ()
401- configmap_name = f"slack-thread-{ instanceId } - { pipelineRunName } "
402+ configmap_name = f"slack-thread-{ instanceId } "
402403 v1 .delete_namespaced_config_map (name = configmap_name , namespace = namespace )
403404 logger .info (f"Deleted ConfigMap { configmap_name } from namespace { namespace } " )
404405 return True
0 commit comments