Component
API Server / GraphQL
Infrahub version
1.4.12
Current Behavior
the artifact diff can produce unexpected results if the targets of artifacts have had their kind or inheritance updated
at the database-level, when a schema name, namespace, or inherit_from property is updated, we duplicate all nodes using that schema, updating the labels on the new versions and soft-deleting the old versions
the ArtifactDiffCalculator and ArtifactDiffQuery do not seem to handle this situation quite right
Expected Behavior
the artifact diff endpoint should only include artifacts that were actually updated on a given branch
Steps to Reproduce
- update the
name, namespace, and/or inherit_from property of a schema with existing nodes (either on a branch or on main)
- generate artifacts that target nodes from the schema in step 1 on a branch
- the artifact diff for the branch might include incorrect artifacts
Additional Information
this branch includes a unit test that reproduces at least one issue, but there may be more
the problem in this unit test seems to be that an artifact is improperly included in the diff b/c it had one side of its Artifact->CoreArtifactTarget relationship updated during the node kind migration on the branch
the test should also be updated to include a node kind migration on main
Component
API Server / GraphQL
Infrahub version
1.4.12
Current Behavior
the artifact diff can produce unexpected results if the targets of artifacts have had their kind or inheritance updated
at the database-level, when a schema
name,namespace, orinherit_fromproperty is updated, we duplicate all nodes using that schema, updating the labels on the new versions and soft-deleting the old versionsthe
ArtifactDiffCalculatorandArtifactDiffQuerydo not seem to handle this situation quite rightExpected Behavior
the artifact diff endpoint should only include artifacts that were actually updated on a given branch
Steps to Reproduce
name,namespace, and/orinherit_fromproperty of a schema with existing nodes (either on a branch or on main)Additional Information
this branch includes a unit test that reproduces at least one issue, but there may be more
the problem in this unit test seems to be that an artifact is improperly included in the diff b/c it had one side of its
Artifact->CoreArtifactTargetrelationship updated during the node kind migration on the branchthe test should also be updated to include a node kind migration on main