summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2019-02-12 09:32:55 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2019-02-18 15:31:42 +0000
commitddddcf637bc3f1dcff1ca774f19b4fd35bdfd3a9 (patch)
treeeae0225740ce30cc3595b138a6508d4a04512743
parentb535f3acc6b1902ae3c79a9ffea40648edd404cc (diff)
[rr-many 3/N] Rework trigger files for follow-up builds.
Now that we reliably reach check_regression (due to previous improvements in run_step support) move creation of trigger files here from clone_repo. If updating multiple components -- create trigger files for individual builds. I.e., trigger-build-llvm: llvm_branch=SHA1_LLVM linux_branch=baseline trigger-build-linux: llvm_branch=baseline linux_branch=SHA1_LINUX If updating a single component -- create trigger-bisect like before. In the tcwg_kernel-bisect.sh script we start using trigger files produced by the build script, thus simplifying and generalizing bisect script. Change-Id: Iaee02ce0f8fbb3f9f5dbee805089ff31f1859cb5
-rw-r--r--round-robin.sh40
-rwxr-xr-xtcwg_kernel-bisect.sh19
2 files changed, 32 insertions, 27 deletions
diff --git a/round-robin.sh b/round-robin.sh
index bd3d886f..57da594b 100644
--- a/round-robin.sh
+++ b/round-robin.sh
@@ -157,20 +157,6 @@ clone_repo ()
cat <<EOF | manifest_out
rr[${project}_rev]=$cur_rev
EOF
-
- if [ x"$project" = x"${rr[current_project]}" ] \
- && ! ${rr[init_configuration]-false}; then
- local baseline_rev
- baseline_rev=$(git_rev_parse_long $project ${rr[baseline_branch]} baseline)
- # Prepare for failure. If build fails we will bisect sha1 for
- # ${rr[current_branch]} and sha1 for ${rr[baseline_branch]}.
- cat > ${rr[top_artifacts]}/trigger-bisect-on-failure <<EOF
-current_project=${rr[current_project]}
-baseline_rev=$baseline_rev
-bad_rev=$cur_rev
-EOF
- git -C $project rev-list --count HEAD ^$baseline_rev > ${rr[top_artifacts]}/distance-to-baseline
- fi
)
}
@@ -341,6 +327,32 @@ check_regression ()
set -euf -o pipefail
if ! ${rr[reset_baseline]} && ! no_regression_p; then
+ local single_component=$(print_single_updated_component)
+
+ if [ x"$single_component" = x"" -o x"${rr[mode]}" = x"bisect" ]; then
+ local c
+ for c in $(print_updated_components); do
+ local c2
+ for c2 in ${rr[components]}; do
+ if [ x"$c" = x"$c2" ]; then
+ echo "${c2}_branch=${rr[${c}_branch]}"
+ else
+ echo "${c2}_branch=baseline"
+ fi
+ done >> ${rr[top_artifacts]}/trigger-build-$c
+ done
+ else
+ local baseline_rev cur_rev
+ baseline_rev=$(git_rev_parse_long $single_component ${rr[baseline_branch]} baseline)
+ cur_rev=$(git -C $single_component rev-parse HEAD)
+
+ cat > ${rr[top_artifacts]}/trigger-bisect <<EOF
+current_project=$single_component
+baseline_rev=$baseline_rev
+bad_rev=$cur_rev
+EOF
+ fi
+
# Fail.
false
fi
diff --git a/tcwg_kernel-bisect.sh b/tcwg_kernel-bisect.sh
index ef1cb2f5..dee14845 100755
--- a/tcwg_kernel-bisect.sh
+++ b/tcwg_kernel-bisect.sh
@@ -119,6 +119,7 @@ $build_script \
%% $rel_artifacts/manifests/build-\$rev.sh \
@@ $rel_artifacts/manifests/build-parameters.sh \
==rr[mode] bisect \
+ ==rr[${current_project}_branch] \$rev \
==rr[top_artifacts] $rel_artifacts/build-\$rev \
--verbose "$verbose" &
res=0 && wait \$! || res=\$?
@@ -145,10 +146,7 @@ if [ x"$res" = x"0" ]; then
else
echo "WARNING: build for bad_rev $bad_rev succeeded"
# Build job had a spurious failure. Re-try.
- cat > $artifacts/trigger-2-build-master <<EOF
-current_project=$current_project
-current_branch=$bad_rev
-EOF
+ cp $artifacts/build-$bad_rev/trigger-build-$current_project $artifacts/trigger-build-spurious
sed -i -e "s/\$/-spurious/" $artifacts/jenkins/build-name
fi
echo > $artifacts/jenkins/mail-recipients.txt
@@ -199,7 +197,7 @@ if [ x"$res" = x"0" ]; then
# We need to be careful to avoid re-trigger loops, so verify that
# last_good is an ancestor of bad_rev.
assert git merge-base --is-ancestor $last_good $bad_rev
- cat > $artifacts/trigger-0-bisect-again <<EOF
+ cat > $artifacts/trigger-bisect <<EOF
current_project=$current_project
baseline_rev=$baseline_rev
bad_rev=$last_good
@@ -348,15 +346,10 @@ EOF
# Reset baseline to the regressed commit so that we will catch subsequent
# regressions (worse than $bad_rev).
-cat > $artifacts/trigger-1-reset-baseline <<EOF
-current_project=$current_project
-current_branch=$first_bad
-reset_baseline=true
-EOF
+cp $artifacts/build-$first_bad/trigger-build-$current_project $artifacts/trigger-build-1-reset
+echo "reset_baseline=true" >> $artifacts/trigger-build-1-reset
# Trigger master build now instead of waiting for next timed SCM trigger.
-cat > $artifacts/trigger-2-build-master <<EOF
-current_project=$current_project
-EOF
+cp $artifacts/build-$bad_rev/trigger-build-$current_project $artifacts/trigger-build-2-default
trap "" EXIT