Skip to content

Commit 0a6a863

Browse files
authored
Merge pull request #741 from github/enterprise-3.11-backport-update-versions
Update version for 3.11 and fix unsupported version test to support unreleased versions
2 parents 27aa9b5 + b4b127f commit 0a6a863

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

bin/ghe-host-check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ fi
173173

174174
# backup-utils 2.13 onwards limits support to the current and previous two releases
175175
# of GitHub Enterprise Server.
176-
supported_minimum_version="3.7.0"
176+
supported_minimum_version="3.9.0"
177177

178178
if [ "$(version $version)" -ge "$(version $supported_minimum_version)" ]; then
179179
supported=1

share/github-backup-utils/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.10.0
1+
3.11.0

test/test-ghe-host-check.sh

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,32 +63,31 @@ begin_test "ghe-host-check detects unsupported GitHub Enterprise Server versions
6363
# Use the modified releases string as needed
6464
supported=$(echo "$releases_with_replacement" | jq -r 'select(."'${bu_major_minor}'")')
6565
# shellcheck disable=SC2207 # Command required as alternatives fail
66-
keys=($(echo "$releases_with_replacement" | jq -r 'keys[]'))
66+
keys=($(echo "$releases_with_replacement" | jq -r '. | keys_unsorted | sort_by( split(".") | map(tonumber) )[]'))
6767

6868
if [ -z "$supported" ]
6969
then
7070
#BACKUP_UTILS_VERSION WAS NOT FOUND IN LATEST.JSON, CHECK IF ITS GREATER THAN LAST VERSION
71-
if [ "$(version $bu_major_minor)" -ge "$(version ${keys[$((${#keys[@]} - 2 ))]})" ]; then
71+
if [ "$(version $bu_major_minor)" -ge "$(version ${keys[-1]})" ]; then
7272
GHE_TEST_REMOTE_VERSION="$bu_major_minor.0" ghe-host-check
73-
GHE_TEST_REMOTE_VERSION="${keys[$(( ${#keys[@]} - 2 ))]}.0" ghe-host-check
74-
GHE_TEST_REMOTE_VERSION="${keys[$(( ${#keys[@]} - 3 ))]}.0" ghe-host-check
73+
# Test most recent version
74+
# Don't test 2 versions back because it fails when we bump the version on
75+
# master after branching for a feature release, before it's released
76+
GHE_TEST_REMOTE_VERSION="${keys[-1]}.0" ghe-host-check
7577
fi
7678
else
7779
#BACKUP_UTILS_VERSION WAS FOUND IN LATEST.JSON
7880
ix=0
79-
for i in "${keys[@]}";do
81+
for i in "${keys[@]}";do
8082
if [ "$i" == "$bu_major_minor" ];then
8183
break
8284
fi
8385
ix=$(( $ix + 1 ))
8486
done
8587
GHE_TEST_REMOTE_VERSION="${keys[$ix]}.0" ghe-host-check
86-
# sometimes when the latest.json is updated during a release this test gets broken.
87-
if [ "${keys[$(( $ix - 1 ))]}" != "latest" ]; then
88-
GHE_TEST_REMOTE_VERSION="${keys[$(( $ix - 1 ))]}.0" ghe-host-check
89-
fi
88+
# Test previous 2 supported versions
89+
GHE_TEST_REMOTE_VERSION="${keys[$(( $ix - 1 ))]}.0" ghe-host-check
9090
GHE_TEST_REMOTE_VERSION="${keys[$(( $ix - 2 ))]}.0" ghe-host-check
91-
9291
fi
9392
! GHE_TEST_REMOTE_VERSION=11.340.36 ghe-host-check
9493
GHE_TEST_REMOTE_VERSION=$bu_version_major.$bu_version_minor.999 ghe-host-check

test/testlib.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export GHE_BACKUP_CONFIG GHE_DATA_DIR GHE_REMOTE_DATA_DIR GHE_REMOTE_ROOT_DIR
4848

4949
# The default remote appliance version. This may be set in the environment prior
5050
# to invoking tests to emulate a different remote vm version.
51-
: ${GHE_TEST_REMOTE_VERSION:=3.8.0.rc1}
51+
: ${GHE_TEST_REMOTE_VERSION:=3.11.0.rc1}
5252
export GHE_TEST_REMOTE_VERSION
5353

5454
# Source in the backup config and set GHE_REMOTE_XXX variables based on the

0 commit comments

Comments
 (0)