Migration: clear stale Metron URLs that always 404#707
Merged
ajslater merged 2 commits intov1.11-performancefrom May 3, 2026
Merged
Migration: clear stale Metron URLs that always 404#707ajslater merged 2 commits intov1.11-performancefrom
ajslater merged 2 commits intov1.11-performancefrom
Conversation
Comicbox emitted metron.cloud/{genre,location,story,tag,role}/... URLs
for identifier types that have no public web pages on metron.cloud — only
API endpoints. Those links always 404. Drop them from existing identifier
rows so the metadata view stops surfacing broken links. Re-import will
repopulate where applicable (roles pick up the creator URL via comicbox's
computed-step fallback).
Pairs with comicbox PR #124 (ajslater/comicbox#124),
which stops generating these URLs at import time.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0039 is unreleased and already a multi-purpose data migration; tucking the Identifier.url cleanup into it keeps the v1.11 migration count unchanged. Adds _clear_stale_metron_urls() and runs it after the other data backfills. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Codex's metadata view shows clickable links for identifier tags. For Metron-sourced identifiers of types
genre,location,story,tag, andcreditrole, those URLs (e.g.https://metron.cloud/genre/3) always 404 — Metron has no public web pages for those types, only API endpoints.This adds a one-shot migration that clears the stale
urlfield on existingIdentifierrows matchingsource.name == "metron"andid_type in ("genre", "location", "story", "tag", "creditrole"). The numeric Metronkeyis preserved.Pairs with comicbox PR #124, which stops generating these URLs at import time. After that PR is released and the comicbox pin is bumped, re-import will repopulate the
urlfield where applicable (roles inherit the creator URL via comicbox's existing computed-step fallback).Verified
curl -I:genre/3,location/3,story/3,tag/3,role/3→ 404.arc/3,character/3,creator/3,imprint/3,issue/3,publisher/3,series/3,team/3,universe/3→ 301 (still good).bin/manage.py makemigrations --dry-run --check→ "No changes detected"bin/manage.py migrate --planlistscodex.0040_clear_stale_metron_urlsmake test-python→ 26 passedNotes
RunPythonwith a no-op reverse, so it's safely reversible.make lintexits non-zero on this branch (and onv1.11-performanceHEAD) due to aremarkmarkdown linter complaint about an "ignored" file — pre-existing, not related to this change. Worth investigating separately.make test(full) requiresvitestfor frontend tests, which isn't installed locally — Python tests pass cleanly.Test plan
bin/manage.py migrateagainst a dev DB that has Metron identifiers withgenre|location|story|tag|creditroleURLs and confirm the URL field clears🤖 Generated with Claude Code