Add explorer S3 cleanup GitHub Action and clean-explorer-bucket CLI flags (#280)#333
Open
Add explorer S3 cleanup GitHub Action and clean-explorer-bucket CLI flags (#280)#333
Conversation
…ractive/--dry-run (#280) Made-with: Cursor
✅ Deploy Preview for oeps canceled.
|
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
Implements issue #280: run explorer map CSV cleanup from GitHub (manual trigger) using the same rules as
flask clean-explorer-bucket, and make the command safe for CI.Changes
.github/workflows/clean_explorer_s3.yml:workflow_dispatchonly; optional dry run input; runsflask clean-explorer-bucket --non-interactive(or with--dry-run). Uses the same AWS secrets as other workflows (AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AWS_BUCKET_NAME,AWS_REGION).clear_s3_bucket(backend/oeps/clients/s3.py):dry_runmode (print keys, no delete); safer default forobjs_to_keep.clean-explorer-bucket(backend/oeps/commands/clean_explorer_bucket.py):--non-interactive(fail ifexplorer/config/sources.jsonis missing—noinput()hang in Actions);--dry-run; docstring path fixed toexplorer/config/sources.json.CHANGELOG.md: documents Implement S3 bucket cleanup as github action #280 (and other existing[Unreleased]bullets per current file).How to test
From
backend/withFLASK_APP=oeps:pip install -e . flask clean-explorer-bucket --non-interactive --dry-runConfirm it lists Would delete … lines and exits 0.
Without credentials, expect boto/S3 errors—that only proves AWS isn’t configured.
Point --explorer-path at a folder with no config/sources.json:
flask clean-explorer-bucket --non-interactive --explorer-path /path/to/empty-explorer-rootShould exit with an error and not prompt.
Actions → Clean explorer S3 bucket → Run workflow; try dry run first, then a real run if the log looks correct.
Closes
Closes #280.