From f80d7978d222294a847b182337aabe2cca59b657 Mon Sep 17 00:00:00 2001 From: Martin Xu <15661672+martinxu9@users.noreply.github.com> Date: Wed, 20 Mar 2024 16:38:09 -0700 Subject: [PATCH] make PR title optional since push event or PR merge will not have the title (#2889) --- scripts/simple_app_benchmark_upload.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/scripts/simple_app_benchmark_upload.py b/scripts/simple_app_benchmark_upload.py index 392a0d9a2..c54811470 100644 --- a/scripts/simple_app_benchmark_upload.py +++ b/scripts/simple_app_benchmark_upload.py @@ -104,11 +104,7 @@ def insert_benchmarking_data( def main(): - """Runs the benchmarks and inserts the results. - - Raises: - ValueError: If the PR title is not provided. - """ + """Runs the benchmarks and inserts the results.""" # Get the commit SHA and JSON directory from the command line arguments parser = argparse.ArgumentParser(description="Run benchmarks and process results.") parser.add_argument( @@ -150,9 +146,8 @@ def main(): ) args = parser.parse_args() - pr_title = args.pr_title or os.getenv("PR_TITLE") - if not pr_title: - raise ValueError("PR title is required") + # Get the PR title from env or the args. For the PR merge or push event, there is no PR title, leaving it empty. + pr_title = args.pr_title or os.getenv("PR_TITLE", "") # Get the results of pytest benchmarks cleaned_benchmark_results = extract_stats_from_json(args.benchmark_json)