prow/plugins/trigger/generic-comment.go
func determineSkippedPresubmits(toTrigger, toSkipSuperset []config.Presubmit, logger *logrus.Entry) []config.Presubmit {
	triggeredContexts := sets.NewString()
	for _, presubmit := range toTrigger {
		triggeredContexts.Insert(presubmit.Context)
	}
	var toSkip []config.Presubmit
	for _, presubmit := range toSkipSuperset {
		if triggeredContexts.Has(presubmit.Context) {
			logger.WithFields(logrus.Fields{"context": presubmit.Context, "job": presubmit.Name}).Debug("Not skipping job as context will be created by a triggered job.")
			continue
		}
		toSkip = append(toSkip, presubmit)
	}
	return toSkip
}
func determineSkippedPresubmits(toTrigger, toSkipSuperset []config.Presubmit, logger *logrus.Entry) []config.Presubmit {
	triggeredContexts := sets.NewString()
	for _, presubmit := range toTrigger {
		triggeredContexts.Insert(presubmit.Context)
	}
	var toSkip []config.Presubmit
	for _, presubmit := range toSkipSuperset {
		if triggeredContexts.Has(presubmit.Context) {
			logger.WithFields(logrus.Fields{"context": presubmit.Context, "job": presubmit.Name}).Debug("Not skipping job as context will be created by a triggered job.")
			continue
		}
		toSkip = append(toSkip, presubmit)
	}
	return toSkip
}
// determineSkippedPresubmits identifies the largest set of contexts we can actually
// post skipped contexts for, given a set of presubmits we're triggering. We don't
// want to skip a job that posts a context that will be written to by a job we just
// identified for triggering or the skipped context will override the triggered one