Skip to content

refactor(migrations): split the registry into per-topic files#2779

Merged
krlmlr merged 1 commit into
mainfrom
claude/migrations-topic-split
Jul 26, 2026
Merged

refactor(migrations): split the registry into per-topic files#2779
krlmlr merged 1 commit into
mainfrom
claude/migrations-topic-split

Conversation

@krlmlr

@krlmlr krlmlr commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Preparatory PR for the repo-wide ellipsis migration (#2757):
a single commit with the registry-split logic plus the split of the
existing migrations
, so every follow-up PR can carry it as its first commit
and rebase to a pure diff once this lands.

What this does

  • Per-topic registry files. tools/generate-migrations.R now loads every
    tools/migrations/<topic>.R file (one per topic, mirroring the R sources),
    merges the entries, and rejects duplicate declarations across files.
    A legacy tools/migrations.R is still honoured if present, easing older
    branches (e.g. refactor: snake_case attr-comb options & arguments, soft-deprecate dotted names #2742) over the transition.
  • Existing migrations move as-is: as_adjacency_matrix and
    as_biadjacency_matrix to tools/migrations/conversion.R, the test fixture
    to tools/migrations/fixture.R. The spliced ARG_HANDLE blocks are
    byte-identical (the generator run is a no-op on R/).
  • tools/migrations.R is deleted; its schema documentation moves to
    tools/migrations/README.md.
  • Two generator fixes (both found while applying the pattern at scale,
    each with a regression test):
    • a single over-long item rendered as list(, item) — syntactically valid
      but an error the moment the block runs — because paste0() turns
      character(0) into ",";
    • deparse() emits x/y where air formats x / y, failing CI's
      idempotency check for any block whose defaults contain a division;
      spaces are reinserted token-aware via getParseData(), so slashes inside
      string literals (URLs) stay untouched.
  • New unit tests for the registry loader
    (tests/testthat/test-generate-migrations.R): multi-file merging, duplicate
    rejection, empty registries, plus the two regression tests.
  • tests/testthat/helper-migrations.R, the in-sync test in
    test-migration-fixture.R, and the CI drift check
    (.github/workflows/custom/after-install) now resolve the registry via
    migration_registry_files() instead of the hard-coded single file.

Follow-ups (held until this merges)

Note

#2742 appends entries to the deleted tools/migrations.R and will conflict
trivially: its three entries just move into a topic file (the legacy file also
still loads if resurrected, so an interim merge is harmless either way).


Generated by Claude Code

Replace the single tools/migrations.R registry with per-topic files
under tools/migrations/,
so parallel migration PRs do not conflict on one file.

- tools/generate-migrations.R loads every tools/migrations/*.R file
  (a legacy tools/migrations.R is still honoured if present),
  merges the entries,
  and rejects duplicate declarations across files.
- The existing entries move as-is:
  as_adjacency_matrix and as_biadjacency_matrix
  to tools/migrations/conversion.R,
  the test fixture to tools/migrations/fixture.R.
  The spliced ARG_HANDLE blocks are byte-identical.
- The entry schema documentation moves from the deleted
  tools/migrations.R header to tools/migrations/README.md.
- Two generator fixes with regression tests:
  a single over-long item rendered as `list(, item)`
  because paste0() turns character(0) into ",",
  and deparse() emitting `x/y` where air formats `x / y`,
  which failed CI's idempotency check
  (spaces are reinserted token-aware,
  so slashes inside string literals stay untouched).
- New unit tests for the registry loader
  in tests/testthat/test-generate-migrations.R.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016M32izVHZPfxAqemAe4BrX
@krlmlr
krlmlr enabled auto-merge (squash) July 26, 2026 16:16
@krlmlr
krlmlr merged commit 0f7d122 into main Jul 26, 2026
5 of 6 checks passed
@krlmlr
krlmlr deleted the claude/migrations-topic-split branch July 26, 2026 16:22
This was referenced Jul 26, 2026
krlmlr pushed a commit that referenced this pull request Jul 26, 2026
Flattened onto the current main (post-#2779 rebase); content unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016M32izVHZPfxAqemAe4BrX
krlmlr pushed a commit that referenced this pull request Jul 26, 2026
Flattened onto the current main (post-#2779 rebase); content unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016M32izVHZPfxAqemAe4BrX
krlmlr pushed a commit that referenced this pull request Jul 26, 2026
…ular_tree()`, `make_symmetric_tree()`

Flattened onto the current main (post-#2779 rebase); content unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016M32izVHZPfxAqemAe4BrX
krlmlr pushed a commit that referenced this pull request Jul 26, 2026
Flattened onto the current main (post-#2779 rebase); content unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016M32izVHZPfxAqemAe4BrX
krlmlr pushed a commit that referenced this pull request Jul 26, 2026
Flattened onto the current main (post-#2779 rebase); content unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016M32izVHZPfxAqemAe4BrX
krlmlr pushed a commit that referenced this pull request Jul 26, 2026
Flattened onto the current main (post-#2779 rebase); content unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016M32izVHZPfxAqemAe4BrX
krlmlr pushed a commit that referenced this pull request Jul 26, 2026
Flattened onto the current main (post-#2779 rebase); content unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016M32izVHZPfxAqemAe4BrX
krlmlr pushed a commit that referenced this pull request Jul 26, 2026
Flattened onto the current main (post-#2779 rebase); content unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016M32izVHZPfxAqemAe4BrX
krlmlr pushed a commit that referenced this pull request Jul 26, 2026
Flattened onto the current main (post-#2779 rebase); content unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016M32izVHZPfxAqemAe4BrX
krlmlr pushed a commit that referenced this pull request Jul 26, 2026
Resolve the modify/delete conflict on tools/migrations.R
(deleted on main by #2779):
the three attr-comb entries move to tools/migrations/attr-comb.R,
and the ARG_HANDLE blocks are regenerated with the current generator.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016M32izVHZPfxAqemAe4BrX
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.

2 participants