MCPcopy
hub / github.com/kubernetes/test-infra / TestsSIGs

Method TestsSIGs

robots/issue-creator/creator/creator.go:403–423  ·  view source on GitHub ↗

TestsSIGs uses the IssueCreator's OwnerMapper to look up the SIGs for a list of tests. The number of SIGs returned is limited by MaxSIGCount. The return value is a map from sigs to the tests from testNames that each sig owns.

(testNames []string)

Source from the content-addressed store, hash-verified

401// The number of SIGs returned is limited by MaxSIGCount.
402// The return value is a map from sigs to the tests from testNames that each sig owns.
403func (c *IssueCreator) TestsSIGs(testNames []string) map[string][]string {
404 if c.Owners == nil {
405 return nil
406 }
407 sigs := make(map[string][]string)
408 for _, test := range testNames {
409 sig := c.Owners.TestSIG(test)
410 if sig == "" {
411 continue
412 }
413
414 if len(sigs) >= c.MaxSIGCount {
415 if tests, ok := sigs[sig]; ok {
416 sigs[sig] = append(tests, test)
417 }
418 } else {
419 sigs[sig] = append(sigs[sig], test)
420 }
421 }
422 return sigs
423}
424
425// TestsOwners uses the IssueCreator's OwnerMapper to look up the users assigned to a list of tests.
426// The number of users returned is limited by MaxAssignees.

Callers 4

TestOwnersSIGsFunction · 0.95
LabelsMethod · 0.80
LabelsMethod · 0.80

Calls 2

makeFunction · 0.85
TestSIGMethod · 0.65

Tested by 1

TestOwnersSIGsFunction · 0.76