diff --git a/.vscode/settings.json b/.vscode/settings.json index ece96ba..989d779 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -19,6 +19,9 @@ "python.testing.autoTestDiscoverOnSaveEnabled": true, "python.envFile": "${workspaceFolder}/.env", "python.languageServer": "Pylance", + "[python]": { + "editor.defaultFormatter": "ms-python.black-formatter", + }, "black-formatter.args": [ "--line-length", "100" diff --git a/simple_ado/builds.py b/simple_ado/builds.py index fb0fd69..dbe6233 100755 --- a/simple_ado/builds.py +++ b/simple_ado/builds.py @@ -191,6 +191,23 @@ def get_artifact_info( response = self.http_client.get(request_url) return self.http_client.decode_response(response) + def get_build_timeline(self, *, project_id: str, build_id: int) -> ADOResponse: + """Get the build timeline. + + :param project_id: The ID of the project + :param build_id: The ID of the build + + :returns: The ADO response with the build timeline data in it + """ + self.log.debug(f"Fetching build timeline for build {build_id}...") + + request_url = ( + self.http_client.api_endpoint(project_id=project_id) + + f"/build/builds/{build_id}/timeline?api-version=7.1" + ) + response = self.http_client.get(request_url) + return self.http_client.decode_response(response) + def download_artifact( self, *,