diff options
author | Mathew Robinson <chasinglogic@gmail.com> | 2019-05-07 13:29:58 -0400 |
---|---|---|
committer | Mathew Robinson <chasinglogic@gmail.com> | 2019-05-20 11:30:04 -0400 |
commit | 9dddfaf93ce1c63acdb9b720fd5841dde4b402c7 (patch) | |
tree | 3bb2fc926abe01994defdaf3f5d241184e74d3bf | |
parent | 9379741da6e00edfed33e65d92a3cf3b61304e68 (diff) | |
download | mongo-9dddfaf93ce1c63acdb9b720fd5841dde4b402c7.tar.gz |
SERVER-41038 Guarantee that git describe returns the same number of digits regardless of version
(cherry picked from commit 14c4a6e66351e07b1965622b4e8fb8d5bf0a04e2)
-rw-r--r-- | buildscripts/utils.py | 4 | ||||
-rw-r--r-- | etc/distributed_correctness.yml | 2 | ||||
-rw-r--r-- | etc/evergreen.yml | 4 | ||||
-rw-r--r-- | etc/longevity.yml | 2 | ||||
-rw-r--r-- | etc/perf.yml | 4 | ||||
-rw-r--r-- | etc/system_perf.yml | 4 |
6 files changed, 10 insertions, 10 deletions
diff --git a/buildscripts/utils.py b/buildscripts/utils.py index 5073b26ad85..dbf8e45dde9 100644 --- a/buildscripts/utils.py +++ b/buildscripts/utils.py @@ -95,9 +95,9 @@ def get_git_version(): def get_git_describe(): - """Return 'git describe'.""" + """Return 'git describe --abbrev=7'.""" with open(os.devnull, "r+") as devnull: - proc = subprocess.Popen("git describe", stdout=subprocess.PIPE, stderr=devnull, + proc = subprocess.Popen("git describe --abbrev=7", stdout=subprocess.PIPE, stderr=devnull, stdin=devnull, shell=True) return proc.communicate()[0].strip() diff --git a/etc/distributed_correctness.yml b/etc/distributed_correctness.yml index 470150ad2b2..68d170d0ba1 100644 --- a/etc/distributed_correctness.yml +++ b/etc/distributed_correctness.yml @@ -230,7 +230,7 @@ tasks: set -o verbose # We get the raw version string (r1.2.3-45-gabcdef) from git - MONGO_VERSION=$(git describe) + MONGO_VERSION=$(git describe --abbrev=7) # If this is a patch build, we add the patch version id to the version string so we know # this build was a patch, and which evergreen task it came from if [ "${is_patch|}" = "true" ]; then diff --git a/etc/evergreen.yml b/etc/evergreen.yml index 05ba814bd7d..6ed1141cc2d 100644 --- a/etc/evergreen.yml +++ b/etc/evergreen.yml @@ -437,7 +437,7 @@ functions: fi # For compile bypass we need to skip the binary version check since we can tag a commit # after the base commit binaries were created. This would lead to a mismatch of the binaries - # and the version from git describe in the compile_expansions.yml. + # and the version from git describe --abbrev=7 in the compile_expansions.yml. if [ "${is_patch}" = "true" ] && [ "${bypass_compile|false}" = "true" ]; then echo "Skipping binary version check since we are bypassing compile in this patch build." exit 0 @@ -1339,7 +1339,7 @@ functions: set -o verbose # We get the raw version string (r1.2.3-45-gabcdef) from git - MONGO_VERSION=$(git describe) + MONGO_VERSION=$(git describe --abbrev=7) # If this is a patch build, we add the patch version id to the version string so we know # this build was a patch, and which evergreen task it came from if [ "${is_patch}" = "true" ] && [ "${bypass_compile|false}" = "false" ]; then diff --git a/etc/longevity.yml b/etc/longevity.yml index 909c58245bb..b7eef4ac334 100644 --- a/etc/longevity.yml +++ b/etc/longevity.yml @@ -201,7 +201,7 @@ tasks: set -o verbose # We get the raw version string (r1.2.3-45-gabcdef) from git - MONGO_VERSION=$(git describe) + MONGO_VERSION=$(git describe --abbrev=7) # If this is a patch build, we add the patch version id to the version string so we know # this build was a patch, and which evergreen task it came from if [ "${is_patch|}" = "true" ]; then diff --git a/etc/perf.yml b/etc/perf.yml index a67db088f6f..4603f33f2bc 100644 --- a/etc/perf.yml +++ b/etc/perf.yml @@ -93,7 +93,7 @@ functions: chmod +x mongo git clone git@github.com:mongodb/mongo-perf.git perf cd perf - git describe --tags + git describe --abbrev=7 --tags - command: shell.exec params: background: true @@ -249,7 +249,7 @@ tasks: set -o verbose # We get the raw version string (r1.2.3-45-gabcdef) from git - MONGO_VERSION=$(git describe) + MONGO_VERSION=$(git describe --abbrev=7) # If this is a patch build, we add the patch version id to the version string so we know # this build was a patch, and which evergreen task it came from if [ "${is_patch|}" = "true" ]; then diff --git a/etc/system_perf.yml b/etc/system_perf.yml index f4986b8d05a..8b38c5eb5c7 100644 --- a/etc/system_perf.yml +++ b/etc/system_perf.yml @@ -79,12 +79,12 @@ functions: set -o verbose # We get the raw version string (r1.2.3-45-gabcdef) from git - MONGO_VERSION=$(git describe) + MONGO_VERSION=$(git describe --abbrev=7) # If we're going to compile the upstream wtdevelop repository for wiredtiger, add # that githash to version string. if [ "${compile-variant|}" = "-wtdevelop" ]; then - WT_VERSION=$(cd src/third_party/wtdevelop; git describe | cut -c 9-) + WT_VERSION=$(cd src/third_party/wtdevelop; git describe --abbrev=7 | cut -c 9-) MONGO_VERSION="$MONGO_VERSION-wtdevelop-$WT_VERSION" fi # If this is a patch build, we add the patch version id to the version string so we know |