-
Notifications
You must be signed in to change notification settings - Fork 18
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
add handling for irresolvable conflicts #4939
Conversation
CodSpeed Performance ReportMerging #4939 will not alter performanceComparing Summary
|
39530fc
to
df49784
Compare
@@ -18,6 +18,7 @@ async def calculate_diff( | |||
diff_branch: Branch, | |||
from_time: Timestamp, | |||
to_time: Timestamp, | |||
is_first_diff: bool = False, |
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 is_first_diff
and include_unchanged
args are used to keep UNCHANGED values around until a little later in the diff incremental calculation process where they are used for setting previous values
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 in here are to exclude diff elements that have been reset to the pre-branch values
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 in here are to remove conflicts from nodes that are not in the diff for the base branch b/c if the diff element is not in the base diff, then it has not changed or it has been reset to its pre-diff value
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 work!
@@ -62,8 +63,8 @@ async def calculate_diff( | |||
await base_diff_query.execute(db=self.db) | |||
for query_result in base_diff_query.get_results(): | |||
diff_parser.read_result(query_result=query_result) | |||
|
|||
diff_parser.parse() | |||
include_unchanged = not is_first_diff |
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.
Not a big deal but was thinking if is_first_diff
could be worded differently so that we avoid this double negative situation here. Seems like it's mostly used in this location.
) | ||
combined_relationships.add(combined_relationship) | ||
combined_relationship_elements = {cre for cre in combined_relationship_elements if cre.properties} | ||
includes_parent = self._child_parent_uuid_map.get(node_id, (None, None))[1] == later_relationship.name |
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 part looks a bit hairy, might it be cleaner to have a method that takes the node_id as input and optionally returns the secondary value of the tuple if the node exists in self._child_parent_uuid_map
? "_get_parent_rel_name" or so?
d76c6ba
to
be716c3
Compare
PR is too big, sorry
going to save some remaining changes for a follow-up PR
add the ability to mark certain diff conflicts as irresolvable. right now, this is all node-level delete conflicts. for example, if I delete a node on
main
and update it onbranch
, we will block merging until the conflict is resolved manually, either by deleting the node onbranch
or undoing the changes onbranch
this required some changes to
DiffCombiner
andDiffConflictsEnricher
and some new tests b/c they were not correctly handling a manual undo of a conflict in some cases