Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting external contest source with contest.yaml #2208

Merged
merged 2 commits into from
Nov 7, 2023

Conversation

vmcj
Copy link
Member

@vmcj vmcj commented Nov 5, 2023

This makes it easier to setup the analyst instance during the finals.

I've done it so that we only overwrite the fields if explicit set so it is possible to remove the password from the contest and not remove it when someone updates the contest again to alter the time for example.

Closes: #2179

@@ -251,6 +252,23 @@ public function importContestData(mixed $data, ?string &$errorMessage = null, st
}

$this->em->persist($contest);

$shadow_type = $data['shadow_type'] ?? null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should document that you can do this whole thing

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, although the only users using this are us IMO.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which I agree with but I don't want to check the code to see how the fields are called. Also, maybe we use a subkey?

shadow:
  type: xxx

etc?

Also makes the code more readable.

@vmcj vmcj force-pushed the contest_shadow_config branch from 6fb24ff to ee0f25a Compare November 6, 2023 22:07
doc/manual/shadow.rst Outdated Show resolved Hide resolved
webapp/src/Service/ImportExportService.php Outdated Show resolved Hide resolved
Useful for mostly us but documented in the manual. Doing this in the API
doc is non trivial for now.

Co-authored-by: Nicky Gerritsen <[email protected]>
@vmcj vmcj force-pushed the contest_shadow_config branch from 9335b5d to 1fb4acc Compare November 7, 2023 21:55
@vmcj vmcj merged commit 66aedef into DOMjudge:main Nov 7, 2023
18 of 19 checks passed
@vmcj vmcj deleted the contest_shadow_config branch November 7, 2023 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[contest.yaml] Special fields for primary datasource when shadowing
2 participants