summaryrefslogtreecommitdiff
path: root/round-robin-bisect.sh
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2021-07-20 17:56:41 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2021-07-21 14:14:02 +0000
commit3922f589ab98b50295674d01287ed7fc693bbb47 (patch)
tree9e38e71ae0ec10eee1acd3441f42ff24b66f6bfe /round-robin-bisect.sh
parent8b5d081995cc6e048c5794ccd0ba2bf3c42d2e1b (diff)
round-robin scripts: Merge <foo>_url and <foo>_branch into <foo>_git
Merge git "_url" and "_branch" specification into a single "_git" argument that's constructed from "URL#BRANCH". This argument also has a special value "baseline", which before was a special value of "branch". This rework makes handling of git references simpler and cleaner, especially on the jenkins side. Change-Id: I1c1c07629728c693b8350dfa1b61fe767d5b0a0b
Diffstat (limited to 'round-robin-bisect.sh')
-rwxr-xr-xround-robin-bisect.sh51
1 files changed, 25 insertions, 26 deletions
diff --git a/round-robin-bisect.sh b/round-robin-bisect.sh
index 2328da64..8ded4ea6 100755
--- a/round-robin-bisect.sh
+++ b/round-robin-bisect.sh
@@ -17,8 +17,8 @@ fresh_dir $artifacts "$artifacts/manifests/*" "$artifacts/jenkins/*"
convert_args_to_variables "$@"
shift "$SHIFT_CONVERTED_ARGS"
-obligatory_variables bad_url bad_branch build_script current_project
-declare bad_url bad_branch build_script current_project
+obligatory_variables bad_git build_script current_project
+declare bad_git build_script current_project
BUILD_URL="${BUILD_URL:-$(pwd)}"
replay_log="${replay_log-}"
@@ -42,6 +42,9 @@ touch $artifacts/jenkins/build-name
trap print_traceback EXIT
+bad_url="${bad_git%#*}"
+bad_branch="${bad_git#*#}"
+
rebase_workaround=false
rebase_workaround_opts=()
@@ -51,7 +54,7 @@ case "${rr[ci_project]}/${rr[ci_config]}:$current_project" in
# Search for regressions against linux-mainline:master (aka linux-next:stable).
clone_or_update_repo $current_project stable $bad_url
# Just in case linux-next:stable has advanced between the build and bisect jobs,
- # use merge base between linux-next:stable and $bad_branch.
+ # use merge base between linux-next:stable and $bad_git.
bad_rev="${bad_rev-$(git_rev_parse_long $current_project $bad_branch)}"
linux_next_stable="${linux_next_stable-$(git -C $current_project merge-base HEAD $bad_rev)}"
cat <<EOF | manifest_out
@@ -59,8 +62,8 @@ declare -g linux_next_stable=$linux_next_stable
EOF
echo "Rebase workaround: forcing linux baseline to $linux_next_stable"
rebase_workaround=true
- rebase_workaround_opts+=("==rr[linux_url]" "$bad_url")
- rebase_workaround_opts+=("==rr[linux_branch]" "$linux_next_stable")
+ rebase_workaround_opts+=("==rr[linux_git]"
+ "$bad_url#$linux_next_stable")
;;
esac
@@ -192,8 +195,7 @@ $build_script \
%% $rel_artifacts/manifests/build-\$rev.sh \
@@ $rel_artifacts/manifests/build-parameters.sh \
==rr[mode] bisect \
- ==rr[${current_project}_url] "$bad_url" \
- ==rr[${current_project}_branch] \$rev \
+ ==rr[${current_project}_git] "$bad_url#\$rev" \
==rr[top_artifacts] $rel_artifacts/build-\$rev \
--verbose "$verbose" &
res=0 && wait \$! || res=\$?
@@ -243,20 +245,19 @@ if [ x"$res" = x"0" ]; then
case $project_name in
tcwg_kernel/llvm-*-next-*:linux)
cat > $artifacts/trigger-build-rebase <<EOF
-llvm_branch=baseline
+llvm_git=baseline
EOF
;;
tcwg_kernel/gnu-*-next-*:linux)
cat > $artifacts/trigger-build-rebase <<EOF
-binutils_branch=baseline
-gcc_branch=baseline
+binutils_git=baseline
+gcc_git=baseline
EOF
;;
*) assert_with_msg "Unknown project name: $project_name" false ;;
esac
cat >> $artifacts/trigger-build-rebase <<EOF
-linux_url=$bad_url
-linux_branch=$baseline_rev
+linux_git=$bad_url#$baseline_rev
update_baseline=reset
EOF
else
@@ -268,18 +269,18 @@ EOF
case "${rr[ci_project]}/${rr[ci_config]}" in
tcwg_bmk*/gnu*-O[23]*)
cat > $artifacts/trigger-build-reset <<EOF
-binutils_branch=baseline
-gcc_branch=baseline
-glibc_branch=baseline
+binutils_git=baseline
+gcc_git=baseline
+glibc_git=baseline
update_baseline=reset
EOF
;;
tcwg_bmk*/llvm-*-O[23]*)
cat > $artifacts/trigger-build-reset <<EOF
-binutils_branch=baseline
-gcc_branch=baseline
-glibc_branch=baseline
-llvm_branch=baseline
+binutils_git=baseline
+gcc_git=baseline
+glibc_git=baseline
+llvm_git=baseline
update_baseline=reset
EOF
;;
@@ -517,8 +518,7 @@ if [ x"$first_bad" != x"" ]; then
# a reduced bisection range.
cat > $artifacts/trigger-bisect <<EOF
current_project=$current_project
-bad_url=$bad_url
-bad_branch=$bad_last_good
+bad_git=$bad_url#$bad_last_good
EOF
sed -i -e "s/\$/-retry-bisect/" $artifacts/jenkins/build-name
# Don't send any emails.
@@ -559,8 +559,7 @@ else
if [ x"$last_good" != x"$baseline_rev" ]; then
# $reset_rev=="" due to $first_bad==""
cat > $artifacts/trigger-build-1-advance <<EOF
-${current_project}_url=$bad_url
-${current_project}_branch=$last_good
+${current_project}_git=$bad_url#$last_good
EOF
sed -i -e "s/\$/-advance-baseline/" $artifacts/jenkins/build-name
else
@@ -582,7 +581,7 @@ if ! [ -f $artifacts/build-$bad_rev/trigger-build-$current_project ]; then
assert_with_msg "No bad build during this bisect" [ x"$bad_build" != x"" ]
mkdir -p $artifacts/build-$bad_rev
cp $bad_build $artifacts/build-$bad_rev/trigger-build-$current_project
- sed -i -e "s/^${current_project}_branch=.*\$/${current_project}_branch=$bad_rev/" \
+ sed -i -e "s/^\(${current_project}_git=.*\)#.*\$/\1#$bad_rev/" \
$artifacts/build-$bad_rev/trigger-build-$current_project
fi
@@ -593,7 +592,7 @@ if [ x"$reset_rev" != x"" ]; then \
mkdir -p $artifacts/build-$reset_rev
cp $artifacts/build-$bad_rev/trigger-build-$current_project \
$artifacts/build-$reset_rev/trigger-build-$current_project
- sed -i -e "s/^${current_project}_branch=$bad_rev\$/${current_project}_branch=$reset_rev/" \
+ sed -i -e "s/^\(${current_project}_git=.*\)#$bad_rev\$/\1#$reset_rev/" \
$artifacts/build-$reset_rev/trigger-build-$current_project
fi
@@ -742,7 +741,7 @@ cat >> $artifacts/jenkins/mail-body.txt <<EOF
Build top page/logs: ${BUILD_URL}
Configuration details:
-$(cat $artifacts/manifests/build-baseline.sh | grep '_url]\|_branch]' | grep -v '="no_')
+$(cat $artifacts/manifests/build-baseline.sh | grep '_git]' | grep -v '="no_')
Reproduce builds:
<cut>