Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions tools/azure-sdk-tools/packaging_tools/sdk_generator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import sys
import time
from typing import List, Dict, Any
import argparse
import json
Expand Down Expand Up @@ -223,6 +224,7 @@ def main(generate_input, generate_output):
for readme_or_tsp in readme_and_tsp:
_LOGGER.info(f"[CODEGEN]({readme_or_tsp})codegen begin")
try:
code_generation_start_time = time.time()
if "resource-manager" in readme_or_tsp:
relative_path_readme = str(Path(spec_folder, readme_or_tsp))
del_outdated_files(relative_path_readme)
Expand All @@ -244,6 +246,7 @@ def main(generate_input, generate_output):
else:
del_outdated_generated_files(str(Path(spec_folder, readme_or_tsp)))
config = gen_typespec(readme_or_tsp, spec_folder, data["headSha"], data["repoHttpsUrl"])
_LOGGER.info(f"code generation cost time: {int(time.time() - code_generation_start_time)} seconds")
except Exception as e:
_LOGGER.error(f"fail to generate sdk for {readme_or_tsp}: {str(e)}")
for hint_message in [
Expand Down
6 changes: 6 additions & 0 deletions tools/azure-sdk-tools/packaging_tools/sdk_package.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import sys
import time
import argparse
import json
import logging
Expand Down Expand Up @@ -45,12 +46,15 @@ def main(generate_input, generate_output):
prefolder=prefolder,
is_multiapi=package["isMultiapi"],
)

changelog_generation_start_time = time.time()
try:
md_output = execute_func_with_timeout(change_log_func)
except multiprocessing.TimeoutError:
md_output = "change log generation was timeout!!!"
except:
md_output = "change log generation failed!!!"
_LOGGER.info(f"changelog generation cost time: {int(time.time() - changelog_generation_start_time)} seconds")
package["changelog"] = {
"content": md_output,
"hasBreakingChange": "Breaking Changes" in md_output,
Expand All @@ -61,6 +65,7 @@ def main(generate_input, generate_output):
_LOGGER.info(f"[PACKAGE]({package_name})[CHANGELOG]:{md_output}")
# Generate api stub File
folder_name = package["path"][0]
apiview_start_time = time.time()
try:
package_path = Path(sdk_folder, folder_name, package_name)
check_call(
Expand All @@ -82,6 +87,7 @@ def main(generate_input, generate_output):
package["apiViewArtifact"] = str(Path(package_path, file))
except Exception as e:
_LOGGER.debug(f"Fail to generate ApiView token file for {package_name}: {e}")
_LOGGER.info(f"apiview generation cost time: {int(time.time() - apiview_start_time)} seconds")

# check generated files and update package["version"]
if package_name.startswith("azure-mgmt-"):
Expand Down
Loading