Skip to content

bug: artifact diff needs update for migrated kind nodes #7490

Description

@ajtmccarty

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

  1. update the name, namespace, and/or inherit_from property of a schema with existing nodes (either on a branch or on main)
  2. generate artifacts that target nodes from the schema in step 1 on a branch
  3. 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

Metadata

Metadata

Assignees

Labels

type/bugSomething isn't working as expected

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions