]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-pr-submodules: explicitly fetch the target branch 674/head
authorKen Dreyer <kdreyer@redhat.com>
Tue, 4 Apr 2017 21:40:37 +0000 (15:40 -0600)
committerKen Dreyer <kdreyer@redhat.com>
Tue, 4 Apr 2017 21:40:37 +0000 (15:40 -0600)
This ceph-pr-submodules job is still giving us false positives in some
cases.

We were comparing against a target branch (for example "origin/jewel"),
but we could not see the *exact* sha1 that Jenkins thought was
"origin/jewel". Sometimes this job would fail, and the failure hinted
that Jenkins might be comparing an older target branch.

Explicitly fetch the target branch immediately before doing the "git
log" operation, and print the target branch's sha1 ref to stdout in case
we need further debugging.

ceph-pr-submodules/build/build

index d7081ae03142803dadc7952684d8025e0aa193b6..747bc73dfacf6228ca473a564d61e0ac634c0a7f 100644 (file)
@@ -4,6 +4,13 @@ set -ex
 
 cd "$WORKSPACE"
 
+# Ensure that our clone has the very latest target branch.
+# The Jenkins Git plugin may have not updated this particular ref.
+git fetch origin ${ghprbTargetBranch}:refs/remotes/origin/${ghprbTargetBranch}
+
+echo "Comparing the following target branch:"
+git rev-parse origin/${ghprbTargetBranch}
+
 # show diffs between $ghprbTargetBranch (where the merge is going) and
 # $ghprbActualCommit (the tip of the branch that's merging) with '...',
 # which is equivalent to diff $(git merge-base TB AC) AC, or "show