Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{CI} Regenerating breaking change report with only_break=True to control length within 65535. #7081

Merged
merged 1 commit into from
Dec 13, 2023
Merged
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
19 changes: 16 additions & 3 deletions scripts/ci/breaking_change_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,21 @@ def get_base_meta_files(diff_ref):
subprocess.run(cmd)


def meta_diff():
def meta_diff(only_break=False):
if os.path.exists(diff_meta_path):
for file in os.listdir(diff_meta_path):
if file.endswith('.json'):
cmd = ['azdev', 'command-change', 'meta-diff', '--base-meta-file', os.path.join(base_meta_path, file), '--diff-meta-file', os.path.join(diff_meta_path, file), '--output-file', os.path.join(output_path, file)]
if only_break:
cmd.append('--only-break')
print(cmd)
subprocess.run(cmd)
cmd = ['ls', '-al', output_path]
print(cmd)
subprocess.run(cmd)


def get_pipeline_result():
def get_pipeline_result(only_break=False):
pipeline_result = {
"breaking_change_test": {
"Details": [
Expand Down Expand Up @@ -148,7 +150,18 @@ def get_pipeline_result():
"Status": "Succeeded",
"Content": ""
})
print(json.dumps(pipeline_result, indent=4))

result_length = len(json.dumps(pipeline_result, indent=4))
kairu-ms marked this conversation as resolved.
Show resolved Hide resolved
if result_length > 65535:
if only_break:
logger.error("Breaking change report exceeds 65535 characters even with only_break=True.")
return pipeline_result

logger.info("Regenerating breaking change report with only_break=True to control length within 65535.")
meta_diff(only_break=True)
pipeline_result = get_pipeline_result(only_break=True)
return pipeline_result

return pipeline_result


Expand Down