From a44ae004dede96bc93eab93971c848d1e7d6e59b Mon Sep 17 00:00:00 2001 From: Michael Vasseur <14887731+vmcj@users.noreply.github.com> Date: Fri, 6 Dec 2024 21:13:11 +0100 Subject: [PATCH 1/6] Unbreak rejudgingpage --- webapp/src/Form/Type/RejudgingType.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp/src/Form/Type/RejudgingType.php b/webapp/src/Form/Type/RejudgingType.php index 4335f75f74..5afcda07c6 100644 --- a/webapp/src/Form/Type/RejudgingType.php +++ b/webapp/src/Form/Type/RejudgingType.php @@ -8,7 +8,7 @@ use App\Entity\Problem; use App\Entity\Team; use App\Entity\User; -use App\Service\DOMJudgeService; +use App\Service\ConfigurationService; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; use Symfony\Bridge\Doctrine\Form\Type\EntityType; @@ -25,7 +25,7 @@ class RejudgingType extends AbstractType { - public function __construct(protected readonly DOMJudgeService $dj, protected readonly EntityManagerInterface $em) + public function __construct(protected readonly ConfigurationService $config, protected readonly EntityManagerInterface $em) { } From a2e90da34d751adce89ffdf59105eb22edb515f7 Mon Sep 17 00:00:00 2001 From: Michael Vasseur <14887731+vmcj@users.noreply.github.com> Date: Fri, 6 Dec 2024 23:37:11 +0100 Subject: [PATCH 2/6] Unbreak App\Tests\Unit\Service\ConfigurationServiceTest::testAddOptionsResults Loosely based on: b03e8ac3c84ec2e4714b535b3b74c3d60df94db2 --- webapp/tests/Unit/Service/ConfigurationServiceTest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/webapp/tests/Unit/Service/ConfigurationServiceTest.php b/webapp/tests/Unit/Service/ConfigurationServiceTest.php index 97f02ec6bb..c0b2de5cef 100644 --- a/webapp/tests/Unit/Service/ConfigurationServiceTest.php +++ b/webapp/tests/Unit/Service/ConfigurationServiceTest.php @@ -332,8 +332,7 @@ public function provideAddOptionsExecutables(): Generator public function testAddOptionsResults(string $item): void { $verdictOptions = ['' => '']; - $verdictsConfig = self::getContainer()->getParameter('domjudge.etcdir') . '/verdicts.php'; - $verdicts = include $verdictsConfig; + $verdicts = $this->config->getVerdicts(['final']); foreach (array_keys($verdicts) as $verdict) { $verdictOptions[$verdict] = $verdict; } From 4043836d5ecf694f5a8eac5be539e4ec86318f73 Mon Sep 17 00:00:00 2001 From: Michael Vasseur <14887731+vmcj@users.noreply.github.com> Date: Sat, 7 Dec 2024 12:37:00 +0100 Subject: [PATCH 3/6] Fail integration test on any PHP/Framwork Exception In the past we only did this for warnings in the prod env but those shouldn't happen regardless of if we run those in `dev`, `test` or `prod`. This hopefully protects future tests where we miss this line. --- .github/workflows/integration.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index ce509ac632..765fcef48c 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -141,10 +141,10 @@ jobs: curl $CURLOPTS http://localhost/domjudge/jury/contests/1/freeze/doNow || true curl $CURLOPTS http://localhost/domjudge/jury/contests/1/end/doNow || true curl $CURLOPTS -X POST -d 'finalize_contest[b]=0&finalize_contest[finalizecomment]=gitlab&finalize_contest[finalize]=' http://localhost/domjudge/jury/contests/1/finalize - - name: Verify no errors in prod.log + - name: Verify no errors in symfony {prod,test,dev}.log shell: bash run: | - if cat /opt/domjudge/domserver/webapp/var/log/prod.log | egrep '(CRITICAL|ERROR):'; then + if cat /opt/domjudge/domserver/webapp/var/log/*.log | egrep '(CRITICAL|ERROR):'; then exit 1 fi - name: Download and perform API check From 48dba61ac71863c8a19677d96cc0de1880f8ca99 Mon Sep 17 00:00:00 2001 From: Michael Vasseur <14887731+vmcj@users.noreply.github.com> Date: Sat, 7 Dec 2024 17:01:18 +0100 Subject: [PATCH 4/6] Actually update the max_packet size This was tried with e596a3b11 but did still fail. --- .github/jobs/baseinstall.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/jobs/baseinstall.sh b/.github/jobs/baseinstall.sh index 9123500eb5..d292fc639c 100755 --- a/.github/jobs/baseinstall.sh +++ b/.github/jobs/baseinstall.sh @@ -64,7 +64,7 @@ mysql_root "show databases" mysql_root "SELECT CURRENT_USER();" mysql_root "SELECT USER();" mysql_root "SELECT user,host FROM mysql.user" -mysql_root "SET max_allowed_packet=1073741824" +mysql_root "SET GLOBAL max_allowed_packet=1073741824" echo "unused:sqlserver:domjudge:domjudge:domjudge:3306" > /opt/domjudge/domserver/etc/dbpasswords.secret mysql_user "SELECT CURRENT_USER();" mysql_user "SELECT USER();" From 564ff0e980b581206cd77f1d3b7d64e872e7e315 Mon Sep 17 00:00:00 2001 From: Michael Vasseur <14887731+vmcj@users.noreply.github.com> Date: Sat, 7 Dec 2024 17:15:27 +0100 Subject: [PATCH 5/6] Use latest GHA for DB artifact upload --- .github/workflows/integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 765fcef48c..86e3d85c45 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -84,7 +84,7 @@ jobs: run: mysqldump -uroot -proot domjudge > /tmp/db.sql - name: Upload database dump for debugging if: ${{ !cancelled() }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: DB-dump path: /tmp/db.sql From fba6301660182c4e6f561deed684ba30ed3fab73 Mon Sep 17 00:00:00 2001 From: Michael Vasseur <14887731+vmcj@users.noreply.github.com> Date: Sat, 7 Dec 2024 17:17:47 +0100 Subject: [PATCH 6/6] Fix dumping SQL dump artifact --- .github/workflows/integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 86e3d85c45..e6921fa834 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -81,7 +81,7 @@ jobs: done - name: dump the db if: ${{ !cancelled() }} - run: mysqldump -uroot -proot domjudge > /tmp/db.sql + run: mysqldump -uroot -proot --quick --max_allowed_packet=1024M domjudge > /tmp/db.sql - name: Upload database dump for debugging if: ${{ !cancelled() }} uses: actions/upload-artifact@v4