コード例 #1
0
ファイル: githubmodel.py プロジェクト: progmaticlab/zuul
    def __init__(self,
                 trigger,
                 types=[],
                 branches=[],
                 refs=[],
                 comments=[],
                 actions=[],
                 labels=[],
                 unlabels=[],
                 states=[],
                 statuses=[],
                 required_statuses=[],
                 ignore_deletes=True):

        EventFilter.__init__(self, trigger)

        GithubCommonFilter.__init__(self, required_statuses=required_statuses)

        self._types = types
        self._branches = branches
        self._refs = refs
        self._comments = comments
        self.types = [re.compile(x) for x in types]
        self.branches = [re.compile(x) for x in branches]
        self.refs = [re.compile(x) for x in refs]
        self.comments = [re.compile(x) for x in comments]
        self.actions = actions
        self.labels = labels
        self.unlabels = unlabels
        self.states = states
        self.statuses = statuses
        self.required_statuses = required_statuses
        self.ignore_deletes = ignore_deletes
コード例 #2
0
    def __init__(self,
                 trigger,
                 types=[],
                 branches=[],
                 refs=[],
                 event_approvals={},
                 comments=[],
                 emails=[],
                 usernames=[],
                 required_approvals=[],
                 reject_approvals=[],
                 ignore_deletes=True):

        EventFilter.__init__(self, trigger)

        GerritApprovalFilter.__init__(self,
                                      required_approvals=required_approvals,
                                      reject_approvals=reject_approvals)

        self._types = types
        self._branches = branches
        self._refs = refs
        self._comments = comments
        self._emails = emails
        self._usernames = usernames
        self.types = [re.compile(x) for x in types]
        self.branches = [re.compile(x) for x in branches]
        self.refs = [re.compile(x) for x in refs]
        self.comments = [re.compile(x) for x in comments]
        self.emails = [re.compile(x) for x in emails]
        self.usernames = [re.compile(x) for x in usernames]
        self.event_approvals = event_approvals
        self.ignore_deletes = ignore_deletes
コード例 #3
0
    def __init__(self, trigger, types=[], branches=[], refs=[],
                 event_approvals={}, comments=[], emails=[], usernames=[],
                 required_approvals=[], reject_approvals=[],
                 ignore_deletes=True):

        EventFilter.__init__(self, trigger)

        GerritApprovalFilter.__init__(self,
                                      required_approvals=required_approvals,
                                      reject_approvals=reject_approvals)

        self._types = types
        self._branches = branches
        self._refs = refs
        self._comments = comments
        self._emails = emails
        self._usernames = usernames
        self.types = [re.compile(x) for x in types]
        self.branches = [re.compile(x) for x in branches]
        self.refs = [re.compile(x) for x in refs]
        self.comments = [re.compile(x) for x in comments]
        self.emails = [re.compile(x) for x in emails]
        self.usernames = [re.compile(x) for x in usernames]
        self.event_approvals = event_approvals
        self.ignore_deletes = ignore_deletes
コード例 #4
0
ファイル: zuulmodel.py プロジェクト: sambacha/zuul-zuul
    def __init__(self, trigger, types=[], pipelines=[]):
        EventFilter.__init__(self, trigger)

        self._types = types
        self._pipelines = pipelines
        self.types = [re.compile(x) for x in types]
        self.pipelines = [re.compile(x) for x in pipelines]
コード例 #5
0
ファイル: paguremodel.py プロジェクト: sambacha/zuul-zuul
    def __init__(self, trigger, types=[], refs=[], statuses=[],
                 comments=[], actions=[], tags=[], ignore_deletes=True):

        EventFilter.__init__(self, trigger)

        self._types = types
        self._refs = refs
        self._comments = comments
        self.types = [re.compile(x) for x in types]
        self.refs = [re.compile(x) for x in refs]
        self.comments = [re.compile(x) for x in comments]
        self.actions = actions
        self.statuses = statuses
        self.tags = tags
        self.ignore_deletes = ignore_deletes
コード例 #6
0
ファイル: timer.py プロジェクト: ANTodorov/zuul
    def getEventFilters(self, trigger_conf):
        def toList(item):
            if not item:
                return []
            if isinstance(item, list):
                return item
            return [item]

        efilters = []
        for trigger in toList(trigger_conf):
            f = EventFilter(trigger=self,
                            types=['timer'],
                            timespecs=toList(trigger['time']))

            efilters.append(f)

        return efilters
コード例 #7
0
    def getEventFilters(self, trigger_conf):
        def toList(item):
            if not item:
                return []
            if isinstance(item, list):
                return item
            return [item]

        efilters = []
        for trigger in toList(trigger_conf):
            approvals = {}
            for approval_dict in toList(trigger.get('approval')):
                for key, val in approval_dict.items():
                    approvals[key] = val
            # Backwards compat for *_filter versions of these args
            comments = toList(trigger.get('comment'))
            if not comments:
                comments = toList(trigger.get('comment_filter'))
            emails = toList(trigger.get('email'))
            if not emails:
                emails = toList(trigger.get('email_filter'))
            usernames = toList(trigger.get('username'))
            if not usernames:
                usernames = toList(trigger.get('username_filter'))
            ignore_deletes = trigger.get('ignore-deletes', True)
            f = EventFilter(
                trigger=self,
                types=toList(trigger['event']),
                branches=toList(trigger.get('branch')),
                refs=toList(trigger.get('ref')),
                event_approvals=approvals,
                comments=comments,
                emails=emails,
                usernames=usernames,
                required_approvals=(
                    toList(trigger.get('require-approval'))
                ),
                reject_approvals=toList(
                    trigger.get('reject-approval')
                ),
                ignore_deletes=ignore_deletes
            )
            efilters.append(f)

        return efilters
コード例 #8
0
ファイル: zuultrigger.py プロジェクト: liskin/zuul
    def getEventFilters(self, trigger_conf):
        def toList(item):
            if not item:
                return []
            if isinstance(item, list):
                return item
            return [item]

        efilters = []
        for trigger in toList(trigger_conf):
            f = EventFilter(
                trigger=self,
                types=toList(trigger['event']),
                pipelines=toList(trigger.get('pipeline')),
                required_approvals=(toList(trigger.get('require-approval'))),
                reject_approvals=toList(trigger.get('reject-approval')),
            )
            efilters.append(f)

        return efilters
コード例 #9
0
    def getEventFilters(self, trigger_config):
        def toList(item):
            if not item:
                return []
            if isinstance(item, list):
                return item
            return [item]

        efilters = []
        for trigger in toList(trigger_config):
            f = EventFilter(
                trigger=self,
                types=toList(trigger['event']),
                branches=toList(trigger.get('branch')),
                refs=toList(trigger.get('ref')),
                comments=toList(trigger.get('comment')),
                labels=toList(trigger.get('label'))
            )
            efilters.append(f)

        return efilters
コード例 #10
0
    def __init__(self, trigger, types=[], timespecs=[]):
        EventFilter.__init__(self, trigger)

        self._types = types
        self.types = [re.compile(x) for x in types]
        self.timespecs = timespecs