From 050ddab77da4a1c12b49acb360597b704e2eaeab Mon Sep 17 00:00:00 2001 From: Maxim Kuvyrkov Date: Tue, 20 Jul 2021 08:46:49 +0000 Subject: 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 --- round-robin.sh | 57 +++++++++++++++++++-------------------------------------- 1 file changed, 19 insertions(+), 38 deletions(-) (limited to 'round-robin.sh') 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 ) -- cgit v1.2.3