summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2021-09-10 14:50:50 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2021-09-10 14:50:50 +0000
commit6a32dfbd33a6d730bad85d12e7ecd248e28aba0f (patch)
tree66d57409fd2b54caa26e92af6e2ca4cb07a7433a
parentc9f15da135992913d48e353ffd59d1a78a82c4b5 (diff)
round-robin.sh: Move email and jira text generation here
... from round-robin-bisect.sh. The goal is to enable individual build scripts to generate better regression reports. Change-Id: I5ee45c0d3fd14909e853104daa53d3506603830c
-rwxr-xr-xround-robin-bisect.sh24
-rw-r--r--round-robin.sh42
2 files changed, 47 insertions, 19 deletions
diff --git a/round-robin-bisect.sh b/round-robin-bisect.sh
index 258b4666..1339572d 100755
--- a/round-robin-bisect.sh
+++ b/round-robin-bisect.sh
@@ -677,8 +677,7 @@ if $notify_devs; then
if [ x"${TCWG_JIRA_TOKEN+set}" = x"set" ] && [ x"$jira_card" != x"" ]; then
cat > $artifacts/jenkins/jira-body.txt <<EOF
[$jira_card]
-Identified regression caused by *$current_project:$first_bad*:
-$(git -C $current_project log --pretty=short -n 1 $first_bad)
+$(cat $artifacts/build-$first_bad/mail/jira-body.txt)
This commit has regressed these CI configurations:
$occurences
@@ -700,27 +699,21 @@ EOF
res=0 && wait $! || res=$?
if [ $res != 0 ]; then
cat >> $artifacts/jenkins/mail-body.draft <<EOF
-WARNING: Could not post this report to $jira_card
+WARNING: Could not post this report to https://linaro.atlassian.net/browse/$jira_card
EOF
fi
fi
cat >> $artifacts/jenkins/mail-body.draft <<EOF
-Identified regression caused by *$current_project:$first_bad*:
-$(git -C $current_project log --pretty=short -n 1 $first_bad)
-
-Results regressed to (for first_bad == $first_bad)
-$(cat $artifacts/build-$first_bad/results)
-
-from (for last_good == $last_good)
-$(cat $artifacts/build-$last_good/results)
+$(cat $artifacts/build-$first_bad/mail/mail-body.txt)
This commit has regressed these CI configurations:
$occurences
-Artifacts of last_good build: ${BUILD_URL}artifact/$rel_artifacts/build-$last_good/
-Artifacts of first_bad build: ${BUILD_URL}artifact/$rel_artifacts/build-$first_bad/
+First_bad build: ${BUILD_URL}artifact/$rel_artifacts/build-$first_bad/
+Last_good build: ${BUILD_URL}artifact/$rel_artifacts/build-$last_good/
+Baseline build: ${BUILD_URL}artifact/$rel_artifacts/build-baseline/
Even more details: ${BUILD_URL}artifact/$rel_artifacts/
Reproduce builds:
@@ -764,9 +757,8 @@ $(git -C $current_project show --stat --patch $first_bad | head -n 1000)
</cut>
EOF
- cat > $artifacts/jenkins/mail-subject.draft <<EOF
-[TCWG CI] Regression caused by $current_project:$first_bad
-EOF
+ cp $artifacts/build-$first_bad/mail/mail-subject.txt \
+ $artifacts/jenkins/mail-subject.draft
# Set mail recipients last to preserve catch-error value from .yaml file.
# Email developers.
diff --git a/round-robin.sh b/round-robin.sh
index f83cc8f7..667689aa 100644
--- a/round-robin.sh
+++ b/round-robin.sh
@@ -623,6 +623,9 @@ check_regression ()
trigger_dest="$run_step_artifacts"
fi
+ local cur_rev
+ cur_rev=$(git -C $single_component rev-parse HEAD)
+
# 1. If $score is less-than 0, then the regression is not very
# interesting, so reduce down to component, but don't bisect. This
# allows non-broken components to advance their revisions.
@@ -653,9 +656,6 @@ check_regression ()
done < <(${rr[breakup_updated_components]})
elif ! [ $score -lt 0 ] 2>/dev/null; then
# Bisect failures in all steps after "-1" step.
- local cur_rev
- cur_rev=$(git -C $single_component rev-parse HEAD)
-
cat > $trigger_dest/trigger-bisect <<EOF
current_project=$single_component
bad_git=${rr[${single_component}_git]%#*}#$cur_rev
@@ -665,6 +665,42 @@ EOF
fi
fi
+ if [ x"$single_component" != x"" ] && ! [ $score -lt 0 ] 2>/dev/null; then
+ local mail_dir=${rr[top_artifacts]}/mail
+ mkdir -p $mail_dir
+
+ if [ -f $run_step_artifacts/jira-body.txt ]; then
+ cp $run_step_artifacts/jira-body.txt $mail_dir/
+ else
+ cat > $mail_dir/jira-body.txt <<EOF
+Identified regression caused by *$single_component* commit:
+$(git -C $single_component log --pretty=short -n 1 HEAD)
+EOF
+ fi
+
+ if [ -f $run_step_artifacts/mail-body.txt ]; then
+ cp $run_step_artifacts/mail-body.txt $mail_dir/
+ else
+ cat > $mail_dir/mail-body.txt <<EOF
+$(cat $mail_dir/jira-body.txt)
+
+Results regressed to
+$(cat ${rr[top_artifacts]}/results)
+
+from
+$(cat base-artifacts/results)
+EOF
+ fi
+
+ if [ -f $run_step_artifacts/mail-subject.txt ]; then
+ cp $run_step_artifacts/mail-subject.txt $mail_dir/
+ else
+ cat > $mail_dir/mail-subject.txt <<EOF
+[TCWG CI] Regression caused by $single_component:$cur_rev
+EOF
+ fi
+ fi
+
if [ x"${rr[update_baseline]}" = x"update" ]; then
echo "Detected a regression in \"update\" mode!"
false