From db150e23dfae69f02b0712803ebb12dce0283903 Mon Sep 17 00:00:00 2001 From: Taras Madan Date: Fri, 30 Aug 2024 10:41:32 +0200 Subject: 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. --- dashboard/app/coverage_batch.go | 11 ++++++----- tools/syz-bq.sh | 8 +++++++- 2 files changed, 13 insertions(+), 6 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 + diff --git a/tools/syz-bq.sh b/tools/syz-bq.sh index 45b5608f7..8a233a9cc 100755 --- a/tools/syz-bq.sh +++ b/tools/syz-bq.sh @@ -5,7 +5,7 @@ set -e # exit on any problem set -o pipefail -while getopts w:d:t:n:r:c: option +while getopts w:d:t:n:r:b:c: option do case "${option}" in @@ -14,6 +14,7 @@ do t)to_date=${OPTARG};; n)namespace=${OPTARG};; r)repo=${OPTARG};; + b)branch=${OPTARG};; c)client_name=${OPTARG};; esac done @@ -43,6 +44,11 @@ then echo "-r is required to specify the merging repo base" exit fi +if [ -z "$branch" ] +then + echo "-b is required to specify the merging branch base" + exit +fi echo "Workdir: $workdir" base_dir="${workdir}repos/linux_kernels" -- cgit mrf-deployment