Fix ms_checker and parse big daemon log. (#11)

This commit is contained in:
Liu Shilong 2024-08-08 17:40:46 +08:00 коммит произвёл GitHub
Родитель 8e2d250582
Коммит b3bb27611a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
2 изменённых файлов: 14 добавлений и 13 удалений

Просмотреть файл

@ -82,7 +82,6 @@ function init(app) {
}
} else if (comment_body.startsWith(`/azpw ${MsChecker}`)) {
check_suite = MsChecker
if (pr_owner != 'liushilongbuaa'){ return }; //TODO remove test line.
} else {
app.log.info(`[ CONFLICT DETECT ] [${uuid}] comment: ${comment_body}, exit!`)
return
@ -154,26 +153,22 @@ function init(app) {
description = `@${comment_at} Github Branch not ready<br>Please wait a few minutes to run again!<br>'/azpw ${MsConflict}'`
} else if (run.status != 0){
app.log.info([`[ CONFLICT DETECT ] [${uuid}] Unknown error liushilongbuaa need to check!`, url].join(" "))
description = `@liushilongbuaa Please help check!`
description = `@liushilongbuaa Please help check!<br>${mspr}<br>${tmp}`
} else {
app.log.info([`[ CONFLICT DETECT ] [${uuid}] Exit: 0`, url].join(" "))
description = SUCCESS
description = `${SUCCESS}<br>${mspr}`
}
check_create(app, context, uuid, owner, repo, commit, MsConflict, ms_conflict_result, COMPLETED, "MS conflict detect", description)
}
if ( ['ALL',MsChecker].includes(check_suite) ) {
description = `Please check result in ${mspr}`
if (pr_owner == 'liushilongbuaa') {
if (ms_checker_result == InProgress){
check_create(app, context, uuid, owner, repo, commit, MsChecker, null, InProgress, "MS PR validation", description)
} else {
check_create(app, context, uuid, owner, repo, commit, MsChecker, ms_checker_result, COMPLETED, "MS PR validation", description)
}
} //TODO remove test line.
}
if ( ! [0, 254, 253, 252].includes(run.status) ){
app.log.error(`[ CONFLICT DETECT ] [${uuid}] Exit Code: ${run.status}`)
if (ms_checker_result == InProgress){
check_create(app, context, uuid, owner, repo, commit, MsChecker, null, InProgress, "MS PR validation", description)
} else {
check_create(app, context, uuid, owner, repo, commit, MsChecker, ms_checker_result, COMPLETED, "MS PR validation", description)
}
}
app.log.error(`[ CONFLICT DETECT ] [${uuid}] Exit Code: ${run.status}`)
});
};

Просмотреть файл

@ -1,5 +1,11 @@
#!/bin/bash -ex
if (( $(stat --format %s /home/env_init_daemon.stderr)/1000/1000/1000 > 2 )); then
cd /home
mv env_init_daemon.stderr env_init_daemon.stderr.back
split -l 1000000 -d env_init_daemon.stderr.back env_init_daemon.stderr.back
cd -
fi
uuid=$1
echo "$(date '+%FT%TZ') daemon script start!"
cd site/wwwroot/workspace