WebKit Bugzilla
Attachment 346444 Details for
Bug 188295
: [ews-build] Add build step to Check Patch Relevance
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
WIP
ews_checkPatchRelevance.patch (text/plain), 5.77 KB, created by
Aakash Jain
on 2018-08-02 19:13:00 PDT
(
hide
)
Description:
WIP
Filename:
MIME Type:
Creator:
Aakash Jain
Created:
2018-08-02 19:13:00 PDT
Size:
5.77 KB
patch
obsolete
>Index: Tools/ChangeLog >=================================================================== >--- Tools/ChangeLog (revision 234534) >+++ Tools/ChangeLog (working copy) >@@ -1,3 +1,19 @@ >+2018-08-02 Aakash Jain <aakash_jain@apple.com> >+ >+ [ews-build] Add build step to Check Patch Relevance >+ https://bugs.webkit.org/show_bug.cgi?id=188295 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * BuildSlaveSupport/ews-build/steps.py: >+ (CheckPatchRelevance): Added step to check patch relevance. >+ (CheckPatchRelevance._changed_files): >+ (CheckPatchRelevance._patch_is_relevant): Checks if the patch is relevant. >+ (CheckPatchRelevance._get_patch): Retrieves the patch from buildbot. >+ (CheckPatchRelevance._addToLog): Add the log message. >+ (CheckPatchRelevance.start): >+ * BuildSlaveSupport/ews-build/factories.py: Added CheckPatchRelevance step appropriately. >+ > 2018-08-02 Nan Wang <n_wang@apple.com> > > AX: [iOS] add support to return the attributed string under the element >Index: Tools/BuildSlaveSupport/ews-build/factories.py >=================================================================== >--- Tools/BuildSlaveSupport/ews-build/factories.py (revision 234534) >+++ Tools/BuildSlaveSupport/ews-build/factories.py (working copy) >@@ -45,6 +45,7 @@ class StyleFactory(Factory): > class BindingsFactory(Factory): > def __init__(self, platform, configuration=None, architectures=None, additionalArguments=None, **kwargs): > Factory.__init__(self, platform, configuration, architectures, False, additionalArguments) >+ self.addStep(CheckPatchRelevance()) > self.addStep(RunBindingsTests()) > > >@@ -57,6 +58,7 @@ class WebKitPerlFactory(Factory): > class WebKitPyFactory(Factory): > def __init__(self, platform, configuration=None, architectures=None, additionalArguments=None, **kwargs): > Factory.__init__(self, platform, configuration, architectures, False, additionalArguments) >+ self.addStep(CheckPatchRelevance()) > self.addStep(RunWebKitPyTests()) > > >@@ -86,6 +88,7 @@ class BuildFactory(Factory): > class JSCTestsFactory(Factory): > def __init__(self, platform, configuration='release', architectures=None, additionalArguments=None, **kwargs): > Factory.__init__(self, platform, configuration, architectures, False, additionalArguments) >+ self.addStep(CheckPatchRelevance()) > self.addStep(CompileJSCOnly()) > self.addStep(UnApplyPatchIfRequired()) > self.addStep(CompileJSCOnlyToT()) >Index: Tools/BuildSlaveSupport/ews-build/steps.py >=================================================================== >--- Tools/BuildSlaveSupport/ews-build/steps.py (revision 234534) >+++ Tools/BuildSlaveSupport/ews-build/steps.py (working copy) >@@ -76,6 +76,99 @@ class CheckOutSource(svn.SVN): > **kwargs) > > >+class CheckPatchRelevance(buildstep.BuildStep): >+ name = 'check-patch-relevance' >+ description = ['check-patch-relevance running'] >+ descriptionDone = ['check-patch-relevance'] >+ flunkOnFailure = True >+ haltOnFailure = True >+ >+ bindings_paths = [ >+ "Source/WebCore", >+ "Tools", >+ ] >+ >+ jsc_paths = [ >+ "JSTests/", >+ "Source/JavaScriptCore/", >+ "Source/WTF/", >+ "Source/bmalloc/", >+ "Makefile", >+ "Makefile.shared", >+ "Source/Makefile", >+ "Source/Makefile.shared", >+ "Tools/Scripts/build-webkit", >+ "Tools/Scripts/build-jsc", >+ "Tools/Scripts/jsc-stress-test-helpers/", >+ "Tools/Scripts/run-jsc", >+ "Tools/Scripts/run-jsc-benchmarks", >+ "Tools/Scripts/run-jsc-stress-tests", >+ "Tools/Scripts/run-javascriptcore-tests", >+ "Tools/Scripts/run-layout-jsc", >+ "Tools/Scripts/update-javascriptcore-test-results", >+ "Tools/Scripts/webkitdirs.pm", >+ ] >+ >+ webkitpy_paths = [ >+ "Tools/Scripts/webkitpy/", >+ "Tools/QueueStatusServer/", >+ ] >+ >+ group_to_paths_mapping = { >+ 'bindings': bindings_paths, >+ 'jsc': jsc_paths, >+ 'webkitpy': webkitpy_paths, >+ } >+ >+ def _changed_files(self, patch): >+ return patch.splitlines() >+ >+ def _patch_is_relevant(self, patch, builderName): >+ # In the default case, all patches are relevant >+ group = [group for group in self.group_to_paths_mapping.keys() if group in builderName.lower()] >+ if not group: >+ return True >+ >+ changed_files = self._changed_files(patch) >+ patterns = self.group_to_paths_mapping[group[0]] >+ >+ for changed_file in changed_files: >+ for pattern in patterns: >+ if re.search(pattern, changed_file, re.IGNORECASE): >+ return True >+ return False >+ >+ def _get_patch(self): >+ sourcestamp = self.build.getSourceStamp() >+ if not sourcestamp or not sourcestamp.patch: >+ return None >+ return sourcestamp.patch[1] >+ >+ @defer.inlineCallbacks >+ def _addToLog(self, logName, message): >+ try: >+ log = self.getLog(logName) >+ except KeyError: >+ log = yield self.addLog(logName) >+ log.addStdout(message) >+ >+ def start(self): >+ patch = self._get_patch() >+ if not patch: >+ # This build doesn't have an patch, it might be a force build. >+ self.finished(SUCCESS) >+ return None >+ >+ if self._patch_is_relevant(patch, self.getProperty('buildername', '')): >+ self._addToLog('stdio', 'This patch contains relevant changes.') >+ self.finished(SUCCESS) >+ return None >+ >+ self._addToLog('stdio', 'This patch does not have relevant changes.') >+ self.finished(FAILURE) >+ return None >+ >+ > class UnApplyPatchIfRequired(CheckOutSource): > name = 'unapply-patch' >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188295
:
346444
|
346500