Skip to content

Allow more absolute times in Contest validation. #3050

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 1 commit into from
Aug 8, 2025

Conversation

vmcj
Copy link
Member

@vmcj vmcj commented Aug 4, 2025

Multiple commits as its very easy to forget to move a single character. Did not check if the Unit tests pass yet.

We need this for the practice which we're shadowing. PC2 gives an start_time which is not valid according to us but is according to the CLICS spec.

When approved we can squash this to a single commit.

@vmcj vmcj requested a review from eldering August 4, 2025 18:48
@vmcj vmcj force-pushed the timezone_shadow branch from b17e25b to b242c30 Compare August 4, 2025 19:03
@vmcj vmcj force-pushed the timezone_shadow branch from 5ece75f to 7008407 Compare August 5, 2025 06:02
This fixes the following situation:
- Upload a valid contest either via UI or API.
- Shadow the contest and receive a valid CLICS start_time update
- In the UI we would validate the contest and consider the contest invalid.
  In the contest validation we only considered the DateTime format with timezones and not offsets
- The UI for rejudgings is now also locked as we validate the contest on multiple pages.

To make this easier to read the regex is now also extracted to separate variables. That
way it was easier to verify that our relative times are escaped correctly (+ is special for regex).

Also added some smaller parts:
 - The `+` seems optional for relative times
   See the CLICS spec: https://github.com/icpc/ccs-specs/blame/master/Contest_API.md#L235.
 - Allow also only 1 subsecond for absolute positive URLs
 - We now also allow:
     yyyy-mm-ddThh:mm:ss(.uuu)?[+-]zz(:mm)?
     besides (T instead of space between date & time)
     yyyy-mm-dd hh:mm:ss(.uuu)?[+-]zz(:mm)?
   See: https://github.com/icpc/ccs-specs/blame/master/Contest_API.md#L233
 - Allow for the Z shorthand for UTC
 - Disallow different offsets in the contest times. CLICS allows for this but we can fix this
     if there is ever a real usecase for it. We already did this for timezones.
@vmcj vmcj force-pushed the timezone_shadow branch from c2f71c4 to 5695d16 Compare August 8, 2025 08:55
@vmcj vmcj enabled auto-merge August 8, 2025 08:59
@vmcj vmcj added this pull request to the merge queue Aug 8, 2025
Merged via the queue into DOMjudge:main with commit e81837d Aug 8, 2025
36 checks passed
@vmcj vmcj deleted the timezone_shadow branch August 8, 2025 09:24
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.

2 participants