Fix merge same title of security issue

This commit is contained in:
Laurent Destailleur 2024-04-07 11:46:12 +02:00
parent 0e5440f256
commit fa43938f76

View file

@ -126,7 +126,7 @@ if ($dirscc != 'disabled') {
exec($commandcheck, $output_arrdep, $resexecdep);
}
// Get technical debt
// Get technical debt with PHPStan
$output_arrtd = array();
if ($dirphpstan != 'disabled') {
$commandcheck = ($dirphpstan ? $dirphpstan.'/' : '').'phpstan --level='.$phpstanlevel.' -v analyze -a build/phpstan/bootstrap.php --memory-limit 5G --error-format=github';
@ -135,6 +135,7 @@ if ($dirphpstan != 'disabled') {
exec($commandcheck, $output_arrtd, $resexectd);
}
// Get technical debt with Phan
$output_phan_json = array();
$res_exec_phan = 0;
if ($dir_phan != 'disabled') {
@ -235,7 +236,7 @@ $resexecglpu = 0;
//exec($commandcheck, $output_arrglpu, $resexecglpu);
// Retrieve the git information for security alerts
// Get git information for security alerts
$nbofmonth = 2;
$delay = (3600 * 24 * 30 * $nbofmonth);
$arrayofalerts = array();
@ -252,6 +253,7 @@ foreach ($output_arrglpu as $val) {
if (preg_match('/(#yogosha|CVE|Sec:|Sec\s)/i', $tmpval['title'])) {
$alreadyfound = '';
$alreadyfoundcommitid = '';
$alreadyfoundtitle = '';
foreach ($arrayofalerts as $val) {
if ($val['issueidyogosha'] && $val['issueidyogosha'] == $tmpval['issueidyogosha']) { // Already in list
$alreadyfound = 'yogosha';
@ -268,6 +270,11 @@ foreach ($output_arrglpu as $val) {
$alreadyfoundcommitid = $val['commitid'];
break;
}
if ($val['title'] && $val['title'] == $tmpval['title']) { // Already in list
$alreadyfound = 'title';
$alreadyfoundtitle = $val['title'];
break;
}
}
//$alreadyfound=0;
if (!$alreadyfound) {