chore: remove disk-upload remnants after S3 cutover#2
Draft
dosaki wants to merge 1 commit into
Draft
Conversation
Strips the legacy filesystem path now that all covers live in S3 and all DB rows carry the books/ prefix: - delete app/static/uploads/ (24 baked-in book covers, now in S3) - delete scripts/migrate_uploads_to_s3.py and the entrypoint hook that invoked it (no work left to do) - drop the legacy-filename branch from app.storage.public_url so bare filenames no longer silently get a books/ prefix DO NOT MERGE until PR #1 has been merged AND the prod deploy has logged "Done. Uploaded N object(s); updated M row(s)." in CloudWatch. Merging early leaves prod with no migration ever running and the shim gone, which 404s every existing book cover. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 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.
This PR is the cleanup half of the disk-to-S3 cutover. The work it removes is load-bearing during the cutover and only safe to delete after the migration has actually run successfully in prod.
Merge gate checklist
feat: store book photos in S3 with presigned PUT uploads) has been merged.deploy.ymlhas finished and rolled out new ECS tasks.librarian-services-apitask logs (CloudWatch/ecs/librarian-services/api) include a line likeDone. Uploaded N object(s); updated M row(s).from the migration script.If any of those is unchecked, close this PR or wait — merging now leaves prod with the legacy shim gone and no migration to bring DB rows up to date.
What this removes
app/static/uploads/(24 baked-in book covers, now living in S3 underbooks/).scripts/migrate_uploads_to_s3.py— the one-shot data migration; nothing left to migrate.python scripts/migrate_uploads_to_s3.pyline inentrypoint.sh— would now be a missing-file error on container start.app.storage.public_url— once every row carriesbooks/, theif "/" not in keybranch is dead code that silently rewrites bad input. Removing it makes future bugs (e.g. a code path that accidentally setsphoto_filename = "garbage") fail loudly instead of producing a wrong-looking S3 URL.Test plan
flask runboots;/library/,/library/dashboard,/borrower/dashboard,/library/add,/library/<id>/editall render covers (resolved against MinIO or staging S3).deploy.ymlruns without themigrate_uploads_to_s3.pystep (entrypoint goes straight fromflask db upgradeto gunicorn).Base-branch note
This PR's base is
feat/s3-uploads, notmain. If PR #1 is merged via:feat/s3-uploadssurvives, this PR's base auto-tracks. Merge it next.feat/s3-uploadsis deleted; this PR's base disappears. Retarget withgh pr edit 2 --base mainfirst.🤖 Generated with Claude Code