prow/config/tide.go
func (tqs TideQueries) OrgExceptionsAndRepos() (map[string]sets.String, sets.String) {
	orgs := make(map[string]sets.String)
	for i := range tqs {
		for _, org := range tqs[i].Orgs {
			applicableRepos := sets.NewString(reposInOrg(org, tqs[i].ExcludedRepos)...)
			if excepts, ok := orgs[org]; !ok {
				// We have not seen this org so the exceptions are just applicable
				// members of 'excludedRepos'.
				orgs[org] = applicableRepos
			} else {
				// We have seen this org so the exceptions are the applicable
				// members of 'excludedRepos' intersected with existing exceptions.
				orgs[org] = excepts.Intersection(applicableRepos)
			}
		}
	}
	repos := sets.NewString()
	for i := range tqs {
		repos.Insert(tqs[i].Repos...)
	}
	// Remove any org exceptions that are explicitly included in a different query.
	reposList := repos.UnsortedList()
	for _, excepts := range orgs {
		excepts.Delete(reposList...)
	}
	return orgs, repos
}
func (tqs TideQueries) OrgExceptionsAndRepos() (map[string]sets.String, sets.String) {
	orgs := make(map[string]sets.String)
	for i := range tqs {
		for _, org := range tqs[i].Orgs {
			applicableRepos := sets.NewString(reposInOrg(org, tqs[i].ExcludedRepos)...)
			if excepts, ok := orgs[org]; !ok {
				// We have not seen this org so the exceptions are just applicable
				// members of 'excludedRepos'.
				orgs[org] = applicableRepos
			} else {
				// We have seen this org so the exceptions are the applicable
				// members of 'excludedRepos' intersected with existing exceptions.
				orgs[org] = excepts.Intersection(applicableRepos)
			}
		}
	}
	repos := sets.NewString()
	for i := range tqs {
		repos.Insert(tqs[i].Repos...)
	}
	// Remove any org exceptions that are explicitly included in a different query.
	reposList := repos.UnsortedList()
	for _, excepts := range orgs {
		excepts.Delete(reposList...)
	}
	return orgs, repos
}
func ( tqs TideQueries ) OrgExceptionsAndRepos ( ) ( map [ string ] sets . String , sets . String ) { orgs := make ( map [ string ] sets . String ) for i := range tqs { for _ , org := range tqs [ i ] . Orgs { applicableRepos := sets . NewString ( reposInOrg ( org , tqs [ i ] . ExcludedRepos ) ... ) if excepts , ok := orgs [ org ] ; ! ok { // We have not seen this org so the exceptions are just applicable // members of 'excludedRepos'. orgs [ org ] = applicableRepos } else { // We have seen this org so the exceptions are the applicable // members of 'excludedRepos' intersected with existing exceptions. orgs [ org ] = excepts . Intersection ( applicableRepos ) } } } repos := sets . NewString ( ) for i := range tqs { repos . Insert ( tqs [ i ] . Repos ... ) } // Remove any org exceptions that are explicitly included in a different query. reposList := repos . UnsortedList ( ) for _ , excepts := range orgs { excepts . Delete ( reposList ... ) } return orgs , repos }
// OrgExceptionsAndRepos determines which orgs and repos a set of queries cover.
// Output is returned as a mapping from 'included org'->'repos excluded in the org'
// and a set of included repos.
OrgExceptionsAndRepos determines which orgs and repos a set of queries cover . Output is returned as a mapping from included org - > repos excluded in the org and a set of included repos .