infrahub-server 1.2.11__py3-none-any.whl → 1.3.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. infrahub/actions/constants.py +130 -0
  2. infrahub/actions/gather.py +114 -0
  3. infrahub/actions/models.py +243 -0
  4. infrahub/actions/parsers.py +104 -0
  5. infrahub/actions/schema.py +393 -0
  6. infrahub/actions/tasks.py +119 -0
  7. infrahub/actions/triggers.py +21 -0
  8. infrahub/branch/__init__.py +0 -0
  9. infrahub/branch/tasks.py +29 -0
  10. infrahub/branch/triggers.py +22 -0
  11. infrahub/cli/db.py +3 -4
  12. infrahub/computed_attribute/gather.py +3 -1
  13. infrahub/computed_attribute/tasks.py +23 -29
  14. infrahub/core/account.py +24 -47
  15. infrahub/core/attribute.py +13 -15
  16. infrahub/core/constants/__init__.py +10 -0
  17. infrahub/core/constants/database.py +1 -0
  18. infrahub/core/constants/infrahubkind.py +9 -0
  19. infrahub/core/constraint/node/runner.py +3 -1
  20. infrahub/core/convert_object_type/__init__.py +0 -0
  21. infrahub/core/convert_object_type/conversion.py +124 -0
  22. infrahub/core/convert_object_type/schema_mapping.py +56 -0
  23. infrahub/core/diff/coordinator.py +8 -1
  24. infrahub/core/diff/query/all_conflicts.py +1 -5
  25. infrahub/core/diff/query/artifact.py +10 -20
  26. infrahub/core/diff/query/delete_query.py +8 -4
  27. infrahub/core/diff/query/diff_get.py +3 -6
  28. infrahub/core/diff/query/field_specifiers.py +1 -1
  29. infrahub/core/diff/query/field_summary.py +2 -4
  30. infrahub/core/diff/query/merge.py +72 -125
  31. infrahub/core/diff/query/save.py +83 -68
  32. infrahub/core/diff/query/summary_counts_enricher.py +34 -54
  33. infrahub/core/diff/query/time_range_query.py +0 -1
  34. infrahub/core/diff/repository/repository.py +4 -0
  35. infrahub/core/graph/__init__.py +1 -1
  36. infrahub/core/manager.py +14 -11
  37. infrahub/core/migrations/graph/__init__.py +6 -0
  38. infrahub/core/migrations/graph/m003_relationship_parent_optional.py +1 -2
  39. infrahub/core/migrations/graph/m012_convert_account_generic.py +1 -1
  40. infrahub/core/migrations/graph/m013_convert_git_password_credential.py +2 -6
  41. infrahub/core/migrations/graph/m015_diff_format_update.py +1 -2
  42. infrahub/core/migrations/graph/m016_diff_delete_bug_fix.py +1 -2
  43. infrahub/core/migrations/graph/m019_restore_rels_to_time.py +11 -22
  44. infrahub/core/migrations/graph/m020_duplicate_edges.py +3 -6
  45. infrahub/core/migrations/graph/m021_missing_hierarchy_merge.py +1 -2
  46. infrahub/core/migrations/graph/m023_deduplicate_cardinality_one_relationships.py +2 -2
  47. infrahub/core/migrations/graph/m024_missing_hierarchy_backfill.py +1 -2
  48. infrahub/core/migrations/graph/m028_delete_diffs.py +1 -2
  49. infrahub/core/migrations/graph/m029_duplicates_cleanup.py +662 -0
  50. infrahub/core/migrations/graph/m030_illegal_edges.py +82 -0
  51. infrahub/core/migrations/query/attribute_add.py +14 -11
  52. infrahub/core/migrations/query/attribute_rename.py +6 -11
  53. infrahub/core/migrations/query/delete_element_in_schema.py +19 -17
  54. infrahub/core/migrations/query/node_duplicate.py +19 -21
  55. infrahub/core/migrations/query/relationship_duplicate.py +19 -18
  56. infrahub/core/migrations/schema/node_attribute_remove.py +4 -8
  57. infrahub/core/migrations/schema/node_remove.py +19 -20
  58. infrahub/core/models.py +29 -2
  59. infrahub/core/node/__init__.py +131 -28
  60. infrahub/core/node/base.py +1 -1
  61. infrahub/core/node/create.py +211 -0
  62. infrahub/core/node/resource_manager/number_pool.py +31 -5
  63. infrahub/core/node/standard.py +6 -1
  64. infrahub/core/path.py +15 -1
  65. infrahub/core/protocols.py +57 -0
  66. infrahub/core/protocols_base.py +3 -0
  67. infrahub/core/query/__init__.py +2 -2
  68. infrahub/core/query/delete.py +3 -3
  69. infrahub/core/query/diff.py +19 -32
  70. infrahub/core/query/ipam.py +10 -20
  71. infrahub/core/query/node.py +29 -47
  72. infrahub/core/query/relationship.py +55 -34
  73. infrahub/core/query/resource_manager.py +1 -2
  74. infrahub/core/query/standard_node.py +19 -5
  75. infrahub/core/query/subquery.py +2 -4
  76. infrahub/core/relationship/constraints/count.py +10 -9
  77. infrahub/core/relationship/constraints/interface.py +2 -1
  78. infrahub/core/relationship/constraints/peer_kind.py +2 -1
  79. infrahub/core/relationship/constraints/peer_parent.py +56 -0
  80. infrahub/core/relationship/constraints/peer_relatives.py +72 -0
  81. infrahub/core/relationship/constraints/profiles_kind.py +1 -1
  82. infrahub/core/relationship/model.py +4 -1
  83. infrahub/core/schema/__init__.py +2 -1
  84. infrahub/core/schema/attribute_parameters.py +160 -0
  85. infrahub/core/schema/attribute_schema.py +130 -7
  86. infrahub/core/schema/basenode_schema.py +27 -3
  87. infrahub/core/schema/definitions/core/__init__.py +29 -1
  88. infrahub/core/schema/definitions/core/group.py +45 -0
  89. infrahub/core/schema/definitions/core/resource_pool.py +9 -0
  90. infrahub/core/schema/definitions/internal.py +43 -5
  91. infrahub/core/schema/generated/attribute_schema.py +16 -3
  92. infrahub/core/schema/generated/relationship_schema.py +11 -1
  93. infrahub/core/schema/manager.py +7 -2
  94. infrahub/core/schema/schema_branch.py +109 -12
  95. infrahub/core/validators/__init__.py +15 -2
  96. infrahub/core/validators/attribute/choices.py +1 -3
  97. infrahub/core/validators/attribute/enum.py +1 -3
  98. infrahub/core/validators/attribute/kind.py +1 -3
  99. infrahub/core/validators/attribute/length.py +13 -7
  100. infrahub/core/validators/attribute/min_max.py +118 -0
  101. infrahub/core/validators/attribute/number_pool.py +106 -0
  102. infrahub/core/validators/attribute/optional.py +1 -4
  103. infrahub/core/validators/attribute/regex.py +5 -6
  104. infrahub/core/validators/attribute/unique.py +1 -3
  105. infrahub/core/validators/determiner.py +18 -2
  106. infrahub/core/validators/enum.py +12 -0
  107. infrahub/core/validators/node/hierarchy.py +3 -6
  108. infrahub/core/validators/query.py +1 -3
  109. infrahub/core/validators/relationship/count.py +6 -12
  110. infrahub/core/validators/relationship/optional.py +2 -4
  111. infrahub/core/validators/relationship/peer.py +177 -12
  112. infrahub/core/validators/tasks.py +1 -1
  113. infrahub/core/validators/uniqueness/query.py +5 -9
  114. infrahub/database/__init__.py +12 -4
  115. infrahub/database/validation.py +100 -0
  116. infrahub/dependencies/builder/constraint/grouped/node_runner.py +4 -0
  117. infrahub/dependencies/builder/constraint/relationship_manager/peer_parent.py +8 -0
  118. infrahub/dependencies/builder/constraint/relationship_manager/peer_relatives.py +8 -0
  119. infrahub/dependencies/builder/constraint/schema/aggregated.py +2 -0
  120. infrahub/dependencies/builder/constraint/schema/relationship_peer.py +8 -0
  121. infrahub/dependencies/builder/diff/deserializer.py +1 -1
  122. infrahub/dependencies/registry.py +4 -0
  123. infrahub/events/group_action.py +1 -0
  124. infrahub/events/models.py +1 -1
  125. infrahub/git/base.py +5 -3
  126. infrahub/git/integrator.py +96 -5
  127. infrahub/git/tasks.py +1 -0
  128. infrahub/graphql/analyzer.py +139 -18
  129. infrahub/graphql/manager.py +4 -0
  130. infrahub/graphql/mutations/action.py +164 -0
  131. infrahub/graphql/mutations/convert_object_type.py +71 -0
  132. infrahub/graphql/mutations/main.py +25 -176
  133. infrahub/graphql/mutations/proposed_change.py +20 -17
  134. infrahub/graphql/mutations/relationship.py +32 -0
  135. infrahub/graphql/mutations/resource_manager.py +63 -7
  136. infrahub/graphql/queries/convert_object_type_mapping.py +34 -0
  137. infrahub/graphql/queries/resource_manager.py +7 -1
  138. infrahub/graphql/resolvers/many_relationship.py +1 -1
  139. infrahub/graphql/resolvers/resolver.py +2 -2
  140. infrahub/graphql/resolvers/single_relationship.py +1 -1
  141. infrahub/graphql/schema.py +6 -0
  142. infrahub/menu/menu.py +34 -2
  143. infrahub/message_bus/messages/__init__.py +0 -10
  144. infrahub/message_bus/operations/__init__.py +0 -8
  145. infrahub/message_bus/operations/refresh/registry.py +4 -7
  146. infrahub/patch/queries/delete_duplicated_edges.py +45 -39
  147. infrahub/pools/models.py +14 -0
  148. infrahub/pools/number.py +5 -3
  149. infrahub/pools/registration.py +22 -0
  150. infrahub/pools/tasks.py +126 -0
  151. infrahub/prefect_server/models.py +1 -19
  152. infrahub/proposed_change/models.py +68 -3
  153. infrahub/proposed_change/tasks.py +911 -34
  154. infrahub/schema/__init__.py +0 -0
  155. infrahub/schema/tasks.py +27 -0
  156. infrahub/schema/triggers.py +23 -0
  157. infrahub/task_manager/models.py +10 -6
  158. infrahub/trigger/catalogue.py +6 -0
  159. infrahub/trigger/models.py +23 -6
  160. infrahub/trigger/setup.py +26 -2
  161. infrahub/trigger/tasks.py +4 -2
  162. infrahub/types.py +6 -0
  163. infrahub/webhook/tasks.py +6 -9
  164. infrahub/workflows/catalogue.py +103 -1
  165. infrahub_sdk/client.py +43 -10
  166. infrahub_sdk/ctl/generator.py +4 -4
  167. infrahub_sdk/ctl/repository.py +1 -1
  168. infrahub_sdk/node/__init__.py +39 -0
  169. infrahub_sdk/node/attribute.py +122 -0
  170. infrahub_sdk/node/constants.py +21 -0
  171. infrahub_sdk/{node.py → node/node.py} +158 -803
  172. infrahub_sdk/node/parsers.py +15 -0
  173. infrahub_sdk/node/property.py +24 -0
  174. infrahub_sdk/node/related_node.py +266 -0
  175. infrahub_sdk/node/relationship.py +302 -0
  176. infrahub_sdk/protocols.py +112 -0
  177. infrahub_sdk/protocols_base.py +34 -2
  178. infrahub_sdk/pytest_plugin/items/python_transform.py +2 -1
  179. infrahub_sdk/query_groups.py +17 -5
  180. infrahub_sdk/schema/main.py +1 -0
  181. infrahub_sdk/schema/repository.py +16 -0
  182. infrahub_sdk/spec/object.py +1 -1
  183. infrahub_sdk/store.py +1 -1
  184. infrahub_sdk/testing/schemas/car_person.py +1 -0
  185. infrahub_sdk/utils.py +7 -20
  186. infrahub_sdk/yaml.py +6 -5
  187. {infrahub_server-1.2.11.dist-info → infrahub_server-1.3.0.dist-info}/METADATA +5 -5
  188. {infrahub_server-1.2.11.dist-info → infrahub_server-1.3.0.dist-info}/RECORD +197 -168
  189. {infrahub_server-1.2.11.dist-info → infrahub_server-1.3.0.dist-info}/WHEEL +1 -1
  190. infrahub_testcontainers/container.py +239 -65
  191. infrahub_testcontainers/docker-compose-cluster.test.yml +321 -0
  192. infrahub_testcontainers/docker-compose.test.yml +2 -1
  193. infrahub_testcontainers/helpers.py +23 -3
  194. infrahub_testcontainers/plugin.py +9 -0
  195. infrahub/message_bus/messages/check_generator_run.py +0 -26
  196. infrahub/message_bus/messages/finalize_validator_execution.py +0 -15
  197. infrahub/message_bus/messages/proposed_change/base_with_diff.py +0 -16
  198. infrahub/message_bus/messages/proposed_change/request_proposedchange_refreshartifacts.py +0 -11
  199. infrahub/message_bus/messages/request_generatordefinition_check.py +0 -20
  200. infrahub/message_bus/messages/request_proposedchange_pipeline.py +0 -23
  201. infrahub/message_bus/operations/check/__init__.py +0 -3
  202. infrahub/message_bus/operations/check/generator.py +0 -156
  203. infrahub/message_bus/operations/finalize/__init__.py +0 -3
  204. infrahub/message_bus/operations/finalize/validator.py +0 -133
  205. infrahub/message_bus/operations/requests/__init__.py +0 -9
  206. infrahub/message_bus/operations/requests/generator_definition.py +0 -140
  207. infrahub/message_bus/operations/requests/proposed_change.py +0 -629
  208. infrahub/patch/queries/consolidate_duplicated_nodes.py +0 -109
  209. /infrahub/{message_bus/messages/proposed_change → actions}/__init__.py +0 -0
  210. {infrahub_server-1.2.11.dist-info → infrahub_server-1.3.0.dist-info}/LICENSE.txt +0 -0
  211. {infrahub_server-1.2.11.dist-info → infrahub_server-1.3.0.dist-info}/entry_points.txt +0 -0
@@ -37,22 +37,18 @@ AND (
37
37
  ($diff_id IS NOT NULL AND root.uuid = $diff_id)
38
38
  OR ($tracking_id IS NOT NULL AND root.tracking_id = $tracking_id AND root.diff_branch = $diff_branch_name)
39
39
  )
40
- CALL {
41
- WITH root
40
+ CALL (root) {
42
41
  MATCH (root)-[:DIFF_HAS_NODE]->(node:DiffNode)-[:DIFF_HAS_CONFLICT]->(node_conflict:DiffConflict)
43
42
  RETURN node.path_identifier AS path_identifier, node_conflict AS conflict
44
43
  UNION
45
- WITH root
46
44
  MATCH (root)-[:DIFF_HAS_NODE]->(node:DiffNode)-[:DIFF_HAS_ATTRIBUTE]->(:DiffAttribute)
47
45
  -[:DIFF_HAS_PROPERTY]->(property:DiffProperty)-[:DIFF_HAS_CONFLICT]->(attr_property_conflict:DiffConflict)
48
46
  RETURN property.path_identifier AS path_identifier, attr_property_conflict AS conflict
49
47
  UNION
50
- WITH root
51
48
  MATCH (root)-[:DIFF_HAS_NODE]->(node:DiffNode)-[:DIFF_HAS_RELATIONSHIP]->(:DiffRelationship)
52
49
  -[:DIFF_HAS_ELEMENT]->(element:DiffRelationshipElement)-[:DIFF_HAS_CONFLICT]->(rel_element_conflict:DiffConflict)
53
50
  RETURN element.path_identifier AS path_identifier, rel_element_conflict AS conflict
54
51
  UNION
55
- WITH root
56
52
  MATCH (root)-[:DIFF_HAS_NODE]->(node:DiffNode)-[:DIFF_HAS_RELATIONSHIP]->(:DiffRelationship)
57
53
  -[:DIFF_HAS_ELEMENT]->(:DiffRelationshipElement)-[:DIFF_HAS_PROPERTY]->(property:DiffProperty)
58
54
  -[:DIFF_HAS_CONFLICT]->(rel_property_conflict:DiffConflict)
@@ -40,8 +40,7 @@ class ArtifactDiffQuery(Query):
40
40
  // -----------------------
41
41
  MATCH (source_artifact:%(artifact_kind)s)-[r:IS_PART_OF]->(:Root)
42
42
  WHERE r.branch IN [$source_branch_name, $target_branch_name]
43
- CALL {
44
- WITH source_artifact
43
+ CALL (source_artifact) {
45
44
  MATCH (source_artifact)-[r:IS_PART_OF]->(:Root)
46
45
  WHERE %(source_branch_filter)s
47
46
  RETURN r AS root_rel
@@ -50,13 +49,11 @@ CALL {
50
49
  }
51
50
  WITH source_artifact, root_rel
52
51
  WHERE root_rel.status = "active"
53
- CALL {
54
- WITH source_artifact
52
+ CALL (source_artifact) {
55
53
  // -----------------------
56
54
  // get the artifact's target node
57
55
  // -----------------------
58
- CALL {
59
- WITH source_artifact
56
+ CALL (source_artifact) {
60
57
  OPTIONAL MATCH (source_artifact)-[rrel1:IS_RELATED]-(rel_node:Relationship)-[rrel2:IS_RELATED]-(target_node:Node)
61
58
  WHERE rel_node.name = $target_rel_identifier
62
59
  AND all(r IN [rrel1, rrel2] WHERE ( %(source_branch_filter)s ))
@@ -70,8 +67,7 @@ CALL {
70
67
  // -----------------------
71
68
  // get the artifact's definition node
72
69
  // -----------------------
73
- CALL {
74
- WITH source_artifact
70
+ CALL (source_artifact) {
75
71
  OPTIONAL MATCH (source_artifact)-[rrel1:IS_RELATED]-(rel_node:Relationship)-[rrel2:IS_RELATED]-(definition_node:Node)
76
72
  WHERE rel_node.name = $definition_rel_identifier
77
73
  AND all(r IN [rrel1, rrel2] WHERE ( %(source_branch_filter)s ))
@@ -85,8 +81,7 @@ CALL {
85
81
  // -----------------------
86
82
  // get the artifact's checksum
87
83
  // -----------------------
88
- CALL {
89
- WITH source_artifact
84
+ CALL (source_artifact) {
90
85
  OPTIONAL MATCH (source_artifact)-[attr_rel:HAS_ATTRIBUTE]->(attr:Attribute)-[value_rel:HAS_VALUE]->(attr_val:AttributeValue)
91
86
  WHERE attr.name = "checksum"
92
87
  AND all(r IN [attr_rel, value_rel] WHERE ( %(source_branch_filter)s ))
@@ -100,8 +95,7 @@ CALL {
100
95
  // -----------------------
101
96
  // get the artifact's storage_id
102
97
  // -----------------------
103
- CALL {
104
- WITH source_artifact
98
+ CALL (source_artifact) {
105
99
  OPTIONAL MATCH (source_artifact)-[attr_rel:HAS_ATTRIBUTE]->(attr:Attribute)-[value_rel:HAS_VALUE]->(attr_val:AttributeValue)
106
100
  WHERE attr.name = "storage_id"
107
101
  AND all(r IN [attr_rel, value_rel] WHERE ( %(source_branch_filter)s ))
@@ -137,13 +131,11 @@ CALL {
137
131
  ELSE NULL
138
132
  END AS source_storage_id
139
133
  }
140
- CALL {
134
+ CALL (target_node, definition_node){
141
135
  // -----------------------
142
136
  // get the corresponding artifact on the target branch, if it exists
143
137
  // -----------------------
144
- WITH target_node, definition_node
145
- CALL {
146
- WITH target_node, definition_node
138
+ CALL (target_node, definition_node) {
147
139
  OPTIONAL MATCH path = (target_node)-[trel1:IS_RELATED]-(trel_node:Relationship)-[trel2:IS_RELATED]-
148
140
  (target_artifact:%(artifact_kind)s)-[drel1:IS_RELATED]-(drel_node:Relationship)-[drel2:IS_RELATED]-(definition_node)
149
141
  WHERE trel_node.name = $target_rel_identifier
@@ -165,8 +157,7 @@ CALL {
165
157
  // -----------------------
166
158
  // get the artifact's checksum on target branch
167
159
  // -----------------------
168
- CALL {
169
- WITH target_artifact
160
+ CALL (target_artifact) {
170
161
  OPTIONAL MATCH (target_artifact)-[attr_rel:HAS_ATTRIBUTE]->(attr:Attribute)-[value_rel:HAS_VALUE]->(attr_val:AttributeValue)
171
162
  WHERE attr.name = "checksum"
172
163
  AND attr_rel.branch = $target_branch_name
@@ -178,8 +169,7 @@ CALL {
178
169
  // -----------------------
179
170
  // get the artifact's storage_id on target branch
180
171
  // -----------------------
181
- CALL {
182
- WITH target_artifact
172
+ CALL (target_artifact) {
183
173
  OPTIONAL MATCH (target_artifact)-[attr_rel:HAS_ATTRIBUTE]->(attr:Attribute)-[value_rel:HAS_VALUE]->(attr_val:AttributeValue)
184
174
  WHERE attr.name = "storage_id"
185
175
  AND attr_rel.branch = $target_branch_name
@@ -9,17 +9,21 @@ class EnrichedDiffDeleteQuery(Query):
9
9
  type = QueryType.WRITE
10
10
  insert_return = False
11
11
 
12
- def __init__(self, enriched_diff_root_uuids: list[str], **kwargs: Any) -> None:
12
+ def __init__(self, enriched_diff_root_uuids: list[str] | None = None, **kwargs: Any) -> None:
13
13
  super().__init__(**kwargs)
14
14
  self.enriched_diff_root_uuids = enriched_diff_root_uuids
15
15
 
16
16
  async def query_init(self, db: InfrahubDatabase, **kwargs: Any) -> None: # noqa: ARG002
17
- self.params = {"diff_root_uuids": self.enriched_diff_root_uuids}
17
+ diff_filter = ""
18
+ if self.enriched_diff_root_uuids:
19
+ self.params = {"diff_root_uuids": self.enriched_diff_root_uuids}
20
+ diff_filter = "WHERE d_root.uuid IN $diff_root_uuids"
21
+
18
22
  query = """
19
23
  MATCH (d_root:DiffRoot)
20
- WHERE d_root.uuid IN $diff_root_uuids
24
+ %(diff_filter)s
21
25
  OPTIONAL MATCH (d_root)-[*]->(diff_thing)
22
26
  DETACH DELETE diff_thing
23
27
  DETACH DELETE d_root
24
- """
28
+ """ % {"diff_filter": diff_filter}
25
29
  self.add_to_query(query=query)
@@ -96,8 +96,7 @@ class EnrichedDiffGetQuery(Query):
96
96
  // -------------------------------------
97
97
  // Retrieve Parents
98
98
  // -------------------------------------
99
- CALL {
100
- WITH diff_node
99
+ CALL (diff_node) {
101
100
  OPTIONAL MATCH parents_path = (diff_node)-[:DIFF_HAS_RELATIONSHIP|DIFF_HAS_NODE*1..%(max_depth)s]->(:DiffNode)
102
101
  RETURN parents_path
103
102
  ORDER BY size(nodes(parents_path)) DESC
@@ -112,8 +111,7 @@ class EnrichedDiffGetQuery(Query):
112
111
  // -------------------------------------
113
112
  // Retrieve Attributes
114
113
  // -------------------------------------
115
- CALL {
116
- WITH diff_node
114
+ CALL (diff_node) {
117
115
  OPTIONAL MATCH (diff_node)-[:DIFF_HAS_ATTRIBUTE]->(diff_attribute:DiffAttribute)
118
116
  WITH diff_attribute
119
117
  OPTIONAL MATCH (diff_attribute)-[:DIFF_HAS_PROPERTY]->(diff_attr_property:DiffProperty)
@@ -126,8 +124,7 @@ class EnrichedDiffGetQuery(Query):
126
124
  // -------------------------------------
127
125
  // Retrieve Relationships
128
126
  // -------------------------------------
129
- CALL {
130
- WITH diff_node
127
+ CALL (diff_node) {
131
128
  OPTIONAL MATCH (diff_node)-[:DIFF_HAS_RELATIONSHIP]->(diff_relationship:DiffRelationship)
132
129
  WITH diff_relationship
133
130
  OPTIONAL MATCH (diff_relationship)-[:DIFF_HAS_ELEMENT]->(diff_rel_element:DiffRelationshipElement)
@@ -15,7 +15,7 @@ class EnrichedDiffFieldSpecifiersQuery(Query):
15
15
  async def query_init(self, db: InfrahubDatabase, **kwargs: Any) -> None: # noqa: ARG002
16
16
  self.params["diff_id"] = self.diff_id
17
17
  query = """
18
- CALL {
18
+ CALL () {
19
19
  MATCH (root:DiffRoot {uuid: $diff_id})-[:DIFF_HAS_NODE]->(node:DiffNode)-[:DIFF_HAS_ATTRIBUTE]->(attr:DiffAttribute)
20
20
  WHERE (root.is_merged IS NULL OR root.is_merged <> TRUE)
21
21
  RETURN node.uuid AS node_uuid, node.kind AS node_kind, attr.name AS field_name
@@ -45,8 +45,7 @@ class EnrichedDiffNodeFieldSummaryQuery(Query):
45
45
  OPTIONAL MATCH (diff_root)-[:DIFF_HAS_NODE]->(n:DiffNode)
46
46
  WHERE n.action <> $unchanged_str
47
47
  WITH DISTINCT n.kind AS kind
48
- CALL {
49
- WITH kind
48
+ CALL (kind) {
50
49
  OPTIONAL MATCH (n:DiffNode {kind: kind})-[:DIFF_HAS_ATTRIBUTE]->(a:DiffAttribute)
51
50
  WHERE n.action <> $unchanged_str
52
51
  AND a.action <> $unchanged_str
@@ -54,8 +53,7 @@ class EnrichedDiffNodeFieldSummaryQuery(Query):
54
53
  RETURN collect(attr_name) AS attr_names
55
54
  }
56
55
  WITH kind, attr_names
57
- CALL {
58
- WITH kind
56
+ CALL (kind) {
59
57
  OPTIONAL MATCH (n:DiffNode {kind: kind})-[:DIFF_HAS_RELATIONSHIP]->(r:DiffRelationship)
60
58
  WHERE n.action <> $unchanged_str
61
59
  AND r.action <> $unchanged_str