Title: [282100] trunk/Tools
Revision
282100
Author
clo...@igalia.com
Date
2021-09-07 11:18:49 -0700 (Tue, 07 Sep 2021)

Log Message

[build.webkit.org][ews-build.webkit.org] Only try to download from S3 on the production server
https://bugs.webkit.org/show_bug.cgi?id=230006

Reviewed by Aakash Jain.

The URL identifiers used for the S3 built products are not random,
they depend on the revision number or the patch number. So it can
happen than on a test deployment the tester downloads the built-product
from the official deployment at webkit.org rather than from its own worker.

Avoid this by ensuring that only on the official deployment it is tried to
download from S3. On the test deployments the code will now skip the step to
download from S3 and instead it will download the built product from the master.

* CISupport/build-webkit-org/steps.py:
(DownloadBuiltProduct.start):
* CISupport/ews-build/steps.py:
(DownloadBuiltProduct.getResultSummary):
(DownloadBuiltProduct.start):
* CISupport/ews-build/steps_unittest.py:

Modified Paths

Diff

Modified: trunk/Tools/CISupport/build-webkit-org/steps.py (282099 => 282100)


--- trunk/Tools/CISupport/build-webkit-org/steps.py	2021-09-07 18:14:25 UTC (rev 282099)
+++ trunk/Tools/CISupport/build-webkit-org/steps.py	2021-09-07 18:18:49 UTC (rev 282100)
@@ -405,7 +405,12 @@
     flunkOnFailure = False
 
     def start(self):
-        return shell.ShellCommand.start(self)
+        # Only try to download from S3 on the official deployment <https://webkit.org/b/230006>
+        if CURRENT_HOSTNAME == BUILD_WEBKIT_HOSTNAME:
+            return shell.ShellCommand.start(self)
+        self.build.addStepsAfterCurrentStep([DownloadBuiltProductFromMaster()])
+        self.finished(SKIPPED)
+        return defer.succeed(None)
 
     def evaluateCommand(self, cmd):
         rc = shell.ShellCommand.evaluateCommand(self, cmd)

Modified: trunk/Tools/CISupport/ews-build/steps.py (282099 => 282100)


--- trunk/Tools/CISupport/ews-build/steps.py	2021-09-07 18:14:25 UTC (rev 282099)
+++ trunk/Tools/CISupport/ews-build/steps.py	2021-09-07 18:18:49 UTC (rev 282100)
@@ -2791,7 +2791,7 @@
     flunkOnFailure = False
 
     def getResultSummary(self):
-        if self.results != SUCCESS:
+        if self.results not in [SUCCESS, SKIPPED]:
             return {'step': 'Failed to download built product from S3'}
         return super(DownloadBuiltProduct, self).getResultSummary()
 
@@ -2798,6 +2798,14 @@
     def __init__(self, **kwargs):
         super(DownloadBuiltProduct, self).__init__(logEnviron=False, **kwargs)
 
+    def start(self):
+        # Only try to download from S3 on the official deployment <https://webkit.org/b/230006>
+        if CURRENT_HOSTNAME == EWS_BUILD_HOSTNAME:
+            return shell.ShellCommand.start(self)
+        self.build.addStepsAfterCurrentStep([DownloadBuiltProductFromMaster()])
+        self.finished(SKIPPED)
+        return defer.succeed(None)
+
     def evaluateCommand(self, cmd):
         rc = shell.ShellCommand.evaluateCommand(self, cmd)
         if rc == FAILURE:

Modified: trunk/Tools/CISupport/ews-build/steps_unittest.py (282099 => 282100)


--- trunk/Tools/CISupport/ews-build/steps_unittest.py	2021-09-07 18:14:25 UTC (rev 282099)
+++ trunk/Tools/CISupport/ews-build/steps_unittest.py	2021-09-07 18:18:49 UTC (rev 282100)
@@ -3039,7 +3039,8 @@
             + 0,
         )
         self.expectOutcome(result=SUCCESS, state_string='Downloaded built product')
-        return self.runStep()
+        with current_hostname(EWS_BUILD_HOSTNAME):
+            return self.runStep()
 
     def test_failure(self):
         self.setupStep(DownloadBuiltProduct())
@@ -3056,9 +3057,20 @@
             + 2,
         )
         self.expectOutcome(result=FAILURE, state_string='Failed to download built product from S3')
-        return self.runStep()
+        with current_hostname(EWS_BUILD_HOSTNAME):
+            return self.runStep()
 
+    def test_deployment_skipped(self):
+        self.setupStep(DownloadBuiltProduct())
+        self.setProperty('fullPlatform', 'gtk')
+        self.setProperty('configuration', 'release')
+        self.setProperty('architecture', 'x86_64')
+        self.setProperty('patch_id', '123456')
+        self.expectOutcome(result=SKIPPED)
+        with current_hostname('test-ews-deployment.igalia.com'):
+            return self.runStep()
 
+
 class TestDownloadBuiltProductFromMaster(BuildStepMixinAdditions, unittest.TestCase):
     READ_LIMIT = 1000
 

Modified: trunk/Tools/ChangeLog (282099 => 282100)


--- trunk/Tools/ChangeLog	2021-09-07 18:14:25 UTC (rev 282099)
+++ trunk/Tools/ChangeLog	2021-09-07 18:18:49 UTC (rev 282100)
@@ -1,3 +1,26 @@
+2021-09-07  Carlos Alberto Lopez Perez  <clo...@igalia.com>
+
+        [build.webkit.org][ews-build.webkit.org] Only try to download from S3 on the production server
+        https://bugs.webkit.org/show_bug.cgi?id=230006
+
+        Reviewed by Aakash Jain.
+
+        The URL identifiers used for the S3 built products are not random,
+        they depend on the revision number or the patch number. So it can
+        happen than on a test deployment the tester downloads the built-product
+        from the official deployment at webkit.org rather than from its own worker.
+
+        Avoid this by ensuring that only on the official deployment it is tried to
+        download from S3. On the test deployments the code will now skip the step to
+        download from S3 and instead it will download the built product from the master.
+
+        * CISupport/build-webkit-org/steps.py:
+        (DownloadBuiltProduct.start):
+        * CISupport/ews-build/steps.py:
+        (DownloadBuiltProduct.getResultSummary):
+        (DownloadBuiltProduct.start):
+        * CISupport/ews-build/steps_unittest.py:
+
 2021-09-07  Megan Gardner  <megan_gard...@apple.com>
 
         Rewrite long press and drag tests to be more robust.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to