@@ -403,7 +403,7 @@ func MakeCovMap(keys, vals []int64) map[int]int64 {
403
403
type SelectScope struct {
404
404
Ns string
405
405
Subsystem string
406
- Manager string
406
+ Managers [] string
407
407
Periods []TimePeriod
408
408
}
409
409
@@ -412,7 +412,7 @@ type SelectScope struct {
412
412
func FilesCoverageStream (ctx context.Context , client spannerclient.SpannerClient , ns string , timePeriod TimePeriod ,
413
413
) (<- chan * FileCoverageWithLineInfo , <- chan error ) {
414
414
iter := client .Single ().Query (ctx ,
415
- filesCoverageWithDetailsStmt (ns , "" , "" , timePeriod , true ))
415
+ filesCoverageWithDetailsStmt (ns , "" , nil , timePeriod , true ))
416
416
resCh := make (chan * FileCoverageWithLineInfo )
417
417
errCh := make (chan error )
418
418
go func () {
@@ -435,14 +435,14 @@ func FilesCoverageWithDetails(
435
435
for _ , timePeriod := range scope .Periods {
436
436
needLinesDetails := onlyUnique
437
437
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 ))
439
439
defer iterManager .Stop ()
440
440
441
441
var err error
442
442
var periodRes []* FileCoverageWithDetails
443
443
if onlyUnique {
444
444
iterAll := client .Single ().Query (ctx ,
445
- filesCoverageWithDetailsStmt (scope .Ns , scope .Subsystem , "" , timePeriod , needLinesDetails ))
445
+ filesCoverageWithDetailsStmt (scope .Ns , scope .Subsystem , nil , timePeriod , needLinesDetails ))
446
446
defer iterAll .Stop ()
447
447
periodRes , err = readCoverageUniq (iterAll , iterManager )
448
448
if err != nil {
@@ -462,10 +462,10 @@ func FilesCoverageWithDetails(
462
462
return res , nil
463
463
}
464
464
465
- func filesCoverageWithDetailsStmt (ns , subsystem , manager string , timePeriod TimePeriod , withLines bool ,
465
+ func filesCoverageWithDetailsStmt (ns , subsystem string , managers [] string , timePeriod TimePeriod , withLines bool ,
466
466
) spanner.Statement {
467
- if manager == "" {
468
- manager = "*"
467
+ if len ( managers ) == 0 {
468
+ managers = append ( managers , "*" )
469
469
}
470
470
selectColumns := "commit, instrumented, covered, files.filepath, subsystems"
471
471
if withLines {
@@ -479,12 +479,12 @@ from merge_history
479
479
join file_subsystems
480
480
on merge_history.namespace = file_subsystems.namespace and files.filepath = file_subsystems.filepath
481
481
where
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) ` ,
483
483
Params : map [string ]interface {}{
484
484
"p1" : ns ,
485
485
"p2" : timePeriod .DateTo ,
486
486
"p3" : timePeriod .Days ,
487
- "p4" : manager ,
487
+ "p4" : managers ,
488
488
},
489
489
}
490
490
if subsystem != "" {
0 commit comments