ci: pipeline_message: reset empty errors

Currently marge will ignore an error message if it is just the word
"error" without any further information. However, if she never finds a
more informative message, then she will just print that meaningless
error message.

Instead of an empty error message, just leave the message blank.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32773>
This commit is contained in:
Deborah Brouwer
2024-12-20 16:15:52 -08:00
committed by Marge Bot
parent 011a867fbe
commit 3c441191d9
2 changed files with 61 additions and 4 deletions

View File

@@ -250,12 +250,14 @@ async def search_job_log_for_errors(session, project_id, job):
if "error" in line.lower():
if any(ignore.lower() in line.lower() for ignore in ignore_list):
continue
# remove date and formatting before error message
log_error_message = line[line.lower().find("error") :]
log_error_message = line[line.lower().find("error") :].strip()
# if there is no further info after the word error then it's not helpful
if log_error_message.lower() == "error":
continue
if log_error_message.lower() == "errors":
# so reset the message and try again.
if log_error_message.lower() in {"error", "errors", "error:", "errors:"}:
log_error_message = ""
continue
break