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

Exclude samples for interactive problems. #2718

Merged
merged 1 commit into from
Sep 28, 2024
Merged

Conversation

eldering
Copy link
Member

(cherry picked from commit 0cc0da0)

Copy link

sentry-io bot commented Sep 22, 2024

🔍 Existing Issues For Review

Your pull request is modifying functions with the following pre-existing issues:

📄 File: webapp/src/Service/DOMJudgeService.php

Function Unhandled Issue
App\Service\DOMJudgeService::getSamplesZipForContest Doctrine\ORM\NoResultException: No result was found for query although at least one row was expected. /src/Service/DOMJudgeService.php in...
Event Count: 2

Did you find this useful? React with a 👍 or 👎

@Kevinjil
Copy link
Contributor

Wouldn't it be nicer if we do not allow downloading a sample zip for interactive problems, instead of supplying an empty zip?

@meisterT
Copy link
Member

This code path is the overall zip with all samples, and we still include the attachments, so it is not empty.

@@ -881,7 +881,10 @@ public function getSamplesZipForContest(Contest $contest): StreamedResponse

/** @var ContestProblem $problem */
foreach ($contest->getProblems() as $problem) {
$this->addSamplesToZip($zip, $problem, $problem->getShortname());
// We don't include the samples for interactive problems.
if (!$problem->getProblem()->getCombinedRunCompare()) {
Copy link
Member

Choose a reason for hiding this comment

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

I'm apparantly in the minority here, but I don't like that we have to add a comment to explain why this function indicates that this is an interactive problem.

Can we make it a TODO to fix this in the future? Either by using a function alias or actually storing if something is interactive?

Copy link
Member

Choose a reason for hiding this comment

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

Who says you are in the minority :-)

I think it is a good idea to add a function alias.

Copy link
Member Author

Choose a reason for hiding this comment

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

I mentioned IRL that I don't like adding that alias, as it hides that under the hood this CombinedRunCompare, which I think is not necessarily exactly the same as an interactive compare script. I think it's better to leave that explicit than make an alias function look like a clean expression of the problem being an inteactive problem. OTOH, if this really 1-1 means that this is an interactive compare script and thus problem, then I think we should just rename that table column and this associated getter.

Copy link
Member

Choose a reason for hiding this comment

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

Let's address/discuss this outside of this PR.

@meisterT meisterT added this pull request to the merge queue Sep 28, 2024
Merged via the queue into main with commit 93af8d8 Sep 28, 2024
30 checks passed
@meisterT meisterT deleted the excl-interactive-samples branch September 28, 2024 10:23
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.

4 participants