| Differences between
and this patch
- a/Tools/CISupport/ews-build/config.json -1 / +1 lines
Lines 335-341 a/Tools/CISupport/ews-build/config.json_sec1
335
      "name": "Commit-Queue", "shortname": "commit", "icon": "buildAndTest",
335
      "name": "Commit-Queue", "shortname": "commit", "icon": "buildAndTest",
336
      "factory": "CommitQueueFactory", "platform": "mac-bigsur",
336
      "factory": "CommitQueueFactory", "platform": "mac-bigsur",
337
      "configuration": "release", "architectures": ["x86_64"],
337
      "configuration": "release", "architectures": ["x86_64"],
338
      "workernames": ["webkit-cq-01", "webkit-cq-02", "webkit-cq-03"]
338
      "workernames": ["webkit-cq-01", "webkit-cq-02", "webkit-cq-03", "ews151"]
339
    },
339
    },
340
    {
340
    {
341
      "name": "Merge-Queue", "shortname": "merge", "icon": "buildAndTest",
341
      "name": "Merge-Queue", "shortname": "merge", "icon": "buildAndTest",
- a/Tools/CISupport/ews-build/factories.py -5 / +14 lines
Lines 24-30 a/Tools/CISupport/ews-build/factories.py_sec1
24
from buildbot.process import factory
24
from buildbot.process import factory
25
from buildbot.steps import trigger
25
from buildbot.steps import trigger
26
26
27
from steps import (AddAuthorToCommitMessage, AddReviewerToCommitMessage, AddReviewerToChangeLog, ApplyPatch, ApplyWatchList, Canonicalize,
27
from steps import (AddAuthorToCommitMessage, AddReviewerToCommitMessage, AddReviewerToChangeLog, ApplyPatch, ApplyWatchList, Canonicalize, CommitPatch,
28
                   CheckOutPullRequest, CheckOutSource, CheckOutSpecificRevision, CheckChangeRelevance,
28
                   CheckOutPullRequest, CheckOutSource, CheckOutSpecificRevision, CheckChangeRelevance,
29
                   CheckPatchStatusOnEWSQueues, CheckStyle, CleanGitRepo, CompileJSC, CompileWebKit, ConfigureBuild, CreateLocalGITCommit,
29
                   CheckPatchStatusOnEWSQueues, CheckStyle, CleanGitRepo, CompileJSC, CompileWebKit, ConfigureBuild, CreateLocalGITCommit,
30
                   DownloadBuiltProduct, ExtractBuiltProduct, FetchBranches, FindModifiedChangeLogs, FindModifiedLayoutTests, GitSvnFetch,
30
                   DownloadBuiltProduct, ExtractBuiltProduct, FetchBranches, FindModifiedChangeLogs, FindModifiedLayoutTests, GitSvnFetch,
Lines 34-40 from steps import (AddAuthorToCommitMessage, AddReviewerToCommitMessage, AddRevi a/Tools/CISupport/ews-build/factories.py_sec2
34
                   RunWebKitPyPython3Tests, RunWebKitTests, RunWebKitTestsRedTree, RunWebKitTestsInStressMode, RunWebKitTestsInStressGuardmallocMode,
34
                   RunWebKitPyPython3Tests, RunWebKitTests, RunWebKitTestsRedTree, RunWebKitTestsInStressMode, RunWebKitTestsInStressGuardmallocMode,
35
                   SetBuildSummary, ShowIdentifier, TriggerCrashLogSubmission, UpdateWorkingDirectory,
35
                   SetBuildSummary, ShowIdentifier, TriggerCrashLogSubmission, UpdateWorkingDirectory,
36
                   ValidateCommitMessage, ValidateChange, ValidateChangeLogAndReviewer, ValidateCommitterAndReviewer, WaitForCrashCollection,
36
                   ValidateCommitMessage, ValidateChange, ValidateChangeLogAndReviewer, ValidateCommitterAndReviewer, WaitForCrashCollection,
37
                   InstallBuiltProduct, VerifyGitHubIntegrity, ValidateSquashed)
37
                   InstallBuiltProduct, VerifyGitHubIntegrity, ValidateSquashed, ShowCommitMessage)
38
38
39
39
40
class Factory(factory.BuildFactory):
40
class Factory(factory.BuildFactory):
Lines 298-306 class CommitQueueFactory(factory.BuildFactory): a/Tools/CISupport/ews-build/factories.py_sec3
298
        self.addStep(ShowIdentifier())
298
        self.addStep(ShowIdentifier())
299
        self.addStep(VerifyGitHubIntegrity())
299
        self.addStep(VerifyGitHubIntegrity())
300
        self.addStep(UpdateWorkingDirectory())
300
        self.addStep(UpdateWorkingDirectory())
301
        self.addStep(ApplyPatch())
301
        self.addStep(CommitPatch())
302
        self.addStep(ValidateChangeLogAndReviewer())
302
303
        self.addStep(FindModifiedChangeLogs())
303
        self.addStep(ShowCommitMessage())
304
        self.addStep(ValidateSquashed())
305
        self.addStep(ShowCommitMessage())
306
        self.addStep(AddReviewerToCommitMessage())
307
        self.addStep(ShowCommitMessage())
308
        self.addStep(AddAuthorToCommitMessage())
309
        self.addStep(ShowCommitMessage())
310
        self.addStep(ValidateCommitMessage())
311
        self.addStep(ShowCommitMessage())
312
304
        self.addStep(KillOldProcesses())
313
        self.addStep(KillOldProcesses())
305
        self.addStep(CompileWebKit(skipUpload=True))
314
        self.addStep(CompileWebKit(skipUpload=True))
306
        self.addStep(KillOldProcesses())
315
        self.addStep(KillOldProcesses())
- a/Tools/CISupport/ews-build/steps.py -1 / +69 lines
Lines 845-850 class ApplyPatch(shell.ShellCommand, CompositeStepMixin, ShellMixin): a/Tools/CISupport/ews-build/steps.py_sec1
845
        return rc
845
        return rc
846
846
847
847
848
class CommitPatch(steps.ShellSequence, CompositeStepMixin, ShellMixin):
849
    name = 'commit-patch'
850
    description = ['commit-patch']
851
    descriptionDone = ['Created commit from patch']
852
    haltOnFailure = True
853
    FILTER_BRANCH_PROGRAM = '''import re
854
import sys
855
856
lines = [l for l in sys.stdin]
857
for s in re.split(r' (Need the bug URL \(OOPS!\).)|(\S+:\/\/\S+)', lines[0].rstrip()):
858
    if s and s != ' ':
859
        print(s)
860
for l in lines[1:]:
861
    sys.stdout.write(l)
862
'''
863
864
    def __init__(self, **kwargs):
865
        super(CommitPatch, self).__init__(timeout=10 * 60, logEnviron=False, **kwargs)
866
867
    def doStepIf(self, step):
868
        return self.getProperty('patch_id', False)
869
870
    def _get_patch(self):
871
        sourcestamp = self.build.getSourceStamp(self.getProperty('codebase', ''))
872
        if not sourcestamp or not sourcestamp.patch:
873
            return None
874
        return sourcestamp.patch[1]
875
876
    def run(self):
877
        commands = []
878
        if not patch:
879
            command += ['curl', '-L', 'https://bugs.webkit.org/attachment.cgi?id={}'.format(self.getProperty('patch_id', '')), '-o', '.buildbot-diff']
880
        command += [
881
            'git', 'am', '.buildbot-diff',
882
            'git', 'filter-branch', '-f', '--msg-filter', 'python3 -c "{}"'.format(self.FILTER_BRANCH_PROGRAM), 'HEAD...HEAD~1',
883
        ]
884
        for command in commands:
885
            self.commands.append(util.ShellArg(command=command, logname='stdio', haltOnFailure=True))
886
887
        return super(CommitPatch, self).run()
888
889
    def hideStepIf(self, results, step):
890
        return not self.doStepIf(step) or (results == SUCCESS and self.getProperty('sensitive', False))
891
892
    def getResultSummary(self):
893
        if self.results == SKIPPED:
894
            return {'step': "Skipping creating commitsince patch_id isn't provided"}
895
        if self.results != SUCCESS:
896
            return {'step': 'git am failed to apply patch to trunk'}
897
        return super(CommitPatch, self).getResultSummary()
898
899
848
class CheckOutPullRequest(steps.ShellSequence, ShellMixin):
900
class CheckOutPullRequest(steps.ShellSequence, ShellMixin):
849
    name = 'checkout-pull-request'
901
    name = 'checkout-pull-request'
850
    description = ['checking-out-pull-request']
902
    description = ['checking-out-pull-request']
Lines 5246-5248 class ResetGitSvn(shell.ShellCommand): a/Tools/CISupport/ews-build/steps.py_sec2
5246
        if self.results == FAILURE:
5298
        if self.results == FAILURE:
5247
            return {'step': 'Failed to remove git-svn references'}
5299
            return {'step': 'Failed to remove git-svn references'}
5248
        return super(GitSvnFetch, self).getResultSummary()
5300
        return super(GitSvnFetch, self).getResultSummary()
5249
- 
5301
5302
5303
class ShowCommitMessage(shell.ShellCommand):
5304
    name = 'show-commit-message'
5305
    haltOnFailure = False
5306
    flunkOnFailure = False
5307
    command = ['rm', '-rf', '.git/svn']
5308
5309
    def __init__(self, **kwargs):
5310
        super(ResetGitSvn, self).__init__(logEnviron=False, timeout=300, **kwargs)
5311
5312
    def getResultSummary(self):
5313
        if self.results == SUCCESS:
5314
            return {'step': 'Removed git-svn references'}
5315
        if self.results == FAILURE:
5316
            return {'step': 'Failed to remove git-svn references'}
5317
        return super(GitSvnFetch, self).getResultSummary()

Return to Bug 240461