Title: [288040] trunk/Tools
Revision
288040
Author
[email protected]
Date
2022-01-14 17:11:44 -0800 (Fri, 14 Jan 2022)

Log Message

[EWS] ShowIdentifier should support pull-requests
https://bugs.webkit.org/show_bug.cgi?id=235252
<rdar://problem/87618736>

Reviewed by Aakash Jain.

* Tools/CISupport/ews-build/steps.py:
(ShowIdentifier.start): Extract revision from diverse set of properties.
(ShowIdentifier.evaluateCommand):
* Tools/CISupport/ews-build/steps_unittest.py:

Canonical link: https://commits.webkit.org/246066@main

Modified Paths

Diff

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


--- trunk/Tools/CISupport/ews-build/steps.py	2022-01-15 00:56:22 UTC (rev 288039)
+++ trunk/Tools/CISupport/ews-build/steps.py	2022-01-15 01:11:44 UTC (rev 288040)
@@ -407,9 +407,15 @@
     def start(self):
         self.log_observer = logobserver.BufferLogObserver()
         self.addLogObserver('stdio', self.log_observer)
-        revision = self.getProperty('ews_revision', self.getProperty('got_revision'))
-        if not revision:
-            revision = 'HEAD'
+
+        revision = 'HEAD'
+        # Note that these properties are delibrately in priority order.
+        for property_ in ['ews_revision', 'github.base.sha', 'got_revision']:
+            candidate = self.getProperty(property_)
+            if candidate:
+                revision = candidate
+                break
+
         self.setCommand(['python3', 'Tools/Scripts/git-webkit', 'find', revision])
         return shell.ShellCommand.start(self)
 

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


--- trunk/Tools/CISupport/ews-build/steps_unittest.py	2022-01-15 00:56:22 UTC (rev 288039)
+++ trunk/Tools/CISupport/ews-build/steps_unittest.py	2022-01-15 01:11:44 UTC (rev 288040)
@@ -4852,6 +4852,39 @@
         self.assertEqual(self.getProperty('identifier'), '233175@main')
         return rc
 
+    def test_success_pull_request(self):
+        self.setupStep(ShowIdentifier())
+        self.setProperty('github.base.sha', '51a6aec9f664')
+        self.expectRemoteCommands(
+            ExpectShell(workdir='wkdir',
+                        timeout=300,
+                        logEnviron=False,
+                        command=['python3', 'Tools/Scripts/git-webkit', 'find', '51a6aec9f664']) +
+            ExpectShell.log('stdio', stdout='Identifier: 233175@main') +
+            0,
+        )
+        self.expectOutcome(result=SUCCESS, state_string='Identifier: 233175@main')
+        rc = self.runStep()
+        self.assertEqual(self.getProperty('identifier'), '233175@main')
+        return rc
+
+    def test_prioritized(self):
+        self.setupStep(ShowIdentifier())
+        self.setProperty('ews_revision', '51a6aec9f664')
+        self.setProperty('github.base.sha', '9f66451a6aec')
+        self.expectRemoteCommands(
+            ExpectShell(workdir='wkdir',
+                        timeout=300,
+                        logEnviron=False,
+                        command=['python3', 'Tools/Scripts/git-webkit', 'find', '51a6aec9f664']) +
+            ExpectShell.log('stdio', stdout='Identifier: 233175@main') +
+            0,
+        )
+        self.expectOutcome(result=SUCCESS, state_string='Identifier: 233175@main')
+        rc = self.runStep()
+        self.assertEqual(self.getProperty('identifier'), '233175@main')
+        return rc
+
     def test_failure(self):
         self.setupStep(ShowIdentifier())
         self.expectRemoteCommands(

Modified: trunk/Tools/ChangeLog (288039 => 288040)


--- trunk/Tools/ChangeLog	2022-01-15 00:56:22 UTC (rev 288039)
+++ trunk/Tools/ChangeLog	2022-01-15 01:11:44 UTC (rev 288040)
@@ -1,3 +1,16 @@
+2022-01-14  Jonathan Bedard  <[email protected]>
+
+        [EWS] ShowIdentifier should support pull-requests
+        https://bugs.webkit.org/show_bug.cgi?id=235252
+        <rdar://problem/87618736>
+
+        Reviewed by Aakash Jain.
+
+        * CISupport/ews-build/steps.py:
+        (ShowIdentifier.start): Extract revision from diverse set of properties.
+        (ShowIdentifier.evaluateCommand):
+        * CISupport/ews-build/steps_unittest.py:
+
 2022-01-14  Wenson Hsieh  <[email protected]>
 
         [iOS] Occasional crash under -[UITargetedPreview initWithView:parameters:target:] when focusing form controls
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to