@@ -403,7 +403,7 @@ func MakeCovMap(keys, vals []int64) map[int]int64 {
403403type SelectScope struct {
404404 Ns string
405405 Subsystem string
406- Manager string
406+ Managers [] string
407407 Periods []TimePeriod
408408}
409409
@@ -412,7 +412,7 @@ type SelectScope struct {
412412func FilesCoverageStream (ctx context.Context , client spannerclient.SpannerClient , ns string , timePeriod TimePeriod ,
413413) (<- chan * FileCoverageWithLineInfo , <- chan error ) {
414414 iter := client .Single ().Query (ctx ,
415- filesCoverageWithDetailsStmt (ns , "" , "" , timePeriod , true ))
415+ filesCoverageWithDetailsStmt (ns , "" , nil , timePeriod , true ))
416416 resCh := make (chan * FileCoverageWithLineInfo )
417417 errCh := make (chan error )
418418 go func () {
@@ -435,14 +435,14 @@ func FilesCoverageWithDetails(
435435 for _ , timePeriod := range scope .Periods {
436436 needLinesDetails := onlyUnique
437437 iterManager := client .Single ().Query (ctx ,
438- filesCoverageWithDetailsStmt (scope .Ns , scope .Subsystem , scope .Manager , timePeriod , needLinesDetails ))
438+ filesCoverageWithDetailsStmt (scope .Ns , scope .Subsystem , scope .Managers , timePeriod , needLinesDetails ))
439439 defer iterManager .Stop ()
440440
441441 var err error
442442 var periodRes []* FileCoverageWithDetails
443443 if onlyUnique {
444444 iterAll := client .Single ().Query (ctx ,
445- filesCoverageWithDetailsStmt (scope .Ns , scope .Subsystem , "" , timePeriod , needLinesDetails ))
445+ filesCoverageWithDetailsStmt (scope .Ns , scope .Subsystem , nil , timePeriod , needLinesDetails ))
446446 defer iterAll .Stop ()
447447 periodRes , err = readCoverageUniq (iterAll , iterManager )
448448 if err != nil {
@@ -462,10 +462,10 @@ func FilesCoverageWithDetails(
462462 return res , nil
463463}
464464
465- func filesCoverageWithDetailsStmt (ns , subsystem , manager string , timePeriod TimePeriod , withLines bool ,
465+ func filesCoverageWithDetailsStmt (ns , subsystem string , managers [] string , timePeriod TimePeriod , withLines bool ,
466466) spanner.Statement {
467- if manager == "" {
468- manager = "*"
467+ if len ( managers ) == 0 {
468+ managers = append ( managers , "*" )
469469 }
470470 selectColumns := "commit, instrumented, covered, files.filepath, subsystems"
471471 if withLines {
@@ -479,12 +479,12 @@ from merge_history
479479 join file_subsystems
480480 on merge_history.namespace = file_subsystems.namespace and files.filepath = file_subsystems.filepath
481481where
482- merge_history.namespace=$1 and dateto=$2 and duration=$3 and manager=$4 ` ,
482+ merge_history.namespace=$1 and dateto=$2 and duration=$3 and manager=ANY(SELECT id FROM UNNEST($4) AS id) ` ,
483483 Params : map [string ]interface {}{
484484 "p1" : ns ,
485485 "p2" : timePeriod .DateTo ,
486486 "p3" : timePeriod .Days ,
487- "p4" : manager ,
487+ "p4" : managers ,
488488 },
489489 }
490490 if subsystem != "" {
0 commit comments