Skip to content

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

Merged
merged 13 commits into from
May 6, 2025

Conversation

ajtmccarty
Copy link
Contributor

@ajtmccarty ajtmccarty commented Apr 25, 2025

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

@github-actions github-actions bot added the group/backend Issue related to the backend (API Server, Git Agent) label Apr 25, 2025
Copy link

codspeed-hq bot commented Apr 25, 2025

CodSpeed Performance Report

Merging #6359 will not alter performance

Comparing ajtm-04242025-migrated-kind-diff-bug (e9a235d) with stable (c55c973)

Summary

✅ 10 untouched benchmarks

@ajtmccarty ajtmccarty force-pushed the ajtm-04242025-migrated-kind-diff-bug branch from bf65e91 to 8c07957 Compare May 1, 2025 17:07
@ajtmccarty ajtmccarty changed the base branch from stable to ajtm-0501-2025-drop-nodes-from-diff May 1, 2025 17:07
@ogenstad
Copy link
Contributor

ogenstad commented May 2, 2025

IFC-1452

FYI if you end your branch name with -IFC-1452 it will automatically be linked.

@@ -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(
Copy link
Contributor Author

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(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic moved to NodeFieldSpecifierMap

Copy link
Contributor Author

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

@ajtmccarty ajtmccarty marked this pull request as ready for review May 2, 2025 13:22
@ajtmccarty ajtmccarty requested a review from a team as a code owner May 2, 2025 13:22
@@ -85,9 +85,13 @@ def deserialize_tracking_id(tracking_id_str: str) -> TrackingId:
class NodeIdentifier:
uuid: str
kind: str
labels: frozenset[str]
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea, added

Base automatically changed from ajtm-0501-2025-drop-nodes-from-diff to stable May 6, 2025 12:59
@ajtmccarty ajtmccarty merged commit e1bce6b into stable May 6, 2025
34 checks passed
@ajtmccarty ajtmccarty deleted the ajtm-04242025-migrated-kind-diff-bug branch May 6, 2025 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
group/backend Issue related to the backend (API Server, Git Agent)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants