-
Notifications
You must be signed in to change notification settings - Fork 49
Fix#246 : Store and lock the "family" on a "subset" #443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Move required property 'data.families' from version to subset
This is backwards compatible.
|
What I have tested:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice and clean change @davidlatwe - good work. I'll still have to test it on my end but I did notice something in the code that I think could be improved so I commented on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good. Certainly a needed improvement.
|
I've been giving this a roll and backwards compatibility seems smooth, great work! 🚀 I didn't notice it had changed from an Artist's perspective. However, I did have a question. How did you end up updating your integrator? Be aware when updating your integrator: Should have thought of that of course. :) Just wondering how you adapted for this situation @davidlatwe. |
|
Ah, have you updated the |
|
Oh, wait, I might misunderstand your case, let me take a look |
|
Ah, I see. You have it as an if/else deciding between putting I ended up actually updating my subset version: # example psuedocode
if subset and subset["schema"] == "avalon-core:subset-2.0":
self.log.info("Updating subset {name} "
"'{schema}' to schema "
"'avalon-core:subset-3.0'".format(**subset))
subset_original = copy.deepcopy(subset)
subset["schema"] = "avalon-core:subset-3.0"
subset["data"]["families"] = _get_families(instance)
schema.validate(subset)
result = io.replace_one(subset_original, subset)
assert result.modified_count == 1, "Subset schema update failed."I guess your way should have been the way to go though, to leave whatever was as close to the originals as possible.
👍 Smooth sailing from here on out. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work David! 🚀 Feel free to merge.
|
Okay, I get the picture now :P
I actually didn't ! Big thanks for the heads up ! But I think the best and simple option for anyone prepare to adopt this PR is :
So that you won't need to worry breaking anything already existed. :) |
|
To be complete, here's what I have for my config to adopt this PR. 👉 🚪 |
This PR aim to resolve #246, the implementation I am proposing is to involve new schema for subset and version, so that we could have a standard to maintain backwards compatibility.
What's changed?
subset-3.0andversion-3.0data.familiesfrom subset document if theschemaissubset-3.0