diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml index a4c8a49973..0dbddf8f72 100644 --- a/.github/workflows/codestyle.yml +++ b/.github/workflows/codestyle.yml @@ -46,7 +46,7 @@ jobs: image: pipelinecomponents/php-codesniffer:latest strategy: matrix: - PHPVERSION: ["8.1", "8.2", "8.3"] + PHPVERSION: ["8.1", "8.2", "8.3", "8.4"] steps: - run: apk add git - uses: actions/checkout@v4 diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 3a2e5ac66c..3d7b4fd952 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -13,7 +13,9 @@ jobs: - uses: actions/checkout@v4 - name: Setup composer dependencies run: .github/jobs/composer_setup.sh - - uses: php-actions/phpstan@v3 + - name: Show the phpstan version + run: webapp/vendor/phpstan/phpstan/phpstan --version + - uses: php-actions/phpstan@v3.0.2 with: configuration: webapp/phpstan.dist.neon path: webapp/src webapp/tests diff --git a/gitlab/ci/template.yml b/gitlab/ci/template.yml index 86521a2f22..e810df854c 100644 --- a/gitlab/ci/template.yml +++ b/gitlab/ci/template.yml @@ -50,7 +50,7 @@ - /bin/true parallel: matrix: - - PHPVERSION: ["8.1","8.2","8.3"] + - PHPVERSION: ["8.1","8.2","8.3", "8.4"] TEST: ["E2E","Unit"] CRAWL_SHADOW_MODE: ["0","1"] diff --git a/gitlab/ci/unit.yml b/gitlab/ci/unit.yml index d9a91557b1..5bf7aab8c7 100644 --- a/gitlab/ci/unit.yml +++ b/gitlab/ci/unit.yml @@ -29,21 +29,12 @@ - unit-tests.xml run unit tests: - only: - - main - - /^[0-9].[0-9]$/ extends: [.mariadb_job,.phpsupported_job,.unit_job] run unit tests (PR): - except: - - main - - /^[0-9].[0-9]$/ extends: [.mariadb_job,.phpsupported_job_pr,.unit_job] run unit tests (MySQL): - only: - - main - - /^[0-9].[0-9]$/ extends: [.mysql_job,.unit_job] parallel: matrix: diff --git a/gitlab/unit-tests.sh b/gitlab/unit-tests.sh index 63ae58121e..b412a060cb 100755 --- a/gitlab/unit-tests.sh +++ b/gitlab/unit-tests.sh @@ -36,11 +36,12 @@ php $phpcov webapp/bin/phpunit -c webapp/phpunit.xml.dist webapp/tests/$unittest UNITSUCCESS=$? set -e CNT=0 +THRESHOLD=32 if [ $CODECOVERAGE -eq 1 ]; then CNT=$(sed -n '/Generating code coverage report/,$p' "$GITLABARTIFACTS"/phpunit.out | grep -v DoctrineTestBundle | grep -cv ^$) FILE=deprecation.txt sed -n '/Generating code coverage report/,$p' "$GITLABARTIFACTS"/phpunit.out > ${CI_PROJECT_DIR}/$FILE - if [ $CNT -le 32 ]; then + if [ $CNT -le $THRESHOLD ]; then STATE=success else STATE=failure @@ -52,7 +53,7 @@ if [ $CODECOVERAGE -eq 1 ]; then -X POST \ -H "Authorization: token $GH_BOT_TOKEN_OBSCURED" \ -H "Accept: application/vnd.github.v3+json" \ - -d "{\"state\": \"$STATE\", \"target_url\": \"${CI_JOB_URL/$ORIGINAL/$REPLACETO}/artifacts/$FILE\", \"description\":\"Symfony deprecations\", \"context\": \"Symfony deprecation\"}" + -d "{\"state\": \"$STATE\", \"target_url\": \"${CI_JOB_URL/$ORIGINAL/$REPLACETO}/artifacts/$FILE\", \"description\":\"Symfony deprecations ($version)\", \"context\": \"Symfony deprecation ($version)\"}" fi if [ $UNITSUCCESS -eq 0 ]; then STATE=success @@ -66,7 +67,7 @@ curl https://api.github.com/repos/domjudge/domjudge/statuses/$CI_COMMIT_SHA \ -H "Authorization: token $GH_BOT_TOKEN_OBSCURED" \ -H "Accept: application/vnd.github.v3+json" \ -d "{\"state\": \"$STATE\", \"target_url\": \"${CI_PIPELINE_URL}/test_report\", \"description\":\"Unit tests\", \"context\": \"unit_tests ($version)\"}" -if [ $UNITSUCCESS -ne 0 ]; then +if [ $UNITSUCCESS -ne 0 ] || [ $CNT -gt $THRESHOLD ]; then exit 1 fi diff --git a/webapp/src/Controller/Jury/JuryMiscController.php b/webapp/src/Controller/Jury/JuryMiscController.php index 13fbd55696..c2f6018de9 100644 --- a/webapp/src/Controller/Jury/JuryMiscController.php +++ b/webapp/src/Controller/Jury/JuryMiscController.php @@ -50,7 +50,7 @@ public function __construct( public function indexAction(ConfigurationService $config): Response { if ($this->isGranted('ROLE_ADMIN')) { - $innodbSnapshotIsolation = $this->em->getConnection()->query('SHOW VARIABLES LIKE "innodb_snapshot_isolation"')->fetchAssociative(); + $innodbSnapshotIsolation = $this->em->getConnection()->executeQuery('SHOW VARIABLES LIKE "innodb_snapshot_isolation"')->fetchAssociative(); if ($innodbSnapshotIsolation && $innodbSnapshotIsolation['Value'] === 'ON') { $this->addFlash('danger', 'InnoDB snapshot isolation is enabled. Set --innodb_snapshot_isolation=OFF in your MariaDB configuration. See https://github.com/DOMjudge/domjudge/issues/2848 for more information.'); }