Skip to content

add MCF migration support#352

Merged
tomkralidis merged 3 commits into
masterfrom
migrations
Jul 3, 2026
Merged

add MCF migration support#352
tomkralidis merged 3 commits into
masterfrom
migrations

Conversation

@tomkralidis

Copy link
Copy Markdown
Member

As discussed at FOSS4G Europe 2026, this PR adds the ability to migrate MCFs (currently supporting 1.0 -> 2.0) via CLI or library mode.

@pvgenuchten

pvgenuchten commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

What about adding as a optional parameter on export: “migrate first if needed”

Also, what happens if one calls migrate on a record which is already migrated?

@tomkralidis

Copy link
Copy Markdown
Member Author

What about adding as a optional parameter on export: “migrate first if needed”

Not sure. May be cleaner to keep concerns / workflows separate in that regard?

@pvgenuchten pvgenuchten left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

migrate_from_1_0, consider to add from-version and to-version in method name, so when migrating from 2.1 to 2.3 can involve 2 migrations.
First 2.1-2.2, then 2.2-2.3

@pvgenuchten

Copy link
Copy Markdown
Contributor

Not sure. May be cleaner to keep concerns / workflows separate in that regard?

Problem is that record export will fail if record is not migrated, maybe fail on export, indicating to migrate record first?

@tomkralidis

Copy link
Copy Markdown
Member Author

Not sure. May be cleaner to keep concerns / workflows separate in that regard?

Problem is that record export will fail if record is not migrated, maybe fail on export, indicating to migrate record first?

Export indeed fails:

$ pygeometa metadata generate old-1.0.mcf.yml --schema oarec-record
...
pygeometa.core.MCFReadError: invalid / unsupported version 1.0

What about updating the exception message to something like pygeometa.core.MCFReadError: invalid / unsupported version 1.0; please migrate to the latest MCF version ?

@pvgenuchten

pvgenuchten commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

yes, let's go for that

what happens if mcf has no version, do we assume latest? if fails without version, use message: parsing failed, your record does not have a version set, try setting the version and migrating to latest

@tomkralidis tomkralidis requested a review from pvgenuchten July 3, 2026 19:30
@tomkralidis tomkralidis merged commit 6166eff into master Jul 3, 2026
4 checks passed
@tomkralidis tomkralidis deleted the migrations branch July 3, 2026 19:50
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.

2 participants