diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2018-12-24 16:33:51 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2019-01-11 11:24:54 +0000 |
commit | fa931307acd1923861afd3f1de77fb386cd00dc4 (patch) | |
tree | 09cc618f656f7f2863279141a934a315de9aaedd | |
parent | f238c3d9927c7797371f246980cd5ca9ad48cbca (diff) |
tcwg_kernel-bisect.sh: Send emails with useful info when bisect fails
We are trying to reduce the number of failed bisect and make
scripting more robust against history re-writes (which is the
primary cause of failed bisects). Re-work logic to generate
email body to include useful info about failed bisects.
Change-Id: Ia25f3311016c0175f3b59e1e4c7308485b5276a4
-rwxr-xr-x | tcwg_kernel-bisect.sh | 90 |
1 files changed, 57 insertions, 33 deletions
diff --git a/tcwg_kernel-bisect.sh b/tcwg_kernel-bisect.sh index 22566aab..71d80753 100755 --- a/tcwg_kernel-bisect.sh +++ b/tcwg_kernel-bisect.sh @@ -201,8 +201,25 @@ current_rev=$first_bad reset_baseline=true EOF -if [ -f artifacts/first-bad ]; then - first_bad=$(cat artifacts/first-bad) +# Trigger master build now instead of waiting for next timed SCM trigger. +cat > $artifacts/trigger-2-build-master <<EOF +current_project=$current_project +EOF + +# Email developers. +CI_MAIL_RECIPIENTS="tcwg-validation@linaro.org" +case "$toolchain:$current_project" in + gnu:*) CI_MAIL_RECIPIENTS="$CI_MAIL_RECIPIENTS, christophe.lyon@linaro.org, maxim.kuvyrkov@linaro.org" ;; + llvm:linux) CI_MAIL_RECIPIENTS="$CI_MAIL_RECIPIENTS, arnd@linaro.org, mark.brown@linaro.org, ndesaulniers@google.com, trong@google.com" ;; + llvm:llvm) CI_MAIL_RECIPIENTS="$CI_MAIL_RECIPIENTS, adhemerval.zanella@linaro.org, maxim.kuvyrkov@linaro.org, ndesaulniers@google.com, trong@google.com, yvan.roux@linaro.org" ;; +esac + +cat > $artifacts/ci_mail_parameters.sh <<EOF +CI_MAIL_RECIPIENTS="$CI_MAIL_RECIPIENTS" +EOF +chmod +x $artifacts/ci_mail_parameters.sh + +if [ -f $artifacts/first-bad ]; then touch build-name sed -i -e "s/\$/-$first_bad/" build-name @@ -221,16 +238,11 @@ if [ -f artifacts/first-bad ]; then ln -s "build-$last_good-last_good" "$artifacts/build-$last_good-baseline" fi - # Email developers on successful bisects. - CI_MAIL_RECIPIENTS="tcwg-validation@linaro.org" - case "$toolchain:$current_project" in - gnu:*) CI_MAIL_RECIPIENTS="$CI_MAIL_RECIPIENTS, christophe.lyon@linaro.org, maxim.kuvyrkov@linaro.org" ;; - llvm:linux) CI_MAIL_RECIPIENTS="$CI_MAIL_RECIPIENTS, arnd@linaro.org, mark.brown@linaro.org, ndesaulniers@google.com, trong@google.com" ;; - llvm:llvm) CI_MAIL_RECIPIENTS="$CI_MAIL_RECIPIENTS, adhemerval.zanella@linaro.org, maxim.kuvyrkov@linaro.org, ndesaulniers@google.com, trong@google.com, yvan.roux@linaro.org" ;; - esac - - cat > artifacts/ci_mail_parameters.sh <<EOF -CI_MAIL_RECIPIENTS="$CI_MAIL_RECIPIENTS" + good_name="last_good" + good_sha1="$last_good" + bad_name="first_bad" + bad_sha1="$first_bad" + cat >> $artifacts/ci_mail_parameters.sh <<EOF CI_MAIL_BODY="Successfully identified regression in $current_project on $target @ $toolchain-${rr[${toolchain}_version]} @ linux-${rr[linux_version]}-$linux_config between bad $bad_rev and baseline $baseline_rev . Culprit: @@ -238,34 +250,48 @@ Culprit: $(git -C $current_project log -n 1 $first_bad | tr '"' "'") </cut> -Results regressed from (for $last_good) +EOF +else + good_name="baseline" + good_sha1="$baseline_rev" + bad_name="bad" + bad_sha1="$bad_rev" + cat >> $artifacts/ci_mail_parameters.sh <<EOF +CI_MAIL_BODY="Could not identify regression in $current_project on $target @ $toolchain-${rr[${toolchain}_version]} @ linux-${rr[linux_version]}-$linux_config between bad $bad_rev and baseline $baseline_rev down to a single commit. See 'Bisect log' in the links below for bisection details. + +EOF +fi + +cat >> $artifacts/ci_mail_parameters.sh <<EOF +Results regressed from (for $good_name == $good_sha1) <cut> -$(cat artifacts/build-$last_good-last_good/results) +$(cat $artifacts/build-$good_sha1-$good_name/results) </cut> -to (for $first_bad) +to (for $bad_name == $bad_sha1) <cut> -$(cat artifacts/build-$first_bad-first_bad/results) +$(cat $artifacts/build-$bad_sha1-$bad_name/results) </cut> -Artifacts of first_bad build: ${BUILD_URL}artifact/artifacts/build-$first_bad-first_bad/ -Artifacts of last_good build: ${BUILD_URL}artifact/artifacts/build-$last_good-last_good/ +Artifacts of $good_name build: ${BUILD_URL}artifact/artifacts/build-$good_sha1-$good_name/ +Artifacts of $bad_name build: ${BUILD_URL}artifact/artifacts/build-$bad_sha1-$bad_name/ Reproduce builds: <cut> -mkdir investigate-$current_project-$first_bad -cd investigate-$current_project-$first_bad +mkdir investigate-$current_project-$bad_sha1 +cd investigate-$current_project-$bad_sha1 git clone https://git.linaro.org/toolchain/jenkins-scripts -wget ${BUILD_URL}artifact/artifacts/build-manifest.sh -mkdir reproduce-good -cd reproduce-good -../jenkins-scripts/tcwg_kernel-build.sh @@ ../build-manifest.sh ==rr[${current_project}_rev] $last_good +mkdir reproduce-$good_name +cd reproduce-$good_name +wget ${BUILD_URL}artifact/artifacts/build-$good_sha1-$good_name/jenkins/manifest.sh +../jenkins-scripts/tcwg_kernel-build.sh @@ manifest.sh cd .. -mkdir reproduce-bad -cd reproduce-bad -../jenkins-scripts/tcwg_kernel-build.sh @@ ../build-manifest.sh ==rr[${current_project}_rev] $first_bad +mkdir reproduce-$bad_name +cd reproduce-$bad_name +wget ${BUILD_URL}artifact/artifacts/build-$bad_sha1-$bad_name/jenkins/manifest.sh +../jenkins-scripts/tcwg_kernel-build.sh @@ manifest.sh cd .. </cut> @@ -275,6 +301,10 @@ Bisect log: ${BUILD_URL}artifact/artifacts/bisect.log/*view*/ Artifacts: ${BUILD_URL}artifact/artifacts/ Build URL: $BUILD_URL Build log: ${BUILD_URL}consoleText +EOF + +if [ -f $artifacts/first-bad ]; then + cat >> $artifacts/ci_mail_parameters.sh <<EOF Full commit: <cut> @@ -282,12 +312,6 @@ $(git -C $current_project show $first_bad | tr '"' "'") </cut> " EOF - chmod +x artifacts/ci_mail_parameters.sh fi -# Trigger master build now instead of waiting for next timed SCM trigger. -cat > $artifacts/trigger-2-build-master <<EOF -current_project=$current_project -EOF - trap "" EXIT |