@@ -250,6 +250,10 @@ def compare_command_logic(args, project_name, project_version):
250250 running_platform = args .running_platform
251251 baseline_target_version = args .baseline_target_version
252252 comparison_target_version = args .comparison_target_version
253+ baseline_github_repo = args .baseline_github_repo
254+ comparison_github_repo = args .comparison_github_repo
255+ baseline_hash = args .baseline_hash
256+ comparison_hash = args .comparison_hash
253257
254258 if running_platform is not None :
255259 logging .info (
@@ -310,6 +314,10 @@ def compare_command_logic(args, project_name, project_version):
310314 running_platform ,
311315 baseline_target_version ,
312316 comparison_target_version ,
317+ baseline_hash ,
318+ comparison_hash ,
319+ baseline_github_repo ,
320+ comparison_github_repo ,
313321 )
314322 prepare_regression_comment (
315323 auto_approve ,
@@ -535,6 +543,10 @@ def compute_regression_table(
535543 running_platform = None ,
536544 baseline_target_version = None ,
537545 comparison_target_version = None ,
546+ comparison_hash = None ,
547+ baseline_hash = None ,
548+ baseline_github_repo = "redis" ,
549+ comparison_github_repo = "redis" ,
538550):
539551 START_TIME_NOW_UTC , _ , _ = get_start_time_vars ()
540552 START_TIME_LAST_MONTH_UTC = START_TIME_NOW_UTC - datetime .timedelta (days = 31 )
@@ -560,6 +572,8 @@ def compute_regression_table(
560572 comparison_tag ,
561573 baseline_target_version ,
562574 comparison_target_version ,
575+ comparison_hash ,
576+ baseline_hash ,
563577 )
564578 logging .info (f"Using baseline filter { by_str_baseline } ={ baseline_str } " )
565579 logging .info (f"Using comparison filter { by_str_comparison } ={ comparison_str } " )
@@ -605,6 +619,8 @@ def compute_regression_table(
605619 total_stable ,
606620 total_unstable ,
607621 total_comparison_points ,
622+ regressions_list ,
623+ improvements_list ,
608624 ) = from_rts_to_regression_table (
609625 baseline_deployment_name ,
610626 comparison_deployment_name ,
@@ -629,6 +645,8 @@ def compute_regression_table(
629645 tf_triggering_env ,
630646 verbose ,
631647 running_platform ,
648+ baseline_github_repo ,
649+ comparison_github_repo ,
632650 )
633651 logging .info (
634652 "Printing differential analysis between {} and {}" .format (
@@ -661,6 +679,8 @@ def compute_regression_table(
661679 writer_regressions .dump (mystdout , False )
662680 table_output += mystdout .getvalue ()
663681 table_output += "\n \n "
682+ test_names_str = "|" .join (regressions_list )
683+ table_output += f"Regressions test regexp names: { test_names_str } \n \n "
664684 mystdout .close ()
665685 sys .stdout = old_stdout
666686
@@ -682,6 +702,8 @@ def compute_regression_table(
682702 writer_regressions .dump (mystdout , False )
683703 table_output += mystdout .getvalue ()
684704 table_output += "\n \n "
705+ test_names_str = "|" .join (improvements_list )
706+ table_output += f"Improvements test regexp names: { test_names_str } \n \n "
685707 mystdout .close ()
686708 sys .stdout = old_stdout
687709
@@ -724,6 +746,8 @@ def get_by_strings(
724746 comparison_tag ,
725747 baseline_target_version = None ,
726748 comparison_target_version = None ,
749+ baseline_hash = None ,
750+ comparison_hash = None ,
727751):
728752 baseline_covered = False
729753 comparison_covered = False
@@ -760,6 +784,16 @@ def get_by_strings(
760784 by_str_baseline = "target+version"
761785 baseline_str = baseline_target_version
762786
787+ if baseline_hash is not None :
788+ if comparison_covered :
789+ logging .error (
790+ "--baseline-branch, --baseline-tag, --baseline-hash, and --baseline-target-version are mutually exclusive. Pick one..."
791+ )
792+ exit (1 )
793+ baseline_covered = True
794+ by_str_baseline = "hash"
795+ baseline_str = baseline_hash
796+
763797 if comparison_tag is not None :
764798 # check if we had already covered comparison
765799 if comparison_covered :
@@ -781,16 +815,27 @@ def get_by_strings(
781815 by_str_comparison = "target+version"
782816 comparison_str = comparison_target_version
783817
818+ if comparison_hash is not None :
819+ # check if we had already covered comparison
820+ if comparison_covered :
821+ logging .error (
822+ "--comparison-branch, --comparison-tag, --comparison-hash, and --comparison-target-table are mutually exclusive. Pick one..."
823+ )
824+ exit (1 )
825+ comparison_covered = True
826+ by_str_comparison = "hash"
827+ comparison_str = comparison_hash
828+
784829 if baseline_covered is False :
785830 logging .error (
786831 "You need to provider either "
787- + "( --baseline-branch, --baseline-tag, or --baseline-target-version ) "
832+ + "( --baseline-branch, --baseline-tag, --baseline-hash, or --baseline-target-version ) "
788833 )
789834 exit (1 )
790835 if comparison_covered is False :
791836 logging .error (
792837 "You need to provider either "
793- + "( --comparison-branch, --comparison-tag, or --comparison-target-version ) "
838+ + "( --comparison-branch, --comparison-tag, --comparison-hash, or --comparison-target-version ) "
794839 )
795840 exit (1 )
796841 return baseline_str , by_str_baseline , comparison_str , by_str_comparison
@@ -820,6 +865,8 @@ def from_rts_to_regression_table(
820865 tf_triggering_env ,
821866 verbose ,
822867 running_platform = None ,
868+ baseline_github_repo = "redis" ,
869+ comparison_github_repo = "redis" ,
823870):
824871 print_all = print_regressions_only is False and print_improvements_only is False
825872 table_full = []
@@ -835,6 +882,8 @@ def from_rts_to_regression_table(
835882 total_comparison_points = 0
836883 noise_waterline = 3
837884 progress = tqdm (unit = "benchmark time-series" , total = len (test_names ))
885+ regressions_list = []
886+ improvements_list = []
838887 for test_name in test_names :
839888 compare_version = "v0.1.208"
840889 github_link = "https://github.com/redis/redis-benchmarks-specification/blob"
@@ -848,18 +897,23 @@ def from_rts_to_regression_table(
848897 "metric={}" .format (metric_name ),
849898 "{}={}" .format (test_filter , test_name ),
850899 "deployment_name={}" .format (baseline_deployment_name ),
900+ "github_repo={}" .format (baseline_github_repo ),
851901 "triggering_env={}" .format (tf_triggering_env ),
852902 ]
853903 if running_platform is not None :
854904 filters_baseline .append ("running_platform={}" .format (running_platform ))
855905 filters_comparison = [
856906 "{}={}" .format (by_str_comparison , comparison_str ),
857907 "metric={}" .format (metric_name ),
858- "hash==" ,
859908 "{}={}" .format (test_filter , test_name ),
860909 "deployment_name={}" .format (comparison_deployment_name ),
910+ "github_repo={}" .format (comparison_github_repo ),
861911 "triggering_env={}" .format (tf_triggering_env ),
862912 ]
913+ if "hash" not in by_str_baseline :
914+ filters_baseline .append ("hash==" )
915+ if "hash" not in by_str_comparison :
916+ filters_comparison .append ("hash==" )
863917 if running_platform is not None :
864918 filters_comparison .append ("running_platform={}" .format (running_platform ))
865919 baseline_timeseries = rts .ts ().queryindex (filters_baseline )
@@ -1037,9 +1091,11 @@ def from_rts_to_regression_table(
10371091 test_link ,
10381092 )
10391093 if detected_regression :
1094+ regressions_list .append (test_name )
10401095 table_regressions .append (line )
10411096
10421097 if detected_improvement :
1098+ improvements_list .append (test_name )
10431099 table_improvements .append (line )
10441100
10451101 if unstable :
@@ -1072,6 +1128,8 @@ def from_rts_to_regression_table(
10721128 total_stable ,
10731129 total_unstable ,
10741130 total_comparison_points ,
1131+ regressions_list ,
1132+ improvements_list ,
10751133 )
10761134
10771135
0 commit comments