Skip to content

Commit fd3fbc3

Browse files
jonfroehlichclaude
andcommitted
Dry-run the legacy-filename re-standardization on prod (#1390)
Run entrypoint step 4.10b (restandardize_artifact_filenames) with --dry-run so it logs exactly which historical talk/poster/publication files it WOULD rename, without touching disk or the DB. This lets us review the prod rename set in debug.log before performing the rename for real. The per-row "[dry-run] Would re-standardize ..." line is elevated from DEBUG to INFO so it is captured on prod, where the file log handler runs at INFO when DEBUG is off (otherwise we'd only get the summary counts, not the file list). Bump to 2.25.1. No files are renamed in this release. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 7dde3f0 commit fd3fbc3

3 files changed

Lines changed: 11 additions & 4 deletions

File tree

docker-entrypoint.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,10 @@ python manage.py setup_admin_groups
166166
echo "****************** STEP 4.10b/5: docker-entrypoint.sh ************************"
167167
echo "4.10b Running 'python manage.py restandardize_artifact_filenames' to rename legacy talk/poster/pub files to the standardized scheme (#1401)"
168168
echo "******************************************"
169-
python manage.py restandardize_artifact_filenames
169+
# TEMPORARY (#1390): --dry-run only logs what WOULD be renamed, touching nothing
170+
# on disk or in the DB, so we can review the exact prod rename set in debug.log
171+
# before doing it for real. REMOVE --dry-run and redeploy to perform the rename.
172+
python manage.py restandardize_artifact_filenames --dry-run
170173

171174
# echo "****************** STEP 4.3/5: docker-entrypoint.sh ************************"
172175
# echo "4.3 Running 'python manage.py rename_person_images' to rename person images"

makeabilitylab/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@
8686
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
8787

8888
# Makeability Lab Global Variables, including Makeability Lab version
89-
ML_WEBSITE_VERSION = "2.25.0" # Keep this updated with each release and also change the short description below
90-
ML_WEBSITE_VERSION_DESCRIPTION = "This release records the original uploaded filename of talk, poster, and publication files and shows it (admin-only) on the change form (#1391). When an editor uploads a file, the site renames it to a standardized Author_Title_VenueYear scheme, which previously discarded the human-recognizable upload name (e.g. MyTalk_v3_final.pptx). We now capture that original name and display it read-only as 'Originally uploaded as …' so editors have a provenance breadcrumb for confirming or debugging which file was attached. A one-time backfill also recovers the original names for the many historical talks and posters whose files were never renamed."
89+
ML_WEBSITE_VERSION = "2.25.1" # Keep this updated with each release and also change the short description below
90+
ML_WEBSITE_VERSION_DESCRIPTION = "Diagnostic release for the legacy-filename re-standardization (#1390/#1401). The re-standardization step (entrypoint 4.10b) runs in --dry-run mode only: it logs to debug.log exactly which historical talk/poster/publication files it WOULD rename to the standardized Author_Title_VenueYear scheme, without touching disk or the database, so we can review the prod rename set before doing it for real. Also ships the hardened original-filename backfill (#1402), which makes the #1391 provenance capture resilient to per-row failures. No files are renamed in this release."
9191
DATE_MAKEABILITYLAB_FORMED = datetime.date(2012, 1, 1) # Date Makeability Lab was formed
9292
MAX_BANNERS = 7 # Maximum number of banners on a page
9393

website/management/commands/restandardize_artifact_filenames.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,11 @@ def _restandardize_row(self, artifact, dry_run):
120120

121121
if dry_run:
122122
new_name = Artifact.generate_filename(artifact)
123-
_logger.debug(
123+
# Log the per-row preview at INFO (not DEBUG) so it is captured on
124+
# prod, where the file handler logs at INFO when DEBUG is off. This
125+
# is what makes the dry-run reviewable in prod's debug.log. The real
126+
# (non-dry-run) path below stays at DEBUG to avoid noise.
127+
_logger.info(
124128
f"[dry-run] Would re-standardize {model_name} id={artifact.pk} "
125129
f"to '{new_name}' (pdf='{artifact.pdf_file.name if artifact.pdf_file else None}', "
126130
f"raw='{artifact.raw_file.name if artifact.raw_file else None}')"

0 commit comments

Comments
 (0)