Repository navigation
Conversation
When a revision creates a schema whose name template uses a parent's lot number, the template was set before the parent link existed, and the link update left out parent_link. For newly created schemas: - the follow-up link update sets parent_link with the target, and the create leaves it off - the name template and template based naming strategies run after field updates, through an order override on CompareOperation - the warehouse rename stays early and is its own step Revisions for existing schemas keep the default order. Closes dynotx#271.
4 tasks done
Collaborator
|
Closing this PR, as I've merged in #276. Thanks for your help here! |
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.
Closes #271.
Problem
When a revision creates a batch schema whose name template uses its parent's lot number,
upgradefails at the name template. Two things cause it:parent_link. The link field is created without a target, so it can't be a parent link yet. The follow-up update set onlytypeandentity_link, so the field never became a parent link.Change
These changes apply only in the create branch of
compare_entity_schemas:parent_link=Truealong with the target. The create leavesparent_linkoff.CompareOperationgets an optionalorderthat overridesop.orderwhen sorting, and these two operations useUpdateEntitySchemaField.order + 1and+ 2.UpdateEntitySchemaand stays at the default order, because the later operations use the model's warehouse name.Revisions for existing schemas are unchanged. Every operation they generate keeps
order=None.For Cell Line and Cell Line Batch, a new revision now runs:
Parent Cell Lineat Cell Line, withparent_link=TrueTesting
test_compare_benchling_schemas_create_link_ordercovers a parent schema plus a batch with a parent-lot-number template and a custom warehouse name. It checks the operation order, thatparent_linkmoves from the create to the link update, and that every field update runs before any new schema's template.test_compare_benchling_schema_fieldsnow also checks that operations for an existing schema keep the default order.{parent}-{lot number}template. It applied cleanly,diffshowed both schemas matching code, anddowngradearchived both and restored the remote revision.