diff --git a/github_app_geo_project/module/audit/utils.py b/github_app_geo_project/module/audit/utils.py index 573cd1a6a5..afa256e3cd 100644 --- a/github_app_geo_project/module/audit/utils.py +++ b/github_app_geo_project/module/audit/utils.py @@ -435,6 +435,7 @@ async def _snyk_fix( "Poetry version", "Error while getting the Poetry version", "Timeout while getting the Poetry version", + error=False, ) snyk_fix_success = True diff --git a/github_app_geo_project/module/standard/patch.py b/github_app_geo_project/module/standard/patch.py index 7a1170dd1b..2aec544b21 100644 --- a/github_app_geo_project/module/standard/patch.py +++ b/github_app_geo_project/module/standard/patch.py @@ -55,7 +55,7 @@ def get_actions(self, context: module.GetActionContext) -> list[module.Action[di context.event_data.get("action") == "completed" and context.event_data.get("workflow_run", {}).get("conclusion") == "failure" # Don't run on dynamic workflows like CodeQL - and context.event_data.get("workflow", {}).get("path", {}).startswith("dynamic/") + and not context.event_data.get("workflow", {}).get("path", {}).startswith("dynamic/") ): return [module.Action(priority=module.PRIORITY_STANDARD, data={})] return [] diff --git a/github_app_geo_project/module/utils.py b/github_app_geo_project/module/utils.py index 626addad6a..55c8a5e800 100644 --- a/github_app_geo_project/module/utils.py +++ b/github_app_geo_project/module/utils.py @@ -480,6 +480,7 @@ async def run_timeout( error_message: str, timeout_message: str, cwd: str | None = None, + error: bool = True, ) -> tuple[str | None, bool, Message | None]: """ Run a command with a timeout. @@ -493,6 +494,7 @@ async def run_timeout( error_message: The message on error timeout_message: The message on timeout cwd: The working directory + error: Set to false to don't get error log (silent mode) Return: ------ @@ -535,7 +537,10 @@ async def run_timeout( _LOGGER.warning(message) return stdout.decode(), success, message except FileNotFoundError as exception: - _LOGGER.exception("%s not found: %s", command[0], exception) + if error: + _LOGGER.exception("%s not found: %s", command[0], exception) + else: + _LOGGER.warning("%s not found") proc = subprocess.run( # nosec # pylint: disable=subprocess-run-check ["find", "/", "-name", command[0]], capture_output=True, @@ -560,7 +565,10 @@ async def run_timeout( _LOGGER.warning(message) return None, False, message else: - _LOGGER.exception("TimeoutError: %s", exception) + if error: + _LOGGER.exception("TimeoutError for %s: %s", command[0], exception) + else: + _LOGGER.warning("TimeoutError for %s", command[0]) return None, False, AnsiProcessMessage(command, None, "", "", str(exception))