Tags: makeabilitylab/makeabilitylabwebsite
Tags
Fix dotted-name extension bug + recover 3 diverged talks (#1390) The 2.25.3 re-standardization renamed 210 files cleanly but errored on 3 talks (513, 528, 564) whose standardized name contains a dot ("D.C.", "Mobility.", "Dr."). Root cause: rename_artifact_in_db_and_filesystem used os.path.splitext to decide whether to append the file extension; on a dotted name it treats the text after the last dot as the "extension" and skips adding the real .pdf/.pptx. The file was renamed extension-less on disk, then generate_thumbnail_for_pdf raised "not a PDF" *before* super().save(), leaving the files moved on disk but the DB pointing at the old (now-missing) names. Fixes: - fileutils: append the original extension unless the name already ends with it (endswith), instead of the splitext check. Regression-tested with a dotted base. - artifact.save(): thumbnail generation is now non-fatal (try/except). A thumbnail error must never abort a save that has already renamed files on disk, or it re-creates this divergence. - New repair_diverged_artifact_filenames command: divergence-gated (only rows whose DB file is missing on disk), finds the orphaned file by content type (the orphan has no usable extension), renames it to the correct standardized name, repoints the DB via update(), and regenerates the thumbnail. Idempotent; runs in --dry-run at entrypoint 4.10c this release for review before the real recovery. Tested (repair, dry-run no-op, healthy-row untouched) against an isolated MEDIA_ROOT. Bump to 2.25.4. No recovery performed yet (dry-run only). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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>
Strip embedded years from Talk/Poster forum names (#1390) The standardized filename scheme doubled the year on ~41 historical talks (e.g. "...ASSETS20162016") because their forum_name still embedded the year ("ASSETS 2016"). remove_year_from_forum_name only ever processed Publications, so Talks/Posters were never cleaned. Generalize the command to Talk, Poster, and Publication. It writes via QuerySet.update() (not Model.save()) on purpose: a forum_name change alters the generated standardized filename, and save() would rename the files on disk as a side effect, which must stay under the separately gated restandardize_artifact_filenames step. update() touches only the column. Per-row changes log at INFO so they're reviewable in prod's debug.log; the command is idempotent (a cleaned name has no trailing year). restandardize_artifact_filenames stays in --dry-run this release, so once the forum names are cleaned the dry-run log shows the corrected (non-doubled) rename targets for review before any file is moved. Adds a regression test covering talks, the no-separator form, idempotency, and crucially that cleaning a forum name does NOT rename files. Bump to 2.25.2. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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>
PreviousNext