Skip to content

Commit 9eb8cb1

Browse files
committed
up
1 parent 1f93b2c commit 9eb8cb1

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

.github/scripts/flaky-test-remediation/3-open-pr.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,20 @@
1717

1818
import json
1919
import os
20+
import re
2021
import subprocess
2122
import sys
2223

2324
from _paths import DIAGNOSIS, PR_BODY, SELECTED
2425
from _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+
2734
def 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]

0 commit comments

Comments
 (0)