Skip to content

feat: a source can name linked assets by MRN and ingestion stores their IDs - #92

Merged
mjanez merged 1 commit into
dgufrom
feature/ingest-link-mrns
Oct 15, 2026
Merged

mjanez merged 1 commit into
dgufrom
feature/ingest-link-mrns

Conversation

@mjanez

@mjanez mjanez commented Oct 9, 2026

Copy link
Copy Markdown
Member

A profile field with control: asset stores asset IDs. A connector only knows MRNs, so it could not fill one: the value was stored as text the sheet does not recognise.

  • On write, a link written as mrn://… in an asset-control field is replaced by the ID of the asset it names. An MRN that names nothing is left out. Applies to any writer (API included); plain IDs are checked as before.
  • In a run, the first pass leaves out whole any link field with an MRN that does not resolve yet (DeferLinks), so a partial value is never stored and then mistaken for a curated one. After the batch, the assets that carried MRNs are written once more, now that every target exists.
  • Ceiling, marked in the code: an asset the run finds unchanged is not revisited, so a target another source adds later is linked the next time the asset changes.

Also moves the two database tests of internal/core/asset to asset_test: pgtest reaches the package through the plugin registry, and the import cycle kept the whole package's tests from compiling.

Tests: go test ./internal/core/asset/ ./internal/core/runs/ ./internal/core/contentpack/, with and without MARMOT_TEST_POSTGRES_DSN; new TestProcessEntities_LinksByMRNAnAssetCreatedLaterInTheSameRun and TestAnMRNLinkResolvesOnceItsTargetExists.

…ir IDs

A link field written with MRNs is resolved on write; a run fills, on a second pass, the fields that named assets created later in the same batch.
@mjanez mjanez self-assigned this Oct 15, 2026
@mjanez
mjanez merged commit d6b8fe2 into dgu Oct 15, 2026
5 checks passed
@mjanez
mjanez deleted the feature/ingest-link-mrns branch October 15, 2026 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant