Skip to content

Conversation

@int-y1
Copy link
Contributor

@int-y1 int-y1 commented Mar 2, 2025

fixes #1767

an admin needs judge.archive_submission to archive submissions. there are 2 ways to archive a submission:

  1. go to /problem/<code>/manage/submission, turn on "Archive locked submissions", and click "Rejudge selected submissions"
    • my approach is to include locked submissions in the query, and then let Submissions.judge set is_archived to true
  2. go to /admin/judge/submission/<code>/change/ and toggle "Is archived"

user-facing changes when a submission is archived:

  • during point recalculation (e.g. /admin/judge/profile/ > Action > Recalculate scores): submission is not considered when recalculating points, problems solved, and pp
  • /user/<name>/solved: submission no longer appears in "Points breakdown" and in the problems solved table
  • /problem/<code>/rank/: submission no longer appears as a best solution
  • /submissions/ and /problem/<code>/submissions/: submission becomes partly transparent and gets an archive icon. see screenshot.

Screenshot 2025-03-02 171710

there are no admin-facing changes when a submission is archived

@codecov-commenter
Copy link

codecov-commenter commented Mar 2, 2025

Codecov Report

Attention: Patch coverage is 47.72727% with 23 lines in your changes missing coverage. Please review.

Project coverage is 47.71%. Comparing base (fd7fb05) to head (7d1ef6b).
Report is 75 commits behind head on master.

Files with missing lines Patch % Lines
judge/tasks/submission.py 22.22% 7 Missing ⚠️
judge/signals.py 37.50% 5 Missing ⚠️
judge/views/problem_manage.py 42.85% 4 Missing ⚠️
judge/admin/submission.py 33.33% 2 Missing ⚠️
judge/models/submission.py 60.00% 2 Missing ⚠️
judge/models/profile.py 0.00% 1 Missing ⚠️
judge/utils/problems.py 0.00% 1 Missing ⚠️
judge/views/user.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@ ## master #2411 +/- ## ========================================== + Coverage 46.76% 47.71% +0.94%  ========================================== Files 251 261 +10 Lines 13317 13769 +452 ========================================== + Hits 6228 6570 +342  - Misses 7089 7199 +110 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
@int-y1 int-y1 force-pushed the sub-quarantine branch 2 times, most recently from ef08bbc to 0c16d2d Compare March 2, 2025 10:44
@int-y1 int-y1 marked this pull request as ready for review March 2, 2025 11:35
@int-y1 int-y1 force-pushed the sub-quarantine branch 2 times, most recently from 4307253 to 89cdf39 Compare March 3, 2025 00:36
@int-y1 int-y1 changed the title Add field to quarantine a submission Add support for archiving a submission Mar 3, 2025
@int-y1 int-y1 force-pushed the sub-quarantine branch 2 times, most recently from 9f55d23 to 553f75e Compare March 3, 2025 01:17
@Riolku
Copy link
Contributor

Riolku commented Mar 3, 2025

Overall ty for working on this, it looks great :)

@int-y1 int-y1 force-pushed the sub-quarantine branch 2 times, most recently from 6142a3d to 692f0f3 Compare March 3, 2025 07:47
@int-y1 int-y1 requested review from Riolku and kiritofeng March 3, 2025 07:56
Copy link
Member

@Ninjaclasher Ninjaclasher left a comment

Choose a reason for hiding this comment

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

It would be nice if, in the places where we currently show locked instead of Rejudge, we give the option of Archive. Off the top of my head, this is currently in judge/admin/submission.py's judge_column, the submission row (templates/submission/row.html), and submission status/source (templates/submission/(status|source).html).

This would match the behaviour in other places (e.g. contest problem rejudge) where there is no check for is_locked and thus we go to Submission.judge and automatically archive.

Otherwise LGTM.

@int-y1
Copy link
Contributor Author

int-y1 commented Mar 4, 2025

  • allow access to "Archive locked submissions". don't put this behind the "judge.archive_submission" permission.
  • add is_archived=False to more queries
@int-y1 int-y1 force-pushed the sub-quarantine branch 3 times, most recently from a2dbc14 to 3e796de Compare March 4, 2025 08:12
@int-y1 int-y1 requested a review from Ninjaclasher March 17, 2025 02:59
Copy link
Member

@Ninjaclasher Ninjaclasher left a comment

Choose a reason for hiding this comment

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

LGTM, but given the complexity of this PR, will wait for another reviewer to approve before merging.

Copy link
Member

@quantum5 quantum5 left a comment

Choose a reason for hiding this comment

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

No issue with the code, but I don't like the overloading rejudge to also mark as archived. Why not make it a separate option?

@kiritofeng
Copy link
Member

I remember the reason we wanted "rejudge" to be "rejudge and archive" was because in most cases, you'd want to do both simultaneously.
I think a compromise solution might be to have a button for "rejudge and archive", and possibly separate buttons for "rejudge" and "mark archived"?

Thoughts? @int-y1 @quantum5 @Ninjaclasher

@int-y1
Copy link
Contributor Author

int-y1 commented Apr 11, 2025

changes:

  • rebased the migration to 0151
  • moved the archiving code from Submission.judge to Submission.archive
  • rejudge_problem_filter will determine if the submission is rejudged or archived

i didn't add a button for only "mark archived" because it's not needed yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

6 participants