From 6b4cda9b2568862bf7c6ba86b61a5be4fdbe7ee4 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Thu, 28 Feb 2019 14:51:42 -0800 Subject: [PATCH] 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 --- scripts/ci/run_ci.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/ci/run_ci.sh b/scripts/ci/run_ci.sh index c56ab411e8..cf1e573614 100755 --- a/scripts/ci/run_ci.sh +++ b/scripts/ci/run_ci.sh @@ -96,9 +96,18 @@ if [ -n "$MAIN_CI" ]; then fi source zephyr-env.sh 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 + $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}; fi + $short_git_log fi function handle_coverage() {