Skip to content

Commit 8f6dd9a

Browse files
jonfroehlichclaude
andcommitted
Perform the legacy-filename re-standardization on prod (#1390)
Remove --dry-run from entrypoint step 4.10b so restandardize_artifact_filenames actually renames the ~213 historical talk/poster/publication files to the standardized Author_TitleInTitleCase_VenueYear scheme. This follows two diagnostic dry-runs (2.25.1/2.25.2) and the forum-name cleanup that removed the doubled-year artifacts; the reviewed prod dry-run was clean (0 errors, 0 doubled years, no real collisions, longest path 240<255). Provenance was captured by #1391, so original upload names are preserved and stale publication links still resolve via the serve_pdf original_pdf_filename fallback. Also elevate the per-rename log line from DEBUG to INFO so the one-time backfill leaves a per-file audit trail in prod's (INFO-level) debug.log. The step is idempotent, so once rows are standardized this goes silent on later deploys. Bump to 2.25.3. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 75f8c8e commit 8f6dd9a

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

docker-entrypoint.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,7 @@ 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-
# 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
169+
python manage.py restandardize_artifact_filenames
173170

174171
# echo "****************** STEP 4.3/5: docker-entrypoint.sh ************************"
175172
# 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.2" # Keep this updated with each release and also change the short description below
90-
ML_WEBSITE_VERSION_DESCRIPTION = "Prep release for the legacy-filename re-standardization (#1390). Normalizes Talk and Poster forum names by stripping an embedded trailing year (e.g. 'ASSETS 2016' becomes 'ASSETS'), which previously only ran on publications; this is why some standardized filenames doubled the year (e.g. '...ASSETS20162016'). The cleanup writes only the forum_name field (never renaming files), so the file re-standardization stays gated and continues to run in --dry-run mode in this release. No files are renamed in this release; the venue label shown on affected talk pages now omits the year (the date is shown separately, matching publications)."
89+
ML_WEBSITE_VERSION = "2.25.3" # Keep this updated with each release and also change the short description below
90+
ML_WEBSITE_VERSION_DESCRIPTION = "Performs the legacy-filename re-standardization (#1390). After two diagnostic dry-runs and a forum-name cleanup (2.25.1/2.25.2), this release renames the ~213 historical talk/poster/publication files that were never converted to the standardized Author_TitleInTitleCase_VenueYear scheme (bulk-imported rows that never went through an authored save). The original uploaded names were already captured (#1391), so provenance is preserved and stale publication links still resolve via the serve_pdf fallback. Each rename is logged to debug.log; the step is idempotent, so subsequent deploys are no-ops."
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
@@ -136,7 +136,11 @@ def _restandardize_row(self, artifact, dry_run):
136136
# untouched (it only captures on a new upload, not a no-update_fields
137137
# save), so the provenance recorded by #1391 is preserved.
138138
artifact.save()
139-
_logger.debug(
139+
# INFO (not DEBUG) so the real rename is captured on prod, giving a
140+
# per-file audit trail of the one-time backfill. Idempotent: once a row
141+
# is standardized it stops matching, so this stays silent on later
142+
# deploys rather than logging every artifact forever.
143+
_logger.info(
140144
f"Re-standardized {model_name} id={artifact.pk} to "
141145
f"'{Artifact.generate_filename(artifact)}'."
142146
)

0 commit comments

Comments
 (0)