-
Notifications
You must be signed in to change notification settings - Fork 7
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
LIU-308: Rename precious flag to persist #207
Conversation
@@ -482,8 +483,8 @@ def handleCompletedDrop(self, uid): | |||
return | |||
|
|||
drop = self._drops[uid] | |||
if drop.precious and self.isReplicable(drop): | |||
logger.debug("Replicating %r because it's precious", drop) | |||
if drop.persist and self.isReplicable(drop): |
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.
It wasn't clear to me if this ticket covers changing the implementation of isReplicable()
to be allowed by default? (probably should be in a separate PR anyway)
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.
These changes look good, but we need to make this change backwards compatible, since the associated ticket for EAGLE has not been implemented yet and even once it is, we can't be sure that people would use that version straight away. I guess we could catch the deprecated 'precious' flag in two places, either in the translator or in the graph_loader in the engine. Probably we should even do both. Essentially just replacing 'precious' with 'persist' at the earliest point possible in the two packages and leave the rest of the changes as they are now. In order to test that, we should keep one of the test graphs using 'precious'.
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.
The changes so far look good to me 😄, backwards compatibility is probably wise.
There are a few additional files that may need this change too, and may need proper modification for backwards compatibility depending on whether EAGLE-869 ends up touching the following:
- daliuge-translator
- dlg/dropmake/lg.graph.schema - this is the json schema used to validate incoming lg graphs. If those coming from EAGLE with precious or persist should be valid.
- docs
- /development/app_development/eagle_app_integration.rst - mentions precious drops, should be changed to persisted too.
- toos/xml2palette/xml2palette.py - Although this may end up being handled in EAGLE-869, this code takes the documentation strings for components and turns them into EAGLE palettes.
A few questions in response:
The backwards compatibility is a good point and it will be a good exercise for me to be adding some new tests too 🙂 |
I'm not 100% sure, but I think it can be edited in place.
I think you're absolutely right, my apologies 😅 |
025ffd5
to
9f2a0b6
Compare
I only ended up adding the backwards compatibility in
|
Ignore test graphs that don't need updating to pass tests as we'll do this in a seperate commit.
Ensuring not to update the overloaded precious flag in applicationArgs or fields.
To ensure backwards compatibility rename it to persist when constructing the drop instances. We also could add duplicated logic to do this during translation from LG->PG, however we still need to handle this here as old PGs might still have the flag. Additionally there don't seem to be any obvious locations in the translator to add this logic as it is exclusively dealing with graph traversal and just passes through any properties is doesn't deal with straight through to the PG.
9f2a0b6
to
af90a56
Compare
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 looks good to me, happy to set a backwards compatibility test.
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.
Looks good now. Well spotted that the translator does actually not touch this particular parameter and indeed should not touch it, but just pass it on. That probably gave you also some impression about the mess in the translator code....
LIU-308: Rename precious flag to persist
First commit is the function changes, second commit is non-functional: updating all the test graphs to be consistent with the new flag name.