[ews-app] Add support to communicate with Buildbot
authoraakash_jain@apple.com <aakash_jain@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Nov 2018 01:05:53 +0000 (01:05 +0000)
committeraakash_jain@apple.com <aakash_jain@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Nov 2018 01:05:53 +0000 (01:05 +0000)
https://bugs.webkit.org/show_bug.cgi?id=191935

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/common/__init__.py: Added.
* BuildSlaveSupport/ews-app/ews/common/buildbot.py: Added.

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

Tools/BuildSlaveSupport/ews-app/ews/common/__init__.py [new file with mode: 0644]
Tools/BuildSlaveSupport/ews-app/ews/common/buildbot.py [new file with mode: 0644]
Tools/ChangeLog

diff --git a/Tools/BuildSlaveSupport/ews-app/ews/common/__init__.py b/Tools/BuildSlaveSupport/ews-app/ews/common/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/Tools/BuildSlaveSupport/ews-app/ews/common/buildbot.py b/Tools/BuildSlaveSupport/ews-app/ews/common/buildbot.py
new file mode 100644 (file)
index 0000000..2521795
--- /dev/null
@@ -0,0 +1,51 @@
+# Copyright (C) 2018 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1.  Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+# 2.  Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in the
+#     documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import logging
+import os
+import subprocess
+
+import ews.config as config
+
+_log = logging.getLogger(__name__)
+
+
+class Buildbot():
+    @classmethod
+    def send_patch_to_buildbot(cls, patch_path, properties=[]):
+        command = ['buildbot', 'try',
+                   '--connect=pb',
+                   '--master={}:{}'.format(config.BUG_SERVER_HOST, config.BUILDBOT_SERVER_PORT),
+                   '--username={}'.format(config.BUILDBOT_PB_USERNAME),
+                   '--passwd={}'.format(config.BUILDBOT_PB_PASSWORD),
+                   '--diff={}'.format(patch_path),
+                   '--repository=']
+
+        for property in properties:
+            command.append('--property={}'.format(property))
+
+        _log.debug('Executing command: {}'.format(command))
+        return_code = subprocess.call(command)
+        if return_code:
+            _log.warn('Error executing: {}, return code={}'.format(command, return_code))
+
+        return return_code
index a1afe42..b1e0070 100644 (file)
@@ -1,3 +1,13 @@
+2018-11-26  Aakash Jain  <aakash_jain@apple.com>
+
+        [ews-app] Add support to communicate with Buildbot
+        https://bugs.webkit.org/show_bug.cgi?id=191935
+
+        Reviewed by Lucas Forschler.
+
+        * BuildSlaveSupport/ews-app/ews/common/__init__.py: Added.
+        * BuildSlaveSupport/ews-app/ews/common/buildbot.py: Added.
+
 2018-11-26  Jonathan Bedard  <jbedard@apple.com>
 
         webkitpy: Race condition in ServerProcess tests