Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
path: webapp/src webapp/tests
php_extensions: gd intl mysqli pcntl zip
autoload_file: webapp/vendor/autoload.php
version: composer
- uses: actions/upload-artifact@v4
if: always()
with:
Expand Down
6 changes: 4 additions & 2 deletions webapp/src/Command/ImportEventFeedCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,12 @@ protected function compareContestId(): bool
$ourId = $contest->getExternalid();
$theirId = $this->sourceService->getContestId();
if ($ourId !== $theirId) {
$this->style->error(
$this->style->warning(
"Contest ID in external system $theirId does not match external ID in DOMjudge ($ourId)."
);
return false;
if (!$this->style->confirm('Do you want to continue anyway?', default: false)) {
return false;
}
}

return true;
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/DataTransferObject/ApiInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
class ApiInfo
{
public function __construct(
public readonly string $version,
public readonly string $versionUrl,
public readonly ?string $version,
public readonly ?string $versionUrl,
public readonly string $name,
public readonly ?ApiInfoProvider $provider,
#[Serializer\Exclude(if: '!object.domjudge')]
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 float $timeLimit,
public readonly ?float $timeLimit,
public readonly ?string $label,
public readonly ?string $rgb,
) {}
Expand Down
10 changes: 9 additions & 1 deletion webapp/src/Service/ExternalContestSourceService.php
Original file line number Diff line number Diff line change
Expand Up @@ -1027,9 +1027,12 @@ protected function validateAndUpdateProblem(Event $event, EventData $data): void

$toCheckProblem = [
'name' => $data->name,
'timelimit' => $data->timeLimit,
];

if ($data->timeLimit) {
$toCheckProblem['timelimit'] = $data->timeLimit;
}

if ($contestProblem->getShortname() !== $data->label) {
$this->logger->warning(
'Contest problem short name does not match between feed (%s) and local (%s), updating',
Expand Down Expand Up @@ -1097,7 +1100,10 @@ protected function validateAndUpdateTeam(Event $event, EventData $data): void
if (!empty($data->organizationId)) {
$affiliation = $this->em->getRepository(TeamAffiliation::class)->findOneBy(['externalid' => $data->organizationId]);
if (!$affiliation) {
// Affiliation does not exist. Create one with a dummy name so we can continue.
$affiliation = new TeamAffiliation();
$affiliation->setName($data->organizationId);
$affiliation->setShortname(substr($data->organizationId, 0, 32));
$this->em->persist($affiliation);
}
$team->setAffiliation($affiliation);
Expand All @@ -1106,7 +1112,9 @@ protected function validateAndUpdateTeam(Event $event, EventData $data): void
if (!empty($data->groupIds[0])) {
$category = $this->em->getRepository(TeamCategory::class)->findOneBy(['externalid' => $data->groupIds[0]]);
if (!$category) {
// Category does not exist. Create one with a dummy name so we can continue.
$category = new TeamCategory();
$category->setName($data->groupIds[0]);
$this->em->persist($category);
}
$team->setCategory($category);
Expand Down
Loading