run_ci.sh: git log what [base] version is being tested

Zephyr Continuous Integration made the choice of rebasing pull requests
on its fast moving master branch before testing them. Unfortunately the
Shippable interface assumes the other choice[*] and highlights the SHA1
of the pull request _before_ rebasing which is very misleading.  For now
the only way to realize this disconnect is to scrutinize the build logs
and/or this source code (or tribal knowledge).

To mitigate and reduce a bit this confusion, run a short:
  git log -n 5 --oneline --decorate
before and after rebase.

Making it worse, Shippable sub-runs are not pegged to a common base
version. For instance the reason why shippable sub-run 35578.1 passed
while all other 35578.x sub runs failed is very likely because PR #13803
was merged to master in the mean time. This commit would have been able
to prove that.

[*] In an ideal world with infinite time and resources, Continuous
Integration would test pull requests BOTH alone and combined with the
moving tip.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This commit is contained in:
Marc Herbert 2019-02-28 14:51:42 -08:00 committed by Anas Nashif
parent f7e995c075
commit 6b4cda9b25

View file

@ -96,9 +96,18 @@ if [ -n "$MAIN_CI" ]; then
fi fi
source zephyr-env.sh source zephyr-env.sh
SANITYCHECK="${ZEPHYR_BASE}/scripts/sanitycheck" SANITYCHECK="${ZEPHYR_BASE}/scripts/sanitycheck"
# Possibly the only record of what exact version is being tested:
short_git_log='git log -n 5 --oneline --decorate --abbrev=12 '
if [ -n "$PULL_REQUEST_NR" ]; then if [ -n "$PULL_REQUEST_NR" ]; then
$short_git_log $REMOTE/${BRANCH}
# Now let's pray this script is being run from a
# different location
# https://stackoverflow.com/questions/3398258/edit-shell-script-while-its-running
git rebase $REMOTE/${BRANCH}; git rebase $REMOTE/${BRANCH};
fi fi
$short_git_log
fi fi
function handle_coverage() { function handle_coverage() {