Skip to content

Migration: clear stale Metron URLs that always 404#707

Merged
ajslater merged 2 commits intov1.11-performancefrom
claude/eager-ardinghelli-834bf6
May 3, 2026
Merged

Migration: clear stale Metron URLs that always 404#707
ajslater merged 2 commits intov1.11-performancefrom
claude/eager-ardinghelli-834bf6

Conversation

@ajslater
Copy link
Copy Markdown
Owner

@ajslater ajslater commented May 3, 2026

Summary

Codex's metadata view shows clickable links for identifier tags. For Metron-sourced identifiers of types genre, location, story, tag, and creditrole, 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 url field on existing Identifier rows matching source.name == "metron" and id_type in ("genre", "location", "story", "tag", "creditrole"). The numeric Metron key is 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 url field where applicable (roles inherit the creator URL via comicbox's existing computed-step fallback).

Verified

  • Confirmed paths 404 with 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).
  • Cross-referenced with Metron's URL router — only the 9 working types have routes.
  • bin/manage.py makemigrations --dry-run --check → "No changes detected"
  • bin/manage.py migrate --plan lists codex.0040_clear_stale_metron_urls
  • make test-python → 26 passed

Notes

  • The migration uses RunPython with a no-op reverse, so it's safely reversible.
  • make lint exits non-zero on this branch (and on v1.11-performance HEAD) due to a remark markdown linter complaint about an "ignored" file — pre-existing, not related to this change. Worth investigating separately.
  • make test (full) requires vitest for frontend tests, which isn't installed locally — Python tests pass cleanly.

Test plan

  • Run bin/manage.py migrate against a dev DB that has Metron identifiers with genre|location|story|tag|creditrole URLs and confirm the URL field clears
  • Confirm the metadata view no longer renders broken Metron link icons for those tag types
  • After bumping comicbox to a release containing PR v0.9.7 #124, re-import a comic and confirm role identifiers get the creator URL fallback (and the other types stay URL-less)

🤖 Generated with Claude Code

ajslater and others added 2 commits May 2, 2026 17:42
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>
@ajslater ajslater merged commit c3f68a3 into v1.11-performance May 3, 2026
1 check failed
@ajslater ajslater deleted the claude/eager-ardinghelli-834bf6 branch May 4, 2026 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant