aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard/app/coverage_batch.go
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2024-08-30 10:41:32 +0200
committerTaras Madan <tarasmadan@google.com>2024-08-30 09:01:40 +0000
commitdb150e23dfae69f02b0712803ebb12dce0283903 (patch)
tree722029a4a2871dfd5dcbc004bb1e8f9787b855f2 /dashboard/app/coverage_batch.go
parentf4865e39dd0bcae7e5f3f5d59807d6ac9a8a99ba (diff)
dashboard/app: branch info is needed to get target commit
This code was deleted accidentally. Branch information is needed here to get the last target day commit.
Diffstat (limited to 'dashboard/app/coverage_batch.go')
-rw-r--r--dashboard/app/coverage_batch.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/dashboard/app/coverage_batch.go b/dashboard/app/coverage_batch.go
index c5cb73999..04c7d545c 100644
--- a/dashboard/app/coverage_batch.go
+++ b/dashboard/app/coverage_batch.go
@@ -37,9 +37,9 @@ func handleBatchCoverage(w http.ResponseWriter, r *http.Request) {
if nsConfig.Coverage == nil {
continue
}
- repo, _ := nsConfig.mainRepoBranch()
- if repo == "" {
- log.Errorf(ctx, "can't find default repo for ns %s", ns)
+ repo, branch := nsConfig.mainRepoBranch()
+ if repo == "" || branch == "" {
+ log.Errorf(ctx, "can't find default repo or branch for ns %s", ns)
continue
}
periods, err := nsDatesToMerge(ctx, ns, daysToMerge, runsPerBatch)
@@ -70,7 +70,7 @@ func handleBatchCoverage(w http.ResponseWriter, r *http.Request) {
ctx,
nsCovConfig.BatchProject,
nsCovConfig.BatchServiceAccount,
- batchScript(ns, repo, periods,
+ batchScript(ns, repo, branch, periods,
nsCovConfig.JobInitScript,
nsCovConfig.SyzEnvInitScript,
nsCovConfig.DashboardClientName),
@@ -80,7 +80,7 @@ func handleBatchCoverage(w http.ResponseWriter, r *http.Request) {
}
}
-func batchScript(ns, repo string, periods []coveragedb.TimePeriod,
+func batchScript(ns, repo, branch string, periods []coveragedb.TimePeriod,
jobInitScript, syzEnvInitScript, clientName string) string {
if clientName == "" {
clientName = defaultDashboardClientName
@@ -98,6 +98,7 @@ func batchScript(ns, repo string, periods []coveragedb.TimePeriod,
" -w ../workdir-cover-aggregation/" +
" -n " + ns +
" -r " + repo +
+ " -b " + branch +
" -d " + strconv.Itoa(period.Days) +
" -t " + period.DateTo.String() +
" -c " + clientName +