Add an artifact-type suffix (_Talk / _Poster) to standardized filenames (#1404) - #1430
Merged
Merged
Conversation
jonfroehlich
force-pushed
the
1404-artifact-type-filename-suffix
branch
from
July 27, 2026 22:53
262ceac to
025b69b
Compare
Standardized artifact filenames gain a trailing type segment for the two types whose file is ambiguous once downloaded: a talk's exported slides and a poster generate the same Author_TitleInTitleCase_VenueYear name as the paper itself. Talks now end in "_Talk", posters in "_Poster"; publications and grants stay unsuffixed (a bare paper PDF is the default expectation, and that name is also the .bib download name). Trailing rather than the existing mid-name suffix slot, so everything before it stays byte-identical to the old scheme and the "-<timestamp>" uniquifier still appends cleanly. The label comes from a class attribute (FILENAME_TYPE_SUFFIX), not from data -- Poster has no type field and Talk.talk_type is nullable and editor-editable, so deriving it would rename files on a metadata-only edit. Applied retroactively via restandardize_artifact_filenames, which is already an idempotent every-container-start step. It ships here with --dry-run so the scope is reviewable in the logs before any file moves. The load-bearing subtlety is ordering: backfill_original_filenames runs BEFORE that step, and its "already standardized?" guard is what stops it recording a renamed file's current name as its "Originally uploaded as" provenance. The moment the scheme changed, every already-renamed talk and poster would have failed that guard and had its old standardized name written in as a fake original -- so the guard now accepts both schemes. Also extracts the uniquifier-tolerant name comparison that three commands had each copy-pasted into one tested helper (matches_standardized_basename), and teaches repair_diverged_artifact_filenames to look for orphans under the pre-#1404 base too (that bug predates the scheme change). Known and accepted: /media/talks/ and /media/posters/ 404s are answered by Apache and never reach Django, so unlike publications (which serve_pdf can redirect via the recorded original filename) external links to renamed talk/poster PDFs cannot be rescued from this repo. Tracked separately. Tests: 661 OK. New coverage for the trailing segment, per-class labels, the shared matcher, the retroactive rename of a pre-#1404 talk (pdf + raw + thumbnail) and its idempotency, publications not churning, and the backfill guard for both a legacy name and its uniquified variant. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ion note Two items from the PR review: 1. Test the legacy-base branch of repair_diverged_artifact_filenames — the one changed path with no test. An orphan left on disk under the pre-#1404 base (plain and "-<timestamp>"-uniquified) is found and repaired forward to the new-scheme name; without these, dropping the legacy_base half of the scan would silently strand old orphans. 2. The 2.29.0 version description now says this is the dry-run stage (renames inventoried in debug.log, not performed), so the admin dashboard doesn't claim a rename that hasn't happened. The stage-2 commit that removes --dry-run should restore the final wording. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
jonfroehlich
force-pushed
the
1404-artifact-type-filename-suffix
branch
from
July 28, 2026 01:22
e66d10e to
e290502
Compare
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.
Closes #1404.
What & why
A downloaded artifact file should say what it is. Today a talk's exported slides, the paper, and the poster all generate the same basename, so
Froehlich_MakingInTheHCIL_CHI2024.pdfin a Downloads folder doesn't reveal which one it is (and two of them collide into… (1).pdf).Talks now end in
_Talk, posters in_Poster. Publications and grants stay unsuffixed — a bare paper PDF is the default expectation, and that same generated name is the.bibdownload name (get_pub_filename).The four decisions from the issue
Talk/Poster, from aFILENAME_TYPE_SUFFIXclass attribute — not derived fromtalk_type.Posterhas no type field, andtalk_typeis nullable and editor-editable, so a data-derived label would rename files on a metadata-only edit.-<timestamp>uniquifier appends cleanly after it. (The existing mid-namesuffixslot is left alone.)restandardize_artifact_filenames— already an idempotent every-container-start step.The subtle part: command ordering
backfill_original_filenamesruns at entrypoint step 4.7b, before the re-standardization at 4.10b. Its "is this already standardized?" guard is what stops it recording a renamed file's current name as itsOriginally uploaded asprovenance. The momentgenerate_filenamechanged, every already-renamed talk and poster would have failed that guard and had its old standardized name written in as a fake original — corpus-wide, on the very next deploy. The guard now accepts both schemes (generate_filename(..., include_type_suffix=False)yields the pre-#1404 name).Also extracted: the
name == base or name.startswith(base + "-")comparison that three commands had each copy-pasted is now one tested helper,matches_standardized_basename. Andrepair_diverged_artifact_filenamesnow also scans for orphans under the pre-#1404 base (that bug predates this scheme change).Accepted tradeoff (verified against prod)
So external/indexed links to renamed talk and poster PDFs cannot be redirected from this repo. Publications are excluded from the suffix, so the most link-exposed, most-indexed subtree doesn't move at all. A follow-up issue asks UW CSE IT to let
/media/talks/and/media/posters/fall through to Django; after that, a redirect is easy — the pre-#1404 name is still derivable from metadata, so nothing needs storing now.Rollout — this PR is stage 1 of 3
Step 4.10b runs live on every container start, so without a gate the whole corpus would be renamed unattended on the next deploy.
--dry-run. On-test, confirmdebug.loglists only Talk/Poster rows and zero Publications.--dry-run->-testperforms the rename; verify a talk in/admin(pdf + raw + thumbnail suffixed, provenance row intact) and the public talk page's PDF link.2.29.0-> prod performs the one-time rename.Verification
matches_standardized_basenameincluding that the two schemes don't match each other, retroactive rename of a pre-Discuss: add an artifact-type suffix (Talk/Poster/Demo) to standardized filenames #1404 talk (pdf + raw + thumbnail) plus idempotency on re-run, publications not churning, and the backfill guard for both a legacy name and its-<timestamp>variant.No model changes, no migration. No UI surface changes (all links render from
pdf_file.url, so they self-heal), so no Pa11y run needed.🤖 Generated with Claude Code