From 468a020c47e51d6f0d2c5a70d7639da046b024c2 Mon Sep 17 00:00:00 2001 From: "snorkell-ai[bot]" <146478655+snorkell-ai[bot]@users.noreply.github.com> Date: Fri, 23 Feb 2024 10:42:00 +0000 Subject: [PATCH] [Snorkell.ai]: Documentation for azure_devops.py --- src/azure_devops.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/azure_devops.py b/src/azure_devops.py index a5370df..9f41672 100644 --- a/src/azure_devops.py +++ b/src/azure_devops.py @@ -9,6 +9,19 @@ # base_url = "https://8455-2401-4900-1f26-31a3-d13d-e5fe-ee8f-f94d.ngrok-free.app/api/v1/health" async def notify_error(message): + """ Notify error to GithubClient and send error notification to snorkell. + + Args: + message (str): The error message to be notified. + + Returns: + None + + Raises: + ConnectionError: If there is a network issue while sending the error notification. + TimeoutError: If the request times out while sending the error notification. + """ + message = f"GithubClient alert:\n {message}" print(message) other_vars = { @@ -53,6 +66,19 @@ async def initiate_documentation_generation( async def check_documentation_generation_status(headers, data): + """ Check the status of documentation generation. + + Args: + headers (dict): The headers to be included in the request. + data (dict): The data to be sent in the request. + + Returns: + None + + Raises: + Exception: If the documentation generation fails or the request fails. + """ + url = f"{base_url}/api/app/azDevops/status/documentation" count = 0 while count < 360: