From fc844c496d42a07cc471bf05ab48ae666330d60d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BCrk?= Date: Sat, 24 Jan 2026 14:23:17 +0100 Subject: [PATCH] [BUGFIX] Return exitcode != 0 when `runTests.sh -s composerUpdate(Min|Max)` fails The two `Build/Scripts/runTests.sh -s composerUpdateMin` and `Build/Scripts/runTests.sh -s composerUpdateMax` uses multiple commands passed to a single php container as chained command concatenated using `;` executing all commands, not stopping if one failes only returning the exit code of the last command `composer show`, which is mostly `0` and communication success. This change reworks the command building using `&&` to chain the commands and abort in case one fails and using exitcode of the failed command. Resolves: #1882 --- .github/workflows/ci.yml | 3 +++ Build/Scripts/runTests.sh | 13 +++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 592b5b5d..57013c58 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,6 +19,7 @@ jobs: - name: Checkout uses: actions/checkout@v6 - name: Install Composer dependencies + # @todo Linting only against ^13.4 - why not against ^12.4 ? run: Build/Scripts/runTests.sh -p ${{ matrix.php-version }} -s composerUpdateMax -t 13.4 - name: Lint PHP run: | @@ -27,6 +28,8 @@ jobs: fail-fast: false matrix: php-version: + # @todo 8.1 does not make sense with TYPOP3 ^13.4 hard coded in the `composer install` step above. + # Drop it or use `^12.4` above or make core version part of the matrix. - "8.1" - "8.2" - "8.3" diff --git a/Build/Scripts/runTests.sh b/Build/Scripts/runTests.sh index 328fd385..26b406a7 100755 --- a/Build/Scripts/runTests.sh +++ b/Build/Scripts/runTests.sh @@ -552,17 +552,22 @@ case ${TEST_SUITE} in ;; composerUpdateMax) # `dumpautoload` removed due to error with missing `composer.lock` file on publishing public assets. - COMMAND="composer config --unset platform.php; composer require --no-ansi --no-interaction --no-progress --no-install typo3/cms-core:"^${CORE_VERSION}"; composer update --no-progress --no-interaction; composer show" - ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-install-max-${SUFFIX} -e COMPOSER_CACHE_DIR=.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} /bin/sh -c "${COMMAND}" + # @todo Consider to use `typo3/minimal` to enforce core version and have `typo3/cms-core` + # with `^12.4 || ^13.4` in `composer.json`. + COMMAND="(composer config --unset platform.php && composer require --no-ansi --no-interaction --no-progress --no-install 'typo3/cms-core':'^${CORE_VERSION}' && composer update --no-progress --no-interaction && composer show)" + ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-install-max-${SUFFIX} -e COMPOSER_CACHE_DIR=.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} /bin/sh -c "${COMMAND[@]}" SUITE_EXIT_CODE=$? ;; composerUpdateMin) # `dumpautoload` removed due to error with missing `composer.lock` file on publishing public assets. - COMMAND="composer config platform.php ${PHP_VERSION}.0; composer require --no-ansi --no-interaction --no-progress --no-install typo3/cms-core:"^${CORE_VERSION}"; composer update --prefer-lowest --no-progress --no-interaction; composer show" - ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-install-min-${SUFFIX} -e COMPOSER_CACHE_DIR=.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} /bin/sh -c "${COMMAND}" + # @todo Consider to use `typo3/minimal` to enforce core version and have `typo3/cms-core` + # with `^12.4 || ^13.4` in `composer.json`. + COMMAND="(composer config platform.php ${PHP_VERSION}.0 && composer require --no-ansi --no-interaction --no-progress --no-install 'typo3/cms-core':'^${CORE_VERSION}' && composer update --prefer-lowest --no-progress --no-interaction && composer show)" + ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-install-min-${SUFFIX} -e COMPOSER_CACHE_DIR=.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} /bin/sh -c "${COMMAND[@]}" SUITE_EXIT_CODE=$? ;; composerNormalize) + # @todo This does not make sense and is always reset within the IF-ELSE-FI block directly after this assignment. COMMAND="composer check:composer:normalize" if [ "${CGLCHECK_DRY_RUN}" -eq 1 ]; then COMMAND="composer check:composer:normalize"