Skip to content

Allow setting activation time in contest.yaml #1807

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

Merged
merged 8 commits into from
May 7, 2023

Conversation

vmcj
Copy link
Member

@vmcj vmcj commented Nov 14, 2022

Closes #1719

I've added some more times to the contest which might be useful. If we can expose a property but currently it's null, should we display as null or do we omit it from the response? I've now chosen to omit as that is also easier to parse for downstream clients. It's easy to crash an a missing key and fix it, but finding why you get a strange time when converting null to something else is slightly harder IMO.

@vmcj vmcj force-pushed the import_contest_activatetime branch 6 times, most recently from 5a0cc6a to 047d2ec Compare January 29, 2023 11:15
@vmcj vmcj force-pushed the import_contest_activatetime branch 2 times, most recently from b2ff378 to 318b9b9 Compare May 5, 2023 22:02
@vmcj
Copy link
Member Author

vmcj commented May 5, 2023

I had to break the import of the old import format for this, I assume we want to support that again as we also still support the TSV files?

@vmcj vmcj requested review from eldering and nickygerritsen May 5, 2023 22:03
@vmcj vmcj force-pushed the import_contest_activatetime branch from 1739ea3 to 8c24f05 Compare May 6, 2023 16:16
vmcj added 8 commits May 6, 2023 23:59
This is useful to export one contest and use that directly for import in
another instance.

Those can also be used in downstream systems to lock/unlock the client, alert that the ceremony can
start etc. Also expose relative times and absolute as that makes parsing easier.

Did not implement the activation_duration as there is no real usecase
for it.
Also add tests to check if the (de)activation time is correctly set via API.

Order based on most recent CLICS spec naming convention
@vmcj vmcj force-pushed the import_contest_activatetime branch from 764928c to 9685479 Compare May 6, 2023 22:13
@vmcj vmcj merged commit d3a9208 into DOMjudge:main May 7, 2023
@vmcj vmcj deleted the import_contest_activatetime branch May 7, 2023 12:08
@mpsijm
Copy link
Contributor

mpsijm commented May 8, 2023

Thanks for merging this! 😄

Question: since either activat{e,ion}{_,-}time is allowed as key, what is the canonical form? I would guess activation_time, but I also see deactivate_time used in the code, so asking just to be sure 🙂

@eldering
Copy link
Member

eldering commented May 8, 2023

It's (de)activate_time, see https://github.com/DOMjudge/domjudge/blob/main/webapp/src/Entity/Contest.php#L84

For most other properties you can refer to https://ccs-specs.icpc.io/draft/contest_api#interface-specification, but these are our own specification.

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.

Allow setting contest activate time via import
4 participants