Skip to content

Commit

Permalink
Merge branch '8.3.1.1' into domjudge_ds
Browse files Browse the repository at this point in the history
  • Loading branch information
as6325400 committed Sep 21, 2024
2 parents 8bb8688 + 3324986 commit f94e011
Show file tree
Hide file tree
Showing 24 changed files with 64 additions and 171 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/autoconf-check-different-distro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
image: ${{ matrix.os }}:${{ matrix.version }}
steps:
- name: Install git so we get the .github directory
run: dnf install -y git
run: dnf install -y git composer
- uses: actions/checkout@v4
- name: Setup image and run bats tests
run: .github/jobs/configure-checks/setup_configure_image.sh
2 changes: 1 addition & 1 deletion .github/workflows/autoconf-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
image: ${{ matrix.os }}:${{ matrix.version }}
steps:
- name: Install git so we get the .github directory
run: apt-get update; apt-get install -y git
run: apt-get update; apt-get install -y git composer
- uses: actions/checkout@v4
- name: Setup image and run bats tests
run: .github/jobs/configure-checks/setup_configure_image.sh
93 changes: 0 additions & 93 deletions .github/workflows/mayhem-api-template.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .github/workflows/mayhem-daily.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/mayhem-weekly.yml

This file was deleted.

5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
DOMjudge Programming Contest Judging System

Version 8.3.1 - 13 September 2024
---------------------------------
- Create autoload_runtime.php as normal user to prevent a composer warning.
- Fix saving new problems with problem statement from web UI.

Version 8.3.0 - 31 May 2024
---------------------------
- [security] Close metadata file descriptor for the child in runguard.
Expand Down
14 changes: 4 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ endif
domserver: domserver-configure paths.mk config
judgehost: judgehost-configure paths.mk config
docs: paths.mk config
install-domserver: domserver composer-dump-autoload domserver-create-dirs
install-domserver: domserver domserver-create-dirs
install-judgehost: judgehost judgehost-create-dirs
install-docs: docs-create-dirs
dist: configure composer-dependencies
Expand Down Expand Up @@ -76,12 +76,6 @@ endif
composer-dependencies-dev:
composer $(subst 1,-q,$(QUIET)) install --prefer-dist --no-scripts --no-plugins

# Dump autoload dependencies (including plugins)
# This is needed since symfony/runtime is a Composer plugin that runs while dumping
# the autoload file
composer-dump-autoload:
composer $(subst 1,-q,$(QUIET)) dump-autoload -o -a

composer-dump-autoload-dev:
composer $(subst 1,-q,$(QUIET)) dump-autoload

Expand All @@ -101,7 +95,7 @@ build-scripts:

# List of SUBDIRS for recursive targets:
build: SUBDIRS= lib misc-tools
domserver: SUBDIRS=etc sql misc-tools webapp
domserver: SUBDIRS=etc lib sql misc-tools webapp
install-domserver: SUBDIRS=etc lib sql misc-tools webapp example_problems
judgehost: SUBDIRS=etc judge misc-tools
install-judgehost: SUBDIRS=etc lib judge misc-tools
Expand Down Expand Up @@ -222,7 +216,7 @@ webapp/.env.local:
# symlinks where necessary to let it work from the source tree.
# This stuff is a hack!
maintainer-install: inplace-install composer-dump-autoload-dev
inplace-install: build composer-dump-autoload domserver-create-dirs judgehost-create-dirs
inplace-install: build domserver-create-dirs judgehost-create-dirs
inplace-install-l:
# Replace libjudgedir with symlink to prevent lots of symlinks:
-rmdir $(judgehost_libjudgedir)
Expand Down Expand Up @@ -341,5 +335,5 @@ clean-autoconf:
$(addprefix inplace-,conf conf-common install uninstall) \
$(addprefix maintainer-,conf install) clean-autoconf config distdocs \
composer-dependencies composer-dependencies-dev \
composer-dump-autoload composer-dump-autoload-dev \
composer-dump-autoload-dev \
coverity-conf coverity-build
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DOMjudge
[![Coverity Scan Status](https://img.shields.io/coverity/scan/671.svg)](https://scan.coverity.com/projects/domjudge)
[![CodeQL alerts](https://github.com/DOMjudge/domjudge/actions/workflows/codeql-analysis.yml/badge.svg?branch=main&event=push)](https://github.com/DOMjudge/domjudge/actions/workflows/codeql-analysis.yml)

This is the Programming Contest Jury System "DOMjudge" version 8.3.0
This is the Programming Contest Jury System "DOMjudge" version 8.3.1

DOMjudge is a system for running a programming contest, like the
ICPC regional and world championship programming contests.
Expand Down
1 change: 0 additions & 1 deletion gitlab/ci/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
- /bin/true
services:
- name: mysql
command: ["--mysql-native-password", "--authentication_policy=mysql_native_password"]
alias: sqlserver

.mariadb_job:
Expand Down
5 changes: 5 additions & 0 deletions lib/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
ifndef TOPDIR
TOPDIR=..
endif

REC_TARGETS = domserver

include $(TOPDIR)/Makefile.global

OBJECTS = $(addsuffix $(OBJEXT),lib.error lib.misc)
Expand Down Expand Up @@ -31,3 +34,5 @@ install-domserver:
install-judgehost:
$(INSTALL_DATA) -t $(DESTDIR)$(judgehost_libdir) *.php *.sh
$(INSTALL_PROG) -t $(DESTDIR)$(judgehost_libdir) alert

domserver: SUBDIRS=vendor
12 changes: 12 additions & 0 deletions lib/vendor/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ifndef TOPDIR
TOPDIR=../..
endif
include $(TOPDIR)/Makefile.global

clean-l:
rm -f autoload_runtime.php

autoload_runtime.php:
composer $(subst 1,-q,$(QUIET)) dump-autoload -o -a -d $(TOPDIR)

domserver: autoload_runtime.php
4 changes: 2 additions & 2 deletions misc-tools/import-contest.in
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ if import_file('organizations', ['organizations.json']):
# Also import logos if we have any
# We prefer the 64x64 logo. If it doesn't exist, accept a generic logo (which might be a SVG)
# We also prefer PNG/SVG before JPG
import_images('organizations', 'logo', ['^logo\.64x\d+\.png$', '^logo\.(png|svg)$', '^logo\.64x\d+\.jpg$', '^logo\.jpg$'])
import_images('organizations', 'logo', ['^logo\\.64x\\d+\\.png$', '^logo\\.(png|svg)$', '^logo\\.64x\\d+\\.jpg$', '^logo\\.jpg$'])
if import_file('teams', ['teams.json', 'teams2.tsv']):
# Also import photos if we have any, but prefer JPG over SVG and PNG
import_images('teams', 'photo', ['^photo\.jpg$', '^photo\.(png|svg)$'])
import_images('teams', 'photo', ['^photo\\.jpg$', '^photo\\.(png|svg)$'])
import_file('accounts', ['accounts.json', 'accounts.yaml', 'accounts.tsv'])

problems_imported = False
Expand Down
1 change: 0 additions & 1 deletion webapp/src/Controller/Jury/ProblemController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,6 @@ public function addAction(Request $request): Response
$form->handleRequest($request);

if ($form->isSubmitted() && $form->isValid()) {
$this->em->persist($problem);
$this->saveEntity($this->em, $this->eventLogService, $this->dj, $problem, null, true);
return $this->redirectToRoute('jury_problem', ['probId' => $problem->getProbid()]);
}
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/Controller/Jury/TeamCategoryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ public function requestRemainingRunsWholeTeamCategoryAction(string $categoryId):
->join('t.category', 'tc')
->andWhere('j.valid = true')
->andWhere('j.result != :compiler_error')
->andWhere('tc.category = :categoryId')
->andWhere('tc.categoryid = :categoryId')
->setParameter('compiler_error', 'compiler-error')
->setParameter('categoryId', $categoryId);
if ($contestId > -1) {
Expand Down
8 changes: 2 additions & 6 deletions webapp/src/Controller/Team/MiscController.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,10 @@ public function homeAction(Request $request): Response
$clarifications = $this->em->createQueryBuilder()
->from(Clarification::class, 'c')
->leftJoin('c.problem', 'p')
->leftJoin('p.contest_problems', 'cp')
->leftJoin('c.sender', 's')
->leftJoin('c.recipient', 'r')
->select('c', 'cp', 'p')
->select('c', 'p')
->andWhere('c.contest = :contest')
->andWhere('cp.contest = :contest')
->andWhere('c.sender IS NULL')
->andWhere('c.recipient = :team OR c.recipient IS NULL')
->setParameter('contest', $contest)
Expand All @@ -114,12 +112,10 @@ public function homeAction(Request $request): Response
$clarificationRequests = $this->em->createQueryBuilder()
->from(Clarification::class, 'c')
->leftJoin('c.problem', 'p')
->leftJoin('p.contest_problems', 'cp')
->leftJoin('c.sender', 's')
->leftJoin('c.recipient', 'r')
->select('c', 'cp', 'p')
->select('c', 'p')
->andWhere('c.contest = :contest')
->andWhere('cp.contest = :contest')
->andWhere('c.sender = :team')
->setParameter('contest', $contest)
->setParameter('team', $team)
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/DataTransferObject/Shadowing/ProblemEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class ProblemEvent implements EventData
public function __construct(
public readonly string $id,
public readonly string $name,
public readonly int $timeLimit,
public readonly float $timeLimit,
public readonly ?string $label,
public readonly ?string $rgb,
) {}
Expand Down
8 changes: 8 additions & 0 deletions webapp/src/Entity/Clarification.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,14 @@ public function getProblem(): ?Problem
return $this->problem;
}

public function getContestProblem(): ?ContestProblem
{
if (!$this->problem) {
return null;
}
return $this->contest->getContestProblem($this->problem);
}

#[OA\Property(nullable: true)]
#[Serializer\VirtualProperty]
#[Serializer\SerializedName('problem_id')]
Expand Down
10 changes: 10 additions & 0 deletions webapp/src/Entity/Contest.php
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,16 @@ public function getProblems(): Collection
return $this->problems;
}

public function getContestProblem(Problem $problem): ?ContestProblem
{
foreach ($this->getProblems() as $contestProblem) {
if ($contestProblem->getProblem() === $problem) {
return $contestProblem;
}
}
return null;
}

public function addClarification(Clarification $clarification): Contest
{
$this->clarifications[] = $clarification;
Expand Down
13 changes: 5 additions & 8 deletions webapp/src/Twig/TwigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function getFilters(): array
new TwigFilter('tsvField', $this->toTsvField(...)),
new TwigFilter('fileTypeIcon', $this->fileTypeIcon(...)),
new TwigFilter('problemBadge', $this->problemBadge(...), ['is_safe' => ['html']]),
new TwigFilter('problemBadgeForProblemAndContest', $this->problemBadgeForProblemAndContest(...), ['is_safe' => ['html']]),
new TwigFilter('problemBadgeForContest', $this->problemBadgeForContest(...), ['is_safe' => ['html']]),
new TwigFilter('printMetadata', $this->printMetadata(...), ['is_safe' => ['html']]),
new TwigFilter('printWarningContent', $this->printWarningContent(...), ['is_safe' => ['html']]),
new TwigFilter('entityIdBadge', $this->entityIdBadge(...), ['is_safe' => ['html']]),
Expand Down Expand Up @@ -1093,14 +1093,11 @@ public function problemBadge(ContestProblem $problem): string
);
}

public function problemBadgeForProblemAndContest(Problem $problem, ?Contest $contest): string
public function problemBadgeForContest(Problem $problem, ?Contest $contest = null): string
{
foreach ($problem->getContestProblems() as $contestProblem) {
if ($contestProblem->getContest() === $contest) {
return $this->problemBadge($contestProblem);
}
}
return '';
$contest ??= $this->dj->getCurrentContest();
$contestProblem = $contest?->getContestProblem($problem);
return $contestProblem === null ? '' : $this->problemBadge($contestProblem);
}

public function printMetadata(?string $metadata): string
Expand Down
Loading

0 comments on commit f94e011

Please sign in to comment.