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 reimport of contest & contest problems #2167

Merged
merged 2 commits into from
Apr 6, 2024
Merged

Conversation

vmcj
Copy link
Member

@vmcj vmcj commented Sep 29, 2023

This would allow having 2 contests with the same problems which is useful for the BAPC prelims where one DOMjudge instance hosts multiple contests for different locations (not to be confused with ICPC sites).

In the past the import-contest script would receive an 500 as we don't properly check if a problem with that name already exists.

This should make the import-contest idempotent.

@vmcj vmcj changed the title Allow reimport of contest problems Allow reimport of contest & contest problems Sep 29, 2023
@vmcj vmcj force-pushed the reimport_contestproblem branch from ba15c59 to 7f51165 Compare September 29, 2023 22:46
@vmcj
Copy link
Member Author

vmcj commented Sep 30, 2023

I'll add a check for this case and add an optional confirmation that it should be overwritten.

@vmcj
Copy link
Member Author

vmcj commented Oct 4, 2023

The optional compare scripts for a problem are now recreated on every upload so that should be fixed first.

We explicit check for this to recreate those with a new name, so the intent of the earlier code was to create new ones instead of overwrite.

@vmcj vmcj marked this pull request as draft October 4, 2023 17:55
vmcj added 2 commits April 5, 2024 22:33
This assume a default behaviour to always overwrite existing resources.
It would be better if we have an option argument which states if we only
want to create new, create new/update, append or recreate (so what to do
with unset keys).

Properly implementing that requires some discussion though.
Full reimport of example problems works both in datasource={0,1}
@vmcj vmcj force-pushed the reimport_contestproblem branch from 7f51165 to f6b4990 Compare April 6, 2024 09:09
@vmcj vmcj marked this pull request as ready for review April 6, 2024 09:09
@vmcj vmcj changed the base branch from main to wfluxor April 6, 2024 09:13
@vmcj vmcj merged commit 87fab52 into wfluxor Apr 6, 2024
25 checks passed
@vmcj vmcj deleted the reimport_contestproblem branch April 6, 2024 10:15
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