purge_s3_keys.py script updates - #13302
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the scripts/purge_s3_keys.py maintenance script to report how many records were updated before the script exits, including when a graceful shutdown is requested. This helps operators understand progress without needing to rerun a long-running “find affected accounts” query.
Changes:
- Introduces an
updated_countvariable intended to track successful updates. - Prints “Records updated this session: …” on normal completion and on shutdown-request termination.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
jimchamp
force-pushed
the
purged-key-counts
branch
from
August 10, 2026 22:52
7a681c8 to
439894b
Compare
jimchamp
commented
Aug 10, 2026
jimchamp
marked this pull request as draft
August 10, 2026 23:46
jimchamp
force-pushed
the
purged-key-counts
branch
from
August 11, 2026 00:07
439894b to
c89e33f
Compare
purge_s3_keys.py script terminationpurge_s3_keys.py script execution
jimchamp
marked this pull request as ready for review
August 11, 2026 00:16
purge_s3_keys.py script executionpurge_s3_keys.py script updates
jimchamp
commented
Aug 11, 2026
Co-authored-by: jimchamp <28732543+jimchamp@users.noreply.github.com>
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.
Updates
purge_s3_keys.pyin the following ways:The query to find all affected accounts takes over an hour to run, so the printing the number of updated records will help us determine the number of remaining records w/o the need to wait so long for results.
The default query timeout is too short for the affected keys query, which takes less than 3 minutes currently. I wouldn't be surprised if this query takes longer as more records are updated, so I've set the timeout to 7.5 minutes.
Technical
Testing
Screenshot
Stakeholders