Repository navigation
Bundle schema fixes - #2084
Open
peter-targett wants to merge 5 commits into
Open
Bundle schema fixes#2084peter-targett wants to merge 5 commits into
peter-targett wants to merge 5 commits into
Conversation
Upgrade functions are registered against the version they upgrade *to*, but _instance_from_schema also ran the function for the version the object was already at (schema_version <= e.first). With Marker at version 3, every Marker.2 file - what all released OTIO and NLEs write - re-ran the 1 -> 2 upgrade, which copied the absent "range" over "marked_range", so the file failed to load with "expected type TimeRange under key 'marked_range': found type None". Only apply upgrades to versions above the object's own. Add a test that reads a genuine Marker.2, and correct test_upgrade_versions, which fed version 2 data labelled as version 3 and so encoded the old behaviour. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Peter Targett <petert@filmlight.ltd.uk>
Add bundle::WriteOptions::target_schema_versions, passed through to the JSON writer, so an .otiod/.otioz can be written for an older OTIO to read (e.g. at the CORE_VERSION_MAP "0.18.1" versions, which have Marker.2). The otiod and otioz adapters take a matching target_schema_versions argument and, like otio_json, fall back to OTIO_DEFAULT_TARGET_VERSION_FAMILY_LABEL, so otioconvert can downgrade bundles too. Document this in the file bundle and versioning tutorials, and regenerate the plugin documentation. Signed-off-by: Peter Targett <petert@filmlight.ltd.uk> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Peter Targett <131255921+peter-targett@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2084 +/- ##
==========================================
+ Coverage 83.59% 83.67% +0.08%
==========================================
Files 184 184
Lines 13632 13691 +59
Branches 1271 1273 +2
==========================================
+ Hits 11395 11456 +61
+ Misses 2064 2063 -1
+ Partials 173 172 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Signed-off-by: Peter Targett <petert@filmlight.ltd.uk>
peter-targett
force-pushed
the
bundle-schema
branch
from
October 31, 2026 06:39
0cfd04a to
78f0aa7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix schema upgrades re-applying the upgrade to the current version (98b8dee)
Upgrade functions are registered against the version they upgrade to, but
_instance_from_schemaalso ran the upgrade for the version the object was already at(
schema_version <= e.first).Upgrades now only apply to versions above the object's own. Also corrected
test_upgrade_versions, which fed version 2 data labelled as version 3 and soencoded the old behaviour.
Allow bundles to be written at older schema versions (c866e70)
Add
bundle::WriteOptions::target_schema_versions, which is passed through to theJSON writer - this lets an
.otiod/.otiozbe written for an older OTIO to read,e.g. "0.18.1" versions, which have Marker.2.
The
otiodandotiozadapters take a matchingtarget_schema_versionsargument. Likeotio_json, they fall back toOTIO_DEFAULT_TARGET_VERSION_FAMILY_LABELwhen itisn't given, so
otioconvertcan downgrade bundles too:Documentation
otio-filebundles.md: new "target_schema_versions Optional Argument" sectionversioning-schemas.md: the env var andotioconvertsections now cover bundles, plus theC++ option
otio-plugins.md: regenerated for the new adapter argumentTesting
tests/test_marker.py: reads a genuine Marker.2 filetests/test_serializable_object.py: corrected upgrade testtests/test_otiod.py: writes a bundle viaotio.adapters.write_to_filewithtarget_schema_versions, and via the env var fallbacktests/test_otioz.py: same for.otioz, checkingcontent.otioinside the zipotioconvertexample above: the bundle'scontent.otiocontainsMarker.2