-
Notifications
You must be signed in to change notification settings - Fork 25
add node kind to node field specifiers #6359
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
CodSpeed Performance ReportMerging #6359 will not alter performanceComparing Summary
|
bf65e91
to
8c07957
Compare
FYI if you end your branch name with |
@@ -531,49 +541,6 @@ def from_calculated_diff( | |||
nodes={EnrichedDiffNode.from_calculated_node(calculated_node=n) for n in calculated_diff.nodes}, | |||
) | |||
|
|||
def add_parent( |
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.
dead code
return node_field_specifiers_map | ||
|
||
def _remove_node_specifiers( |
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.
logic moved to NodeFieldSpecifierMap
backend/infrahub/core/query/diff.py
Outdated
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 change in here are just to use a list of uuids when filtering at the node-level to improve performance
@@ -85,9 +85,13 @@ def deserialize_tracking_id(tracking_id_str: str) -> TrackingId: | |||
class NodeIdentifier: | |||
uuid: str | |||
kind: str | |||
labels: frozenset[str] |
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 could be a good place here to add a comment explaining why we need both kind and labels in addition to uuid to uniquenely identify a database node
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.
good idea, added
IFC-1452
changes to the core logic of the diff for how we track node uniqueness. previously, everything in the diff assumed a node's UUID was enough to uniquely identify it. this is usually the case, but if we update a node's inheritance or kind, then we will end up with multiple nodes with the same UUID at the database level. to fix this, we need to track node uniqueness by UUID, kind, and the labels of the node at the database level (which are determined by inheritance)
more changes will be required to correctly capture and merge changes from a node kind migration or a node inheritance migration