<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[244532] trunk/Tools</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/244532">244532</a></dd>
<dt>Author</dt> <dd>aakash_jain@apple.com</dd>
<dt>Date</dt> <dd>2019-04-22 17:16:48 -0700 (Mon, 22 Apr 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>[ews-build] Trigger queues only after uploading the archive
https://bugs.webkit.org/show_bug.cgi?id=197180

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/factories.py:
(Factory.__init__):
(BuildFactory.__init__): Remove trigger step from factories.
(BuildFactory.propertiesToPassToTriggers): Deleted.
* BuildSlaveSupport/ews-build/steps.py:
(ConfigureBuild.__init__): Confiure triggers property.
(Trigger): Step to trigger other queues.
(Trigger.propertiesToPassToTriggers): Method to construct properties to pass to triggerred builds.
(UploadBuiltProduct.finished): Trigger builds after upload is successful.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkToolsBuildSlaveSupportewsbuildfactoriespy">trunk/Tools/BuildSlaveSupport/ews-build/factories.py</a></li>
<li><a href="#trunkToolsBuildSlaveSupportewsbuildstepspy">trunk/Tools/BuildSlaveSupport/ews-build/steps.py</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkToolsBuildSlaveSupportewsbuildfactoriespy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/BuildSlaveSupport/ews-build/factories.py (244531 => 244532)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/BuildSlaveSupport/ews-build/factories.py     2019-04-23 00:16:37 UTC (rev 244531)
+++ trunk/Tools/BuildSlaveSupport/ews-build/factories.py        2019-04-23 00:16:48 UTC (rev 244532)
</span><span class="lines">@@ -21,18 +21,16 @@
</span><span class="cx"> # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-from buildbot.process import factory, properties
</del><ins>+from buildbot.process import factory
</ins><span class="cx"> from buildbot.steps import trigger
</span><span class="cx"> 
</span><span class="cx"> from steps import *
</span><span class="cx"> 
</span><del>-Property = properties.Property
</del><span class="cx"> 
</span><del>-
</del><span class="cx"> class Factory(factory.BuildFactory):
</span><del>-    def __init__(self, platform, configuration=None, architectures=None, buildOnly=True, additionalArguments=None, checkRelevance=False, **kwargs):
</del><ins>+    def __init__(self, platform, configuration=None, architectures=None, buildOnly=True, triggers=None, additionalArguments=None, checkRelevance=False, **kwargs):
</ins><span class="cx">         factory.BuildFactory.__init__(self)
</span><del>-        self.addStep(ConfigureBuild(platform, configuration, architectures, buildOnly, additionalArguments))
</del><ins>+        self.addStep(ConfigureBuild(platform, configuration, architectures, buildOnly, triggers, additionalArguments))
</ins><span class="cx">         if checkRelevance:
</span><span class="cx">             self.addStep(CheckPatchRelevance())
</span><span class="cx">         self.addStep(ValidatePatch())
</span><span class="lines">@@ -66,25 +64,12 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> class BuildFactory(Factory):
</span><del>-    def __init__(self, platform, configuration=None, architectures=None, additionalArguments=None, triggers=None, **kwargs):
-        Factory.__init__(self, platform, configuration, architectures, False, additionalArguments)
</del><ins>+    def __init__(self, platform, configuration=None, architectures=None, triggers=None, additionalArguments=None, **kwargs):
+        Factory.__init__(self, platform, configuration, architectures, False, triggers, additionalArguments)
</ins><span class="cx">         self.addStep(KillOldProcesses())
</span><span class="cx">         self.addStep(CompileWebKit())
</span><del>-        if triggers:
-            self.addStep(trigger.Trigger(schedulerNames=triggers, set_properties=self.propertiesToPassToTriggers() or {}))
</del><span class="cx"> 
</span><del>-    def propertiesToPassToTriggers(self):
-        return {
-            "patch_id": Property("patch_id"),
-            "bug_id": Property("bug_id"),
-            "configuration": Property("configuration"),
-            "platform": Property("platform"),
-            "fullPlatform": Property("fullPlatform"),
-            "architecture": Property("architecture"),
-            "owner": Property("owner"),
-        }
</del><span class="cx"> 
</span><del>-
</del><span class="cx"> class TestFactory(Factory):
</span><span class="cx">     LayoutTestClass = None
</span><span class="cx">     APITestClass = None
</span></span></pre></div>
<a id="trunkToolsBuildSlaveSupportewsbuildstepspy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/BuildSlaveSupport/ews-build/steps.py (244531 => 244532)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/BuildSlaveSupport/ews-build/steps.py 2019-04-23 00:16:37 UTC (rev 244531)
+++ trunk/Tools/BuildSlaveSupport/ews-build/steps.py    2019-04-23 00:16:48 UTC (rev 244532)
</span><span class="lines">@@ -23,7 +23,7 @@
</span><span class="cx"> from buildbot.plugins import steps, util
</span><span class="cx"> from buildbot.process import buildstep, logobserver, properties
</span><span class="cx"> from buildbot.process.results import Results, SUCCESS, FAILURE, WARNINGS, SKIPPED, EXCEPTION, RETRY
</span><del>-from buildbot.steps import master, shell, transfer
</del><ins>+from buildbot.steps import master, shell, transfer, trigger
</ins><span class="cx"> from buildbot.steps.source import git
</span><span class="cx"> from buildbot.steps.worker import CompositeStepMixin
</span><span class="cx"> from twisted.internet import defer
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx">     description = ["configuring build"]
</span><span class="cx">     descriptionDone = ["Configured build"]
</span><span class="cx"> 
</span><del>-    def __init__(self, platform, configuration, architectures, buildOnly, additionalArguments):
</del><ins>+    def __init__(self, platform, configuration, architectures, buildOnly, triggers, additionalArguments):
</ins><span class="cx">         super(ConfigureBuild, self).__init__()
</span><span class="cx">         self.platform = platform
</span><span class="cx">         if platform != 'jsc-only':
</span><span class="lines">@@ -52,6 +52,7 @@
</span><span class="cx">         self.configuration = configuration
</span><span class="cx">         self.architecture = " ".join(architectures) if architectures else None
</span><span class="cx">         self.buildOnly = buildOnly
</span><ins>+        self.triggers = triggers
</ins><span class="cx">         self.additionalArguments = additionalArguments
</span><span class="cx"> 
</span><span class="cx">     def start(self):
</span><span class="lines">@@ -65,6 +66,8 @@
</span><span class="cx">             self.setProperty('architecture', self.architecture, 'config.json')
</span><span class="cx">         if self.buildOnly:
</span><span class="cx">             self.setProperty("buildOnly", self.buildOnly, 'config.json')
</span><ins>+        if self.triggers:
+            self.setProperty('triggers', self.triggers, 'config.json')
</ins><span class="cx">         if self.additionalArguments:
</span><span class="cx">             self.setProperty("additionalArguments", self.additionalArguments, 'config.json')
</span><span class="cx"> 
</span><span class="lines">@@ -383,6 +386,23 @@
</span><span class="cx">         return not self.doStepIf(step)
</span><span class="cx"> 
</span><span class="cx"> 
</span><ins>+class Trigger(trigger.Trigger):
+    def __init__(self, schedulerNames, **kwargs):
+        set_properties = self.propertiesToPassToTriggers() or {}
+        super(Trigger, self).__init__(schedulerNames=schedulerNames, set_properties=set_properties, **kwargs)
+
+    def propertiesToPassToTriggers(self):
+        return {
+            'patch_id': properties.Property('patch_id'),
+            'bug_id': properties.Property('bug_id'),
+            'configuration': properties.Property('configuration'),
+            'platform': properties.Property('platform'),
+            'fullPlatform': properties.Property('fullPlatform'),
+            'architecture': properties.Property('architecture'),
+            'owner': properties.Property('owner'),
+        }
+
+
</ins><span class="cx"> class TestWithFailureCount(shell.Test):
</span><span class="cx">     failedTestsFormatString = "%d test%s failed"
</span><span class="cx">     failedTestCount = 0
</span><span class="lines">@@ -674,7 +694,15 @@
</span><span class="cx">         kwargs['blocksize'] = 1024 * 256
</span><span class="cx">         transfer.FileUpload.__init__(self, **kwargs)
</span><span class="cx"> 
</span><ins>+    def finished(self, results):
+        if results == SUCCESS:
+            triggers = self.getProperty('triggers', None)
+            if triggers:
+                self.build.addStepsAfterCurrentStep([Trigger(schedulerNames=triggers)])
</ins><span class="cx"> 
</span><ins>+        return super(UploadBuiltProduct, self).finished(results)
+
+
</ins><span class="cx"> class DownloadBuiltProduct(shell.ShellCommand):
</span><span class="cx">     command = ['python', 'Tools/BuildSlaveSupport/download-built-product',
</span><span class="cx">         WithProperties('--platform=%(platform)s'), WithProperties('--%(configuration)s'),
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (244531 => 244532)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog    2019-04-23 00:16:37 UTC (rev 244531)
+++ trunk/Tools/ChangeLog       2019-04-23 00:16:48 UTC (rev 244532)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2019-04-22  Aakash Jain  <aakash_jain@apple.com>
+
+        [ews-build] Trigger queues only after uploading the archive
+        https://bugs.webkit.org/show_bug.cgi?id=197180
+
+        Reviewed by Lucas Forschler.
+
+        * BuildSlaveSupport/ews-build/factories.py:
+        (Factory.__init__):
+        (BuildFactory.__init__): Remove trigger step from factories.
+        (BuildFactory.propertiesToPassToTriggers): Deleted.
+        * BuildSlaveSupport/ews-build/steps.py:
+        (ConfigureBuild.__init__): Confiure triggers property.
+        (Trigger): Step to trigger other queues.
+        (Trigger.propertiesToPassToTriggers): Method to construct properties to pass to triggerred builds.
+        (UploadBuiltProduct.finished): Trigger builds after upload is successful.
+
</ins><span class="cx"> 2019-04-22  Alex Christensen  <achristensen@webkit.org>
</span><span class="cx"> 
</span><span class="cx">         Deprecate WKContextCreateWithInjectedBundlePath
</span></span></pre>
</div>
</div>

</body>
</html>