-
Notifications
You must be signed in to change notification settings - Fork 22
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
refactor diff calculation query to get less information #4376
Conversation
e12bd9b
to
8945ca5
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.
LGTM, having said that I feel like I'd need to take a day or a few to go through the entire diff workflow from start to finish to have a good grip over how everything is actually working now. But great work!
@@ -100,7 +97,11 @@ def _add_attribute_conflicts( | |||
for property_type in common_property_types: | |||
base_property = base_property_map[property_type] | |||
branch_property = branch_property_map[property_type] | |||
if base_property.new_value != branch_property.new_value: | |||
same_value = base_property.new_value == branch_property.new_value or ( | |||
base_property.action is DiffAction.UNCHANGED |
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.
Is this if the action is DELETE and the values would be the same regardless?
c95aec9
to
323275e
Compare
I added a very simple "migration" here that just deletes all the diffs saved in the previous format. I initially tried to do something smarter and update each diff to the new format using the existing diff-related classes, but that ended up not working b/c those classes expect various global things to be set (locks, schema_manager, etc.). @dgarros This means that any conflict selections (source or target) on the user's database will be erased and will need to be selected again. I don't think this is too big of a deal, but I can try to work out a way to maintain them if it is necessary |
fixes #4438
IFC-729
update diff calculation query to stop looking at EVERY changed relationship within in the timeframe on either branch. Instead, get the changed paths on the diff branch, then use to determine which paths to look at on the base branch
this required a lot of changes to the query used for calculating a diff and various python classes that enrich and add diffs together.
the basic version is that we now run the diff calculation query twice: first to get all the changes on the diff branch, then we run the query again on the base branch and pass in the node UUIDs and field names retrieved in the first query. this change in combination with the updates to the cypher query seem to have substantially improved the performance of the diff calculation. I have some more ideas for improving the performance further, but this PR is already quite large and a big step in the right direction.
will also need a follow-up PR with a data migration to delete old enriched diffs because we store much less information about the base branch now.