configurable artifact retention with background cleanup and dry-run CLI#728
Closed
ishitaajain22-tech wants to merge 25 commits into
Closed
configurable artifact retention with background cleanup and dry-run CLI#728ishitaajain22-tech wants to merge 25 commits into
ishitaajain22-tech wants to merge 25 commits into
Conversation
Add a newline at the end of the main.py file.
Owner
|
Closing as invalid/duplicate of the previously reviewed and closed artifact-retention PR #475. This still has failing formatting-hygiene checks and is too large/risky to merge in its current form. Please open a smaller focused PR after addressing the earlier review feedback. |
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.
Description
Adds production-grade artifact retention for scan tasks and their raw output files.
--max-age-days) and count (--max-task-count) with a status guard that never auto-purgesrunningorqueuedtasksWorkflowSchedulerpatternpython -m backend.secuscan.cli cleanup --dry-run) that reports what would be removed without touching the DB or diskretention_purge) written for every real deletion.env.exampleextended with commented-out retention knobs — all policies default to0(disabled), so existing deployments are unaffectedRelated Issues
Closes #217
Type of Change
How Has This Been Tested?
27 new unit tests added in
testing/backend/unit/test_retention.py.Run the new tests:
Run full unit suite to confirm no regressions:
Manually test dry-run CLI:
Test coverage includes:
keep_statusesguard:runningandqueuednever purged regardless of policyresult.errors, cleanup continues for remaining tasksretention_purgewritten per deleted task; not written on dry-runChecklist