1
0
Fork 0
mirror of https://gitlab.wikimedia.org/ladsgroup/Phabricator-maintenance-bot synced 2024-11-21 11:32:38 +01:00

patchforreview_remover: Update for adding the # to patch numbers

See T358940 and T363573

Bug: T363573
This commit is contained in:
Amir Sarabadani 2024-04-26 18:43:52 +02:00
parent 9cee4b7510
commit 982cfc2f33

View file

@ -43,10 +43,10 @@ class Checker():
return "close"
# Gerrit style
if re.search(r"Change \d+ had a related patch set uploaded", raw_comment):
if re.search(r"Change #?\d+ had a related patch set uploaded", raw_comment):
return "open"
if re.search(r'Change \d+ \*\*(?:merged|abandoned)\*\* by ', raw_comment):
if re.search(r'Change #?\d+ \*\*(?:merged|abandoned)\*\* by ', raw_comment):
return "close"
return None
@ -94,7 +94,7 @@ class Checker():
for patch in gerrit_patch_status:
# The normal sequence of GerritBot transactions for a Gerrit change is "Change
# \d+ had a related patch set uploaded" (indicated by True in
# gerrit_patch_status) eventually followed by "Change \d+ (merged|abandoned)
# gerrit_patch_status) eventually followed by "Change #?\d+ (merged|abandoned)
# by whoever" (indicated by False in gerrit_patch_status). The transactions
# are returned in reverse order so the opened/merged pattern will appear as
# the reverse of [True, False], which is [False, True].