From c01bb0d485fb2bca14cf89aa4da2cdcd60fe0bbe Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Fri, 29 Dec 2023 21:40:22 -0600 Subject: [PATCH] Report errors when repositories cannot be cloned during ecosystem checks (#9314) Otherwise, the directory is just missing later and you need to dig through logs to understand why. --- python/ruff-ecosystem/ruff_ecosystem/projects.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/python/ruff-ecosystem/ruff_ecosystem/projects.py b/python/ruff-ecosystem/ruff_ecosystem/projects.py index 78b836297f..f34c17b08f 100644 --- a/python/ruff-ecosystem/ruff_ecosystem/projects.py +++ b/python/ruff-ecosystem/ruff_ecosystem/projects.py @@ -294,14 +294,17 @@ class Repository(Serializable): ) process = await create_subprocess_exec( - *command, env={"GIT_TERMINAL_PROMPT": "0"} + *command, + env={"GIT_TERMINAL_PROMPT": "0"}, + stdout=PIPE, + stderr=PIPE, ) - status_code = await process.wait() - - logger.debug( - f"Finished cloning {self.fullname} with status {status_code}", - ) + if await process.wait() != 0: + _, stderr = await process.communicate() + raise ProjectSetupError( + f"Failed to clone {self.fullname}: {stderr.decode()}" + ) # Configure git user — needed for `self.commit` to work await (