Skip to content

Scripts: Add cleanup tool for expired internal submission S3 artifacts#5092

Open
RishabhJain2018 wants to merge 1 commit into
masterfrom
feature/cleanup-expired-internal-submissions
Open

Scripts: Add cleanup tool for expired internal submission S3 artifacts#5092
RishabhJain2018 wants to merge 1 commit into
masterfrom
feature/cleanup-expired-internal-submissions

Conversation

@RishabhJain2018
Copy link
Copy Markdown
Member

Summary

  • Add cleanup_expired_internal_submissions.py to delete S3 submission artifact files older than 14 days on internal challenges while preserving DB Submission rows.
  • Reuse existing S3 cleanup helpers from s3.py and artifact path discovery from jobs.s3_retention.
  • Cross-reference the new script from the existing challenge-wide S3 cleanup tool docstring.

Test plan

  • Run dry run: python scripts/tools/cleanup_data/cleanup_expired_internal_submissions.py
  • Verify only internal, non-host-credential challenges are included and cutoff uses submitted_at
  • Run scoped dry run with --challenge-ids on a known internal challenge
  • On staging, run --execute --challenge-ids <pilot> and confirm S3 objects are removed while DB rows remain

Add a dry-run-first script that deletes S3 submission files older than 14 days on internal challenges while preserving DB rows, and cross-reference it from the existing challenge-wide S3 cleanup script.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.72%. Comparing base (7d19d31) to head (b3867bf).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5092   +/-   ##
=======================================
  Coverage   91.72%   91.72%           
=======================================
  Files          96       96           
  Lines        8155     8155           
=======================================
  Hits         7480     7480           
  Misses        675      675           
Flag Coverage Δ
backend 95.20% <ø> (ø)
frontend 87.44% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Accounts & Authentication 97.31% <ø> (ø)
Challenges Management 95.52% <ø> (ø)
Job Processing 89.79% <ø> (ø)
Participants & Teams 100.00% <ø> (ø)
Challenge Hosts 100.00% <ø> (ø)
Analytics 100.00% <ø> (ø)
Web Interface 100.00% <ø> (ø)
Frontend (Gulp) 87.44% <ø> (ø)
All Models 97.80% <ø> (ø)
All Views 100.00% <ø> (ø)
All Serializers 98.60% <ø> (ø)
Utility Functions 96.67% <ø> (ø)
Core Configuration 82.35% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7d19d31...b3867bf. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant