prow/config/tide.go
func (cp *TideContextPolicy) IsOptional(c string) bool {
	if sets.NewString(cp.OptionalContexts...).Has(c) {
		return true
	}
	if sets.NewString(cp.RequiredContexts...).Has(c) {
		return false
	}
	// assume if we're asking that the context is present on the PR
	if sets.NewString(cp.RequiredIfPresentContexts...).Has(c) {
		return false
	}
	if cp.SkipUnknownContexts != nil && *cp.SkipUnknownContexts {
		return true
	}
	return false
}
func (cp *TideContextPolicy) IsOptional(c string) bool {
	if sets.NewString(cp.OptionalContexts...).Has(c) {
		return true
	}
	if sets.NewString(cp.RequiredContexts...).Has(c) {
		return false
	}
	// assume if we're asking that the context is present on the PR
	if sets.NewString(cp.RequiredIfPresentContexts...).Has(c) {
		return false
	}
	if cp.SkipUnknownContexts != nil && *cp.SkipUnknownContexts {
		return true
	}
	return false
}
func ( cp * TideContextPolicy ) IsOptional ( c string ) bool { if sets . NewString ( cp . OptionalContexts ... ) . Has ( c ) { return true } if sets . NewString ( cp . RequiredContexts ... ) . Has ( c ) { return false } // assume if we're asking that the context is present on the PR if sets . NewString ( cp . RequiredIfPresentContexts ... ) . Has ( c ) { return false } if cp . SkipUnknownContexts != nil && * cp . SkipUnknownContexts { return true } return false }
// IsOptional checks whether a context can be ignored.
// Will return true if
// - context is registered as optional
// - required contexts are registered and the context provided is not required
// Will return false otherwise. Every context is required.
IsOptional checks whether a context can be ignored . Will return true if - context is registered as optional - required contexts are registered and the context provided is not required Will return false otherwise . Every context is required .