Diff
Modified: trunk/Tools/CISupport/ews-build/events.py (288473 => 288474)
--- trunk/Tools/CISupport/ews-build/events.py 2022-01-24 22:51:13 UTC (rev 288473)
+++ trunk/Tools/CISupport/ews-build/events.py 2022-01-24 22:54:47 UTC (rev 288474)
@@ -162,7 +162,7 @@
@defer.inlineCallbacks
def buildFinishedGitHub(self, context, build):
- sha = self.extractProperty(build, 'revision')
+ sha = self.extractProperty(build, 'github.head.sha')
repository = self.extractProperty(build, 'repository')
if not sha or not repository:
@@ -225,7 +225,7 @@
@defer.inlineCallbacks
def stepStartedGitHub(self, build, state_string):
- sha = self.extractProperty(build, 'revision')
+ sha = self.extractProperty(build, 'github.head.sha')
repository = self.extractProperty(build, 'repository')
if not sha or not repository:
print('Pull request number defined, but sha is {} and repository {}, which are invalid'.format(sha, repository))
Modified: trunk/Tools/CISupport/ews-build/master.cfg (288473 => 288474)
--- trunk/Tools/CISupport/ews-build/master.cfg 2022-01-24 22:51:13 UTC (rev 288473)
+++ trunk/Tools/CISupport/ews-build/master.cfg 2022-01-24 22:54:47 UTC (rev 288474)
@@ -50,6 +50,7 @@
'github.number',
'github.title',
'github.head.ref',
+ 'github.head.sha',
'github.base.sha',
'github.head.repo.full_name',
], 'token': load_password('GITHUB_COM_ACCESS_TOKEN'),
Modified: trunk/Tools/CISupport/ews-build/steps.py (288473 => 288474)
--- trunk/Tools/CISupport/ews-build/steps.py 2022-01-24 22:51:13 UTC (rev 288473)
+++ trunk/Tools/CISupport/ews-build/steps.py 2022-01-24 22:54:47 UTC (rev 288474)
@@ -193,7 +193,7 @@
self._addToLog('stdio', 'Failed to fetch hash of pull request {}\n'.format(pr_number))
return -1
- return 0 if pr_sha == self.getProperty('revision', '?') else 1
+ return 0 if pr_sha == self.getProperty('github.head.sha', '?') else 1
class Contributors(object):
@@ -317,7 +317,7 @@
pr_number = self.getProperty('github.number')
title = self.getProperty('github.title', '')
owners = self.getProperty('owners', [])
- revision = self.getProperty('revision')
+ revision = self.getProperty('github.head.sha')
if pr_number and title:
self.addURL('PR {}: {}'.format(pr_number, title), GitHub.pr_url(pr_number, repository_url))
@@ -1225,7 +1225,7 @@
obsolete = self._is_pr_obsolete(pr_number, repository_url=repository_url) if self.verifyObsolete else 0
if obsolete == 1:
- self.skip_build('Pull request {} (sha {}) is obsolete'.format(pr_number, self.getProperty('revision', '?')[:HASH_LENGTH_TO_DISPLAY]))
+ self.skip_build('Pull request {} (sha {}) is obsolete'.format(pr_number, self.getProperty('github.head.sha', '?')[:HASH_LENGTH_TO_DISPLAY]))
return False
if obsolete == -1 or pr_closed == -1:
Modified: trunk/Tools/CISupport/ews-build/steps_unittest.py (288473 => 288474)
--- trunk/Tools/CISupport/ews-build/steps_unittest.py 2022-01-24 22:51:13 UTC (rev 288473)
+++ trunk/Tools/CISupport/ews-build/steps_unittest.py 2022-01-24 22:54:47 UTC (rev 288474)
@@ -4685,7 +4685,7 @@
ValidateChange.get_pr_json = lambda x, pull_request, repository_url=None: self.get_pr(pr_number=pull_request)
self.setProperty('github.number', '1234')
self.setProperty('repository', 'https://github.com/WebKit/WebKit')
- self.setProperty('revision', '7496f8ecc4cc8011f19c8cc1bc7b18fe4a88ad5c')
+ self.setProperty('github.head.sha', '7496f8ecc4cc8011f19c8cc1bc7b18fe4a88ad5c')
self.expectOutcome(result=SUCCESS, state_string='Validated change')
rc = self.runStep()
self.assertEqual(self.getProperty('fast_commit_queue'), None, 'fast_commit_queue is unexpectedly set')
@@ -4705,7 +4705,7 @@
ValidateChange.get_pr_json = lambda x, pull_request, repository_url=None: self.get_pr(pr_number=pull_request)
self.setProperty('github.number', '1234')
self.setProperty('repository', 'https://github.com/WebKit/WebKit')
- self.setProperty('revision', '1ad60d45a112301f7b9f93dac06134524dae8480')
+ self.setProperty('github.head.sha', '1ad60d45a112301f7b9f93dac06134524dae8480')
self.expectOutcome(result=FAILURE, state_string='Pull request 1234 (sha 1ad60d45) is obsolete')
rc = self.runStep()
self.assertEqual(self.getProperty('fast_commit_queue'), None, 'fast_commit_queue is unexpectedly set')
Modified: trunk/Tools/ChangeLog (288473 => 288474)
--- trunk/Tools/ChangeLog 2022-01-24 22:51:13 UTC (rev 288473)
+++ trunk/Tools/ChangeLog 2022-01-24 22:54:47 UTC (rev 288474)
@@ -1,3 +1,21 @@
+2022-01-24 Jonathan Bedard <[email protected]>
+
+ [EWS] Use github.head.sha instead of revision
+ https://bugs.webkit.org/show_bug.cgi?id=235521
+ <rdar://problem/87970427>
+
+ Reviewed by Aakash Jain.
+
+ * CISupport/ews-build/events.py:
+ (Events.buildFinishedGitHub): Use github.head.sha instead of revision.
+ (Events.stepStartedGitHub): Ditto.
+ * CISupport/ews-build/master.cfg: Extract github.head.sha from hook.
+ * CISupport/ews-build/steps.py:
+ (GitHubMixin._is_pr_obsolete): Use github.head.sha instead of revision.
+ (ConfigureBuild.add_pr_details): Ditto.
+ (ValidateChange.validate_github): Ditto.
+ * CISupport/ews-build/steps_unittest.py:
+
2022-01-24 Mark Lam <[email protected]>
Add FixedVector::clear(), contains(), find(), and findMatching().