Yuvipanda has submitted this change and it was merged.

Change subject: Pull data from github via API anyway, rather than use payload 
from push
......................................................................


Pull data from github via API anyway, rather than use payload from push

This has an extra network request overhead, but I think it is *okay*,
since it will be now more easily reproducible

Change-Id: Iab8cdf5ac6843406b9e962526667c08f0dd585f6
---
M src/github-to-gerrit.py
1 file changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Yuvipanda: Verified; Looks good to me, approved



diff --git a/src/github-to-gerrit.py b/src/github-to-gerrit.py
index 7423675..7f4ba7c 100644
--- a/src/github-to-gerrit.py
+++ b/src/github-to-gerrit.py
@@ -83,8 +83,7 @@
         logger.info("git review setup")
 
 
-def get_pullreq(name, number):
-    gh_name = name.replace('/', '-')
+def get_pullreq(gh_name, number):
     pr = gh.repos(OWNER, gh_name).pulls(number).get()
     return pr
 
@@ -167,4 +166,5 @@
 
     while True:
         data = json.loads(red.brpop(QUEUE_KEY)[1])
-        do_review(data)
+        pr = get_pullreq(data['pull_request']['base']['repo']['name'], 
data['pull_request']['number'])
+        do_review(pr)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iab8cdf5ac6843406b9e962526667c08f0dd585f6
Gerrit-PatchSet: 2
Gerrit-Project: labs/tools/SuchABot
Gerrit-Branch: master
Gerrit-Owner: Yuvipanda <[email protected]>
Gerrit-Reviewer: Yuvipanda <[email protected]>

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

Reply via email to