меншин групп слак в случае возникновения проблем
This commit is contained in:
parent
f511d19d52
commit
6fac6409e5
17
atf.inc.php
17
atf.inc.php
|
@ -836,11 +836,24 @@ class ATFPlan
|
||||||
if($item['error'] == ATFTask::CODE_EXCEPTION)
|
if($item['error'] == ATFTask::CODE_EXCEPTION)
|
||||||
$slack_msg = "```$slack_msg```";
|
$slack_msg = "```$slack_msg```";
|
||||||
|
|
||||||
|
$problem = $item['error'] == ATFTask::CODE_EXCEPTION || $item['error'] == ATFTask::CODE_STUCK;
|
||||||
|
|
||||||
$slack_msg = '('.round($item['time'],1).'s) '.$slack_msg.' *'.$task->device.'*';
|
$slack_msg = '('.round($item['time'],1).'s) '.$slack_msg.' *'.$task->device.'*';
|
||||||
|
|
||||||
$resp = atf_slack_post($slack_msg, array('thread_ts' => $task->slack_thread_ts));
|
$mentions = getor("ATF_PROBLEM_MENTION_GROUPS", null);
|
||||||
|
if($mentions !== null && $problem && strlen($mentions) > 0)
|
||||||
|
{
|
||||||
|
$mentions = explode(",", $mentions);
|
||||||
|
$groups = "";
|
||||||
|
foreach($mentions as $mention)
|
||||||
|
$groups .= '<!subteam^'.$mention.'> '; //<!subteam^ID>
|
||||||
|
|
||||||
if(isset($resp['ok']) && $item['error'] == ATFTask::CODE_EXCEPTION || $item['error'] == ATFTask::CODE_STUCK)
|
if(strlen($groups) > 0)
|
||||||
|
$slack_msg = $groups."\n".$slack_msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
$resp = atf_slack_post($slack_msg, array('thread_ts' => $task->slack_thread_ts));
|
||||||
|
if(isset($resp['ok']) && $problem)
|
||||||
$this->session->tryShareToQAChannel($resp['ts'], $orig_msg);
|
$this->session->tryShareToQAChannel($resp['ts'], $orig_msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue