Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions src/azure_devops.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,22 @@ async def notify_error(message):
async def initiate_documentation_generation(
headers: dict, data: dict
) -> bool:
""" Initiates the generation of documentation using the provided headers and data.

This function sends a POST request to the specified URL with the provided headers and data
to initiate the generation of documentation.

Args:
headers (dict): A dictionary containing the headers for the request.
data (dict): A dictionary containing the data to be sent in the request.

Returns:
bool: True if the request is valid, False otherwise.

Raises:
Exception: If the initiation of documentation generation fails with a non-200 status code.
"""

url: str = f"{base_url}/api/app/azDevops/generate/diff/doc"
print("Initiating documentation generation")
print("URL: ", url)
Expand All @@ -53,6 +69,21 @@ async def initiate_documentation_generation(


async def check_documentation_generation_status(headers, data):
""" Check the status of documentation generation.

This function sends a request to the specified URL to check the status of documentation generation. It continues to
check the status at regular intervals until the process is complete or a timeout occurs.

Args:
headers (dict): A dictionary containing the request headers.
data (dict): A dictionary containing the request data in JSON format.


Raises:
RequestException: If an error occurs while sending the request.
asyncio.TimeoutError: If the request times out.
"""

url = f"{base_url}/api/app/azDevops/status/diff/doc"
count = 0
while count < 360:
Expand Down