Legoktm has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/233185

Change subject: Allow bad headers like "Bug:  T###"
......................................................................

Allow bad headers like "Bug:  T###"

Change-Id: I04661729ba6dda2857b7b20c509f2fa889c768ee
---
M forrestbot.py
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/forrestbot 
refs/changes/85/233185/1

diff --git a/forrestbot.py b/forrestbot.py
index 1ce2f50..63ca23c 100644
--- a/forrestbot.py
+++ b/forrestbot.py
@@ -190,7 +190,8 @@
             pass
 
     # after parsing all entries, make sure we only do a single edit per Task.
-    key = lambda x: int(x['task'][1:])
+    # When detecting the bug header, strip arbitrary whitespace so bad headers 
like "Bug:  T###" are ok
+    key = lambda x: int(x['task'].strip()[1:])
     for task, acts in itertools.groupby(sorted(actions, key=key), key=key):
         acts = sorted(acts, key=lambda x: x['slugs'])
 

-- 
To view, visit https://gerrit.wikimedia.org/r/233185
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I04661729ba6dda2857b7b20c509f2fa889c768ee
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/forrestbot
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to