diff --git a/.github/jobs/configure-checks/all.bats b/.github/jobs/configure-checks/all.bats index 207650895f..0ac60eae40 100755 --- a/.github/jobs/configure-checks/all.bats +++ b/.github/jobs/configure-checks/all.bats @@ -111,6 +111,10 @@ compile_assertions_finished () { } @test "Install GNU C only" { + if [ "$distro_id" = "ID=fedora" ]; then + # Fedora ships with a gcc with enough C++ support + skip + fi repo-remove clang g++ repo-install gcc libcgroup-dev compiler_assertions gcc '' diff --git a/judge/judgedaemon.main.php b/judge/judgedaemon.main.php index 676f1f596e..81f3a03656 100644 --- a/judge/judgedaemon.main.php +++ b/judge/judgedaemon.main.php @@ -334,8 +334,9 @@ function fetch_executable_internal( $execbuildpath = $execbuilddir . '/build'; $execrunpath = $execbuilddir . '/run'; $execrunjurypath = $execbuilddir . '/runjury'; - if (!is_dir($execdir) || !file_exists($execdeploypath)) { - system('rm -rf ' . dj_escapeshellarg($execdir) . ' ' . dj_escapeshellarg($execbuilddir), $retval); + if (!is_dir($execdir) || !file_exists($execdeploypath) || + ($combined_run_compare && file_get_contents(LIBJUDGEDIR . '/run-interactive.sh')!==file_get_contents($execrunpath))) { + system('rm -rf ' . dj_escapeshellarg($execdir) . ' ' . dj_escapeshellarg($execbuilddir)); if ($retval !== 0) { disable('judgehost', 'hostname', $myhost, "Deleting '$execdir' or '$execbuilddir' was unsuccessful."); } @@ -1405,7 +1406,7 @@ function judge(array $judgeTask): bool $input = $tcfile['input']; $output = $tcfile['output']; - $passLimit = $run_config['pass_limit']; + $passLimit = $run_config['pass_limit'] ?? 1; for ($passCnt = 1; $passCnt <= $passLimit; $passCnt++) { $nextPass = false; if ($passLimit > 1) { diff --git a/judge/run-interactive.sh b/judge/run-interactive.sh old mode 100644 new mode 100755 diff --git a/webapp/src/Service/ImportExportService.php b/webapp/src/Service/ImportExportService.php index bfea25e3fe..be947c60a0 100644 --- a/webapp/src/Service/ImportExportService.php +++ b/webapp/src/Service/ImportExportService.php @@ -1127,7 +1127,9 @@ public function importAccountsJson(array $data, ?string &$message = null, ?array */ protected function importTeamData(array $teamData, ?string &$message, ?array &$saved = null): int { + /** @var TeamAffiliation[] $createdAffiliations */ $createdAffiliations = []; + /** @var TeamCategory[] $createdCategories */ $createdCategories = []; $createdTeams = []; $updatedTeams = []; @@ -1140,6 +1142,14 @@ protected function importTeamData(array $teamData, ?string &$message, ?array &$s if (!empty($teamItem['team_affiliation']['shortname'])) { // First look up if the affiliation already exists. $teamAffiliation = $this->em->getRepository(TeamAffiliation::class)->findOneBy(['shortname' => $teamItem['team_affiliation']['shortname']]); + if (!$teamAffiliation) { + foreach ($createdAffiliations as $createdAffiliation) { + if ($createdAffiliation->getShortname() === $teamItem['team_affiliation']['shortname']) { + $teamAffiliation = $createdAffiliation; + break; + } + } + } if (!$teamAffiliation) { $teamAffiliation = new TeamAffiliation(); $propertyAccessor = PropertyAccess::createPropertyAccessor(); @@ -1166,6 +1176,15 @@ protected function importTeamData(array $teamData, ?string &$message, ?array &$s } } elseif (!empty($teamItem['team_affiliation']['externalid'])) { $teamAffiliation = $this->em->getRepository(TeamAffiliation::class)->findOneBy(['externalid' => $teamItem['team_affiliation']['externalid']]); + if (!$teamAffiliation) { + foreach ($createdAffiliations as $createdAffiliation) { + if ($createdAffiliation->getExternalid() === $teamItem['team_affiliation']['externalid']) { + $teamAffiliation = $createdAffiliation; + break; + } + } + } + if (!$teamAffiliation) { $teamAffiliation = new TeamAffiliation(); $teamAffiliation @@ -1196,6 +1215,14 @@ protected function importTeamData(array $teamData, ?string &$message, ?array &$s if (!empty($teamItem['team']['categoryid'])) { $teamCategory = $this->em->getRepository(TeamCategory::class)->findOneBy(['externalid' => $teamItem['team']['categoryid']]); + if (!$teamCategory) { + foreach ($createdCategories as $createdCategory) { + if ($createdCategory->getExternalid() === $teamItem['team']['categoryid']) { + $teamCategory = $createdCategory; + break; + } + } + } if (!$teamCategory) { $teamCategory = new TeamCategory(); $teamCategory diff --git a/webapp/templates/jury/analysis/contest_overview.html.twig b/webapp/templates/jury/analysis/contest_overview.html.twig index 1e3a70f3ed..0c0943a91e 100644 --- a/webapp/templates/jury/analysis/contest_overview.html.twig +++ b/webapp/templates/jury/analysis/contest_overview.html.twig @@ -345,6 +345,15 @@ nv.addGraph(function() { d3.select('#graph_problems svg') .datum(problem_stats) .call(chart); + // Hide bars with 0 height after rendering + chart.dispatch.on('renderEnd', function() { + d3.selectAll('#graph_problems .nv-bar').each(function(d) { + if (d.value === 0) { + d3.select(this).attr('height', 0); + d3.select(this).attr('y', chart.yAxis.scale()(0)); + } + }); + }); nv.utils.windowResize(chart.update); return chart; }); diff --git a/webapp/tests/Unit/Service/ImportExportServiceTest.php b/webapp/tests/Unit/Service/ImportExportServiceTest.php index 0146879233..e7cc24a9e5 100644 --- a/webapp/tests/Unit/Service/ImportExportServiceTest.php +++ b/webapp/tests/Unit/Service/ImportExportServiceTest.php @@ -679,6 +679,7 @@ public function testImportTeamsTsv(): void File_Version 2 11 447047 24 ¡i¡i¡ Lund University LU SWE INST-42 12 447837 25 Pleading not FAUlty Friedrich-Alexander-University Erlangen-Nuremberg FAU DEU INST-43 +13 447057 24 Another team from Lund Lund University LU SWE INST-42 EOF; $expectedTeams = [ @@ -710,6 +711,20 @@ public function testImportTeamsTsv(): void 'name' => 'Friedrich-Alexander-University Erlangen-Nuremberg', 'country' => 'DEU', ], + ], [ + 'externalid' => '13', + 'icpcid' => '447057', + 'label' => null, + 'name' => 'Another team from Lund', + 'category' => [ + 'externalid' => '24', + ], + 'affiliation' => [ + 'externalid' => '42', + 'shortname' => 'LU', + 'name' => 'Lund University', + 'country' => 'SWE', + ], ], ];