Skip to content

Commit

Permalink
Update release_notes_update_pr_author_info_add_dup.py (pingcap#13793)
Browse files Browse the repository at this point in the history
  • Loading branch information
qiancai authored Jul 3, 2023
1 parent a59fa29 commit b757eb5
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions scripts/release_notes_update_pr_author_info_add_dup.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,15 @@ def store_exst_rn(ext_path,main_path):
def get_pr_info_from_github(cp_pr_link,cp_pr_title):

target_repo_pr_link= cp_pr_link.rsplit('/', 1)[0]
target_pr_number = re.findall(r'\(#(\d+)\)$', cp_pr_title)
target_pr_number = re.findall(r'\(#(\d+)\)$', cp_pr_title) # Match the original PR number in the end of the cherry-pick PR

if len(target_pr_number) > 1:
print ("There is more than one match result of original PR number from the cherry-pick title: " + cp_pr_title )
if target_pr_number:
if len(target_pr_number) > 1:
print ("There is more than one match result of original PR number from the cherry-pick title: " + cp_pr_title )
else:
pass
else:
target_pr_number = re.findall(r'\(#(\d+)\)', cp_pr_title) # Match the original PR number in the cherry-pick PR

target_pr_link = target_repo_pr_link + '/' + target_pr_number[0]

Expand Down Expand Up @@ -113,7 +118,7 @@ def update_pr_author_and_release_notes(excel_path):
pass

## Add the dup release note info
issue_link = re.search('https://github.com/(pingcap|tikv)/\w+/issues/\d+', current_formated_rn)
issue_link = re.search('https://github.com/(pingcap|tikv)/[\w-]+/issues/\d+', current_formated_rn)
for note_pair in note_pairs:
if (issue_link.group() == note_pair[0]) and ((current_pr_author in note_pair[4]) or len(note_pair[4]) == 0): # Add the dup release notes only if the issues link is the same as the existing one and the current author is in the existing author list
print('A duplicated note is found in row ' + str(row_index) + " from " + note_pair[2] + note_pair[1])
Expand Down

0 comments on commit b757eb5

Please sign in to comment.