From 819f9f8425dbeda76dd4816dbe19b755d09520d8 Mon Sep 17 00:00:00 2001 From: Deborah Brouwer Date: Fri, 6 Dec 2024 15:46:07 -0800 Subject: [PATCH] ci: pipeline_message: catch module loading errors Currently, if the pipeline_message script runs in an an env missing the aiohttp package, the pipeline_message script will throw a ModuleNotFoundError and crash marge. Make sure to catch and ignore these errors since the pipeline message should never interfere with a merge request. Part-of: --- .marge/hooks/pipeline_message.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.marge/hooks/pipeline_message.py b/.marge/hooks/pipeline_message.py index e4fade392d2..25bb41e7635 100755 --- a/.marge/hooks/pipeline_message.py +++ b/.marge/hooks/pipeline_message.py @@ -320,10 +320,11 @@ async def process_problem_jobs(session, project_id, problem_jobs): async def main(pipeline_id: str, project_id: str = "176") -> str: message = "" - timeout = aiohttp.ClientTimeout(total=120) - logging.basicConfig(level=logging.INFO) try: + timeout = aiohttp.ClientTimeout(total=120) + logging.basicConfig(level=logging.INFO) + async with aiohttp.ClientSession(timeout=timeout) as session: pipeline_status = await get_pipeline_status( session, project_id, pipeline_id