[ews-build] validate-patch should handle the case when bug_id is None
authoraakash_jain@apple.com <aakash_jain@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Jan 2019 21:28:19 +0000 (21:28 +0000)
committeraakash_jain@apple.com <aakash_jain@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Jan 2019 21:28:19 +0000 (21:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=193547

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/steps.py:
(ValidatePatch._is_bug_closed): Gracefully handle the case when bug_id is None.
(ValidatePatch.start): If bug_id is set as None in build properties, fetch it from the patch.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240128 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/BuildSlaveSupport/ews-build/steps.py
Tools/ChangeLog

index 6065144..413018b 100644 (file)
@@ -305,6 +305,10 @@ class ValidatePatch(buildstep.BuildStep):
         return 0
 
     def _is_bug_closed(self, bug_id):
+        if not bug_id:
+            self._addToLog('stdio', 'Skipping bug status validation since bug id is None.\n')
+            return -1
+
         bug_json = self.get_bug_json(bug_id)
         if not bug_json or not bug_json.get('status'):
             self._addToLog('stdio', 'Unable to fetch bug {}.\n'.format(bug_id))
@@ -329,7 +333,7 @@ class ValidatePatch(buildstep.BuildStep):
             self.finished(FAILURE)
             return None
 
-        bug_id = self.getProperty('bug_id', self.get_bug_id_from_patch(patch_id))
+        bug_id = self.getProperty('bug_id', '') or self.get_bug_id_from_patch(patch_id)
 
         bug_closed = self._is_bug_closed(bug_id)
         if bug_closed == 1:
index 9441893..ee607e7 100644 (file)
@@ -1,5 +1,16 @@
 2019-01-17  Aakash Jain  <aakash_jain@apple.com>
 
+        [ews-build] validate-patch should handle the case when bug_id is None
+        https://bugs.webkit.org/show_bug.cgi?id=193547
+
+        Reviewed by Lucas Forschler.
+
+        * BuildSlaveSupport/ews-build/steps.py:
+        (ValidatePatch._is_bug_closed): Gracefully handle the case when bug_id is None.
+        (ValidatePatch.start): If bug_id is set as None in build properties, fetch it from the patch.
+
+2019-01-17  Aakash Jain  <aakash_jain@apple.com>
+
         [ews-build] Add patch author information in build
         https://bugs.webkit.org/show_bug.cgi?id=193465