summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2021-07-20 08:46:49 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2021-07-20 09:49:51 +0000
commit050ddab77da4a1c12b49acb360597b704e2eaeab (patch)
tree2a9a5656b01fdc0f5c98a3d0dd522bc9fd911609
parent1ac1a651a54906e23df9fbc7527493050db41998 (diff)
round-robin-bisect.sh: Simplify handling of baseline repos/remotes
Create baseline remote only when we are about to push to them. Use baseline repos as normal repos for the rest of the build process. Change-Id: I17e6c57c051ae1b94921ccbb9ee1874fe0c41409
-rw-r--r--jenkins-helpers.sh12
-rw-r--r--round-robin.sh57
2 files changed, 24 insertions, 45 deletions
diff --git a/jenkins-helpers.sh b/jenkins-helpers.sh
index 066aacb9..1915f66c 100644
--- a/jenkins-helpers.sh
+++ b/jenkins-helpers.sh
@@ -545,17 +545,15 @@ clone_or_update_repo ()
)
}
-# Clone or update a baseline git repo
-# $1 -- repo directory
-# $2 -- branch to checkout
-# $3 -- Whether to make the new remote read-only or read-write.
-clone_baseline_repo ()
+# Print baseline git repo
+# $1 -- project name
+# $3 -- whether to make the new remote read-only or read-write.
+print_baseline_repo ()
{
(
set -euf -o pipefail
local dir="$1"
- local branch="$2"
local read_only="$3"
local repo
@@ -575,7 +573,7 @@ clone_baseline_repo ()
url="ssh://$url"
fi
- clone_or_update_repo "$dir" "$branch" "$url" auto "$branch" baseline
+ echo "$url"
)
}
diff --git a/round-robin.sh b/round-robin.sh
index 2b5b029d..9d330d6f 100644
--- a/round-robin.sh
+++ b/round-robin.sh
@@ -154,38 +154,25 @@ clone_repo ()
return 0
fi
- local branch
- # Resolve "baseline" branch specifier.
- if [ x"${rr[${project}_branch]}" = x"baseline" ]; then
- branch="refs/remotes/baseline/${rr[baseline_branch]}"
- else
- branch="${rr[${project}_branch]}"
- fi
-
- # Decide on whether to use read-only or read-write mode for
- # refs/remotes/baseline. We use read-only wherever possible to allow
- # developers without ssh keys on Linaro git servers to reproduce builds
- # in --mode "baseline".
- local read_only="true"
- if [ x"${rr[${project}_branch]}" != x"baseline" ] && \
- [ x"${rr[mode]}" = x"jenkins-full" ]; then
- read_only=false
- fi
-
- local baseline_branch=${rr[baseline_branch]}
+ local url branch
if [ x"${rr[${project}_branch]}" != x"baseline" ]; then
- # Fetch and checkout from the non-baseline repo.
- clone_or_update_repo $project $branch ${rr[${project}_url]}
+ # Fetch and checkout from the specified repo.
+ url="${rr[${project}_url]}"
+ branch="${rr[${project}_branch]}"
else
- # Clone baseline remote
- clone_baseline_repo $project $baseline_branch $read_only
- fi > /dev/null
+ # Fetch and checkout from baseline repo.
+ url=$(print_baseline_repo "$project" true)
+ branch="${rr[baseline_branch]}"
+ fi
+
+ clone_or_update_repo_no_checkout "$project" "$url" auto "$branch" origin \
+ > /dev/null
# Allow manifest override
- if [ x"${rr[${project}_rev]-}" != x"" ]; then
- git -C $project checkout --detach "${rr[${project}_rev]}"
- fi
+ branch="${rr[${project}_rev]-$branch}"
+
+ git -C $project checkout --detach "$branch"
local cur_rev
cur_rev=$(git -C $project rev-parse HEAD)
@@ -800,19 +787,13 @@ push_baseline ()
fi
fi
+ local url
local c
for c in $(print_updated_components); do
- if ! git -C $c remote show -n baseline >/dev/null 2>&1; then
- # It appears we failed before component $c had a chance to build.
- # Initialize baseline repo so that we can push to it.
- # Note that this can, potentially, skip regressions in components
- # down in build pipeline (glibc, qemu) when earlier components
- # fail to build (binutils, gcc). This is not a big problem
- # because these regressions will be skipped in CI configs where we
- # only "build" components, but will be caught in CI configs where
- # we run testsuites, benchmarks, etc.
- clone_baseline_repo $c empty false
- fi
+ # Clone (but don't checkout) always-present "empty" branch of
+ # the baseline repo. This initializes read/write "baseline" remote.
+ url=$(print_baseline_repo "$c" false)
+ git_set_remote "$c" baseline "$url"
git_push $c baseline ${rr[baseline_branch]}
done
)