Skip to content

Task Order 1: PR05 - Layer Fixture Import Framework - #33

Open
rhodges wants to merge 4 commits into
to1_lyr_migratefrom
to1_pr05_import_plan
Open

Task Order 1: PR05 - Layer Fixture Import Framework#33
rhodges wants to merge 4 commits into
to1_lyr_migratefrom
to1_pr05_import_plan

Conversation

@rhodges

@rhodges rhodges commented Aug 13, 2026

Copy link
Copy Markdown
Member

PR05 Changelog

Summary

This PR introduces the initial fixture import engine for layer-focused imports using UUID-first identity semantics, with strict validation behavior and root-agnostic graph processing foundations for upcoming PR06/PR07/PR09 work.

What Changed

  • Added importer implementation in layers/fixture_import.py.
  • Implemented UUID-first upsert for layers.layer rows:
    • Update existing records when UUID matches.
    • Create new records when UUID differs, even if source PK collides.
  • Implemented strict duplicate UUID conflict detection:
    • Conflicting rows with same (model, uuid) raise ValueError.
  • Implemented strict missing-reference validation:
    • Missing or unresolved UUID refs raise ValueError under current strict policy.
  • Implemented two-pass relation handling:
    • Pass 1 imports/upserts layer records.
    • Pass 2 resolves and imports layers.multilayerassociation relationships by UUID.
  • Applied unscoped manager lookups (all_objects / base manager) for identity resolution to avoid site-scoping false misses.
  • Ensured site association behavior under associate_all_sites=True for both new and updated imported layers.
  • Kept and wired helper entrypoints for phased rollout:
    • import_layer_rows
    • import_multilayer_rows
    • import_theme_rows

Test Coverage

  • UUID-match update with differing source PK.
  • Source PK collision with differing UUID creates a new row.
  • Relation resolution by UUID (not source PK) for multilayer association linkage.
  • New imported layers associated to all sites by default.
  • Duplicate UUID conflict handling raises error.
  • Missing relation UUID handling raises error under strict policy.
  • Tests live in layers/tests/test_fixture_import.py, and the PR05 test set is passing.

Notes

This PR intentionally focuses on PR05 scope (layer import core + strict graph validation primitives). Broader multilayer dimension/value and theme import semantics are left for the planned follow-on PRs.

@rhodges rhodges self-assigned this Aug 13, 2026
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