fix: make evaluation/submission delete a soft delete with revoke - #243
Merged
Conversation
Hard-deleting evaluations/submissions from the admin UI was irreversible. Add a deleted_at timestamp column to both Submission and EvaluationRun; DELETE now sets deleted_at instead of removing the row (and, for submissions, cancels its queued jobs), and new POST .../revoke endpoints clear deleted_at to restore a row. The public /api/leaderboard endpoint excludes deleted_at rows by default (so deleting a submission still removes it from the public standings), while the admin leaderboard endpoint passes include_deleted=True so deleted rows stay visible there with a Revoke action. GET /api/admin/evaluations already returned all rows regardless of deleted_at, so no change needed there beyond exposing the field. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
deleted_attimestamp column toSubmissionandEvaluationRun.DELETE /api/admin/evaluations/{id}andDELETE /api/admin/submissions/{id}now setdeleted_atinstead of hard-deleting the row (submission delete also cancels its queued jobs via the existingcancel_submission_jobshelper).POST /api/admin/evaluations/{id}/revokeandPOST /api/admin/submissions/{id}/revokecleardeleted_atto restore a row./api/leaderboardexcludesdeleted_atrows by default (so a deleted submission still disappears from public standings); admin leaderboard passesinclude_deleted=Trueso deleted rows stay visible there for revoking.mini-router.github.ioadds the Revoke button and visual "deleted" state to the admin UI.Test plan
pytestpasses (19 passed, 18 skipped)GET /evaluationswithdeleted_atset → revoke →deleted_atclears/api/leaderboard(public) but still present in/api/admin/leaderboardwithdeleted_atset → revoke → reappears in public leaderboard