From c9de6b3919c1ca1d6bda94d2ff8a409083dba043 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Wed, 8 Jun 2022 10:20:13 -0500 Subject: [PATCH 1/5] Resolve latest Paper version when no published builds --- scripts/start-deployPaper | 42 ++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/scripts/start-deployPaper b/scripts/start-deployPaper index c84d2727689..a0f83901a3d 100755 --- a/scripts/start-deployPaper +++ b/scripts/start-deployPaper @@ -4,6 +4,30 @@ set -o pipefail isDebugging && set -x +ourScript="$0" +ourArgs=("$@") + +function handleMissingVersion() { + expectedVersion=${VANILLA_VERSION} + versions=$(curl -fsSL "https://papermc.io/api/v2/projects/paper" -H "accept: application/json") + if [[ $VERSION = LATEST ]]; then + tries=0 + while ((tries++ < 5)); do + VANILLA_VERSION=$(echo "$versions" | jq -r ".versions[$((- tries))]") + if [[ $(curl -fsSL "https://papermc.io/api/v2/projects/paper/versions/${VANILLA_VERSION}" -H "accept: application/json" \ + | jq '.builds[-1]') != null ]]; then + log "WARN: using ${VANILLA_VERSION} since that's the latest provided by PaperMC" + # re-execute the current script with the newly computed version + exec "$ourScript" "${ourArgs[@]}" + fi + done + fi + log "ERROR: ${expectedVersion} is not published by PaperMC" + log " Set VERSION to one of the following: " + log " $(echo "$versions" | jq -r '.versions | join(", ")')" + exit 1 +} + if [[ $PAPER_DOWNLOAD_URL ]]; then export SERVER=$(getFilenameFromUrl "${PAPER_DOWNLOAD_URL}") @@ -23,26 +47,16 @@ else 0) ;; 22) - versions=$(curl -fsSL "https://papermc.io/api/v2/projects/paper" -H "accept: application/json") - if [[ $VERSION = LATEST ]]; then - VANILLA_VERSION=$(echo "$versions" | jq -r '.versions[-1]') - log "WARN: using ${VANILLA_VERSION} since that's the latest provided by PaperMC" - # re-execute the current script with the newly computed version - exec "$0" "$@" - fi - log "ERROR: ${VANILLA_VERSION} is not published by PaperMC" - log " Set VERSION to one of the following: " - log " $(echo "$versions" | jq -r '.versions | join(", ")')" - exit 1 + handleMissingVersion ;; *) echo "ERROR: unknown error while looking up PaperMC version=${VANILLA_VERSION}" exit 1 ;; esac - if [ $? != 0 ]; then - echo "ERROR: failed to lookup PaperMC build from version ${VANILLA_VERSION}" - exit 1 + + if [[ $build = null ]]; then + handleMissingVersion fi export SERVER=$(curl -fsSL "https://papermc.io/api/v2/projects/paper/versions/${VANILLA_VERSION}/builds/${build}" -H "accept: application/json" \ From 98676f39f5461ad281208e2c782bb3f7ba21f319 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Wed, 8 Jun 2022 10:26:33 -0500 Subject: [PATCH 2/5] Disabling forgeapimods_file --- .../{docker-compose.yml => docker-compose.yml.disabled} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/setuponlytests/forgeapimods_file/{docker-compose.yml => docker-compose.yml.disabled} (100%) diff --git a/tests/setuponlytests/forgeapimods_file/docker-compose.yml b/tests/setuponlytests/forgeapimods_file/docker-compose.yml.disabled similarity index 100% rename from tests/setuponlytests/forgeapimods_file/docker-compose.yml rename to tests/setuponlytests/forgeapimods_file/docker-compose.yml.disabled From d7191686210d779f373a78804c82b612af631831 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Wed, 8 Jun 2022 10:37:06 -0500 Subject: [PATCH 3/5] Pinning forgeapimods tests to 1.18.2 --- .../{docker-compose.yml.disabled => docker-compose.yml} | 2 +- tests/setuponlytests/forgeapimods_gametype/docker-compose.yml | 2 +- tests/setuponlytests/forgeapimods_projectids/docker-compose.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename tests/setuponlytests/forgeapimods_file/{docker-compose.yml.disabled => docker-compose.yml} (95%) diff --git a/tests/setuponlytests/forgeapimods_file/docker-compose.yml.disabled b/tests/setuponlytests/forgeapimods_file/docker-compose.yml similarity index 95% rename from tests/setuponlytests/forgeapimods_file/docker-compose.yml.disabled rename to tests/setuponlytests/forgeapimods_file/docker-compose.yml index 9e1959b4373..58c313ae572 100644 --- a/tests/setuponlytests/forgeapimods_file/docker-compose.yml.disabled +++ b/tests/setuponlytests/forgeapimods_file/docker-compose.yml @@ -13,7 +13,7 @@ services: # Using family to test FORGEAPI Family filter. FAMILY: FABRIC CUSTOM_SERVER: /servers/fake.jar - VERSION: ${MINECRAFT_VERSION:-LATEST} + VERSION: 1.18.2 MODS_FORGEAPI_FILE: /config/forgeapi_mods.json # Key is defined in .github/workflows/pr.yml and ci.yml # This should be coming from github secrets. diff --git a/tests/setuponlytests/forgeapimods_gametype/docker-compose.yml b/tests/setuponlytests/forgeapimods_gametype/docker-compose.yml index c14140f003e..3373b595fd7 100644 --- a/tests/setuponlytests/forgeapimods_gametype/docker-compose.yml +++ b/tests/setuponlytests/forgeapimods_gametype/docker-compose.yml @@ -13,7 +13,7 @@ services: # Using family to test FORGEAPI Family filter. FAMILY: FABRIC CUSTOM_SERVER: /servers/fake.jar - VERSION: ${MINECRAFT_VERSION:-LATEST} + VERSION: 1.18.2 # Validate Skip Gametype Filter: MODS_FORGEAPI_IGNORE_GAMETYPE: "TRUE" # Validates that Biomes does not download terrablender diff --git a/tests/setuponlytests/forgeapimods_projectids/docker-compose.yml b/tests/setuponlytests/forgeapimods_projectids/docker-compose.yml index ab29770058d..418f118b1fe 100644 --- a/tests/setuponlytests/forgeapimods_projectids/docker-compose.yml +++ b/tests/setuponlytests/forgeapimods_projectids/docker-compose.yml @@ -13,7 +13,7 @@ services: # - Currently we do not support filtering on vanilla. FAMILY: VANILLA CUSTOM_SERVER: /servers/fake.jar - VERSION: ${MINECRAFT_VERSION:-LATEST} + VERSION: 1.18.2 MODS_FORGEAPI_DOWNLOAD_DEPENDENCIES: "TRUE" # Contains mix of Forge and Fabric mods MODS_FORGEAPI_PROJECTIDS: 416089,419697 From 530dcd45194786990114c1d84865df44741ddf38 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Wed, 8 Jun 2022 10:58:39 -0500 Subject: [PATCH 4/5] Pin tests at 1.18.2 for now --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 1f5b9cbed0e..d940a3d58ac 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -34,7 +34,7 @@ jobs: - name: Run tests env: MODS_FORGEAPI_KEY: ${{ secrets.MODS_FORGEAPI_KEY }} - MINECRAFT_VERSION: LATEST + MINECRAFT_VERSION: 1.18.2 run: | tests/test.sh push: From 33f00c0b758cd1152b0c2bd49e328edf56082e97 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Wed, 8 Jun 2022 10:59:37 -0500 Subject: [PATCH 5/5] Pin build tests to 1.18.2 for now --- .github/workflows/build-multiarch.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-multiarch.yml b/.github/workflows/build-multiarch.yml index 402226b13e6..5b7b8700f02 100644 --- a/.github/workflows/build-multiarch.yml +++ b/.github/workflows/build-multiarch.yml @@ -34,19 +34,19 @@ jobs: # jammy doesn't work until minecraft updates to https://github.com/netty/netty/issues/12343 baseImage: eclipse-temurin:17-jre-focal platforms: linux/amd64,linux/arm/v7,linux/arm64 - mcVersion: LATEST + mcVersion: 1.18.2 - variant: java17-jdk baseImage: eclipse-temurin:17-focal platforms: linux/amd64,linux/arm/v7,linux/arm64 - mcVersion: LATEST + mcVersion: 1.18.2 - variant: java17-openj9 baseImage: ibm-semeru-runtimes:open-17-jre platforms: linux/amd64,linux/arm64 - mcVersion: LATEST + mcVersion: 1.18.2 - variant: java17-alpine baseImage: eclipse-temurin:17-jre-alpine platforms: linux/amd64 - mcVersion: LATEST + mcVersion: 1.18.2 # JAVA 11: - variant: java11 baseImage: adoptopenjdk:11-jre-hotspot