prow/gerrit/adapter/trigger.go
func messageFilter(lastUpdate time.Time, change client.ChangeInfo, presubmits []config.Presubmit) (pjutil.Filter, error) {
	var filters []pjutil.Filter
	currentRevision := change.Revisions[change.CurrentRevision].Number
	for _, message := range change.Messages {
		messageTime := message.Date.Time
		if message.RevisionNumber != currentRevision || !messageTime.After(lastUpdate) {
			continue
		}

		if !pjutil.TestAllRe.MatchString(message.Message) {
			for _, presubmit := range presubmits {
				if presubmit.TriggerMatches(message.Message) {
					logrus.Infof("Change %d: Comment %s matches triggering regex, for %s.", change.Number, message.Message, presubmit.Name)
					filters = append(filters, pjutil.CommandFilter(message.Message))
				}
			}
		} else {
			filters = append(filters, pjutil.TestAllFilter())
		}

	}
	return pjutil.AggregateFilter(filters), nil
}
func messageFilter(lastUpdate time.Time, change client.ChangeInfo, presubmits []config.Presubmit) (pjutil.Filter, error) {
	var filters []pjutil.Filter
	currentRevision := change.Revisions[change.CurrentRevision].Number
	for _, message := range change.Messages {
		messageTime := message.Date.Time
		if message.RevisionNumber != currentRevision || !messageTime.After(lastUpdate) {
			continue
		}

		if !pjutil.TestAllRe.MatchString(message.Message) {
			for _, presubmit := range presubmits {
				if presubmit.TriggerMatches(message.Message) {
					logrus.Infof("Change %d: Comment %s matches triggering regex, for %s.", change.Number, message.Message, presubmit.Name)
					filters = append(filters, pjutil.CommandFilter(message.Message))
				}
			}
		} else {
			filters = append(filters, pjutil.TestAllFilter())
		}

	}
	return pjutil.AggregateFilter(filters), nil
}
// messageFilter builds a filter for jobs based on the messageBody matching the trigger regex of the jobs.