Hashar has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/404260 )

Change subject: Fix change number extraction on new enough Gerrit master
......................................................................


Fix change number extraction on new enough Gerrit master

Apparently, there's been a change in recent upstream Gerrit which
changed the JSON serialization of change numbers in the output of
`gerrit stream-events`. Previously, the change number was being
transmitted as a string. That has changed and now it's being sent as a
number. That results in a failure later on:

 2017-02-14 15:35:55,294 ERROR zuul.IndependentPipelineManager: Exception while 
launching job XXX for change <Change 0x7f3efc185c90 64,1>:
  Traceback (most recent call last):
    File "/usr/lib/python2.7/site-packages/zuul/scheduler.py", line 1520, in 
_launchJobs
      dependent_items)
    File "/usr/lib/python2.7/site-packages/zuul/launcher/gearman.py", line 318, 
in launch
      destination_path = os.path.join(item.change.getBasePath(),
    File "/usr/lib/python2.7/site-packages/zuul/model.py", line 913, in 
getBasePath
      self.number[-2:], self.number, self.patchset)
  TypeError: 'int' object has no attribute '__getitem__'

I would love to have this extended this with a proper testcase. Please
feel free to push an updated version over this patchset, or just let me
know which place is the most appropriate and I can do it myself, too.

Change-Id: I68f5fa7fa4fac0b4d2eb232fe37df11e57157ecf
---
M zuul/connection/gerrit.py
1 file changed, 1 insertion(+), 1 deletion(-)



diff --git a/zuul/connection/gerrit.py b/zuul/connection/gerrit.py
index 927aa11..95bf35c 100644
--- a/zuul/connection/gerrit.py
+++ b/zuul/connection/gerrit.py
@@ -65,7 +65,7 @@
         if change:
             event.project_name = change.get('project')
             event.branch = change.get('branch')
-            event.change_number = change.get('number')
+            event.change_number = str(change.get('number'))
             event.change_url = change.get('url')
             patchset = data.get('patchSet')
             if patchset:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I68f5fa7fa4fac0b4d2eb232fe37df11e57157ecf
Gerrit-PatchSet: 1
Gerrit-Project: integration/zuul
Gerrit-Branch: patch-queue/debian/jessie-wikimedia
Gerrit-Owner: Hashar <has...@free.fr>
Gerrit-Reviewer: Hashar <has...@free.fr>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to