File tree Expand file tree Collapse file tree
.github/scripts/flaky-test-remediation Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717
1818import json
1919import os
20+ import re
2021import subprocess
2122import sys
2223
2324from _paths import DIAGNOSIS , PR_BODY , SELECTED
2425from _render import utc_day
2526
2627
28+ def pr_title_target (selected ):
29+ class_name = selected ["class" ].rsplit ("." , 1 )[- 1 ]
30+ method_name = re .sub (r"\[\d+\]$" , "" , selected ["method" ])
31+ return f"{ class_name } .{ method_name } "
32+
33+
2734def render (selected ):
2835 fq = selected ["fully_qualified" ]
2936 source_file = selected ["source_file" ]
@@ -100,9 +107,8 @@ def main():
100107 PR_BODY .write_text (body , encoding = "utf-8" )
101108 print (f"Rendered PR body to { PR_BODY } " )
102109
103- fq = selected ["fully_qualified" ]
104110 cmd = ["gh" , "pr" , "create" ,
105- "--title" , f"Reduce flakiness in { fq } " ,
111+ "--title" , f"Reduce flakiness in { pr_title_target ( selected ) } " ,
106112 "--body-file" , str (PR_BODY ),
107113 "--base" , base ,
108114 "--head" , head ]
You can’t perform that action at this time.
0 commit comments