infrahub-server 1.2.12__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.
- infrahub/actions/constants.py +130 -0
- infrahub/actions/gather.py +114 -0
- infrahub/actions/models.py +243 -0
- infrahub/actions/parsers.py +104 -0
- infrahub/actions/schema.py +393 -0
- infrahub/actions/tasks.py +119 -0
- infrahub/actions/triggers.py +21 -0
- infrahub/branch/__init__.py +0 -0
- infrahub/branch/tasks.py +29 -0
- infrahub/branch/triggers.py +22 -0
- infrahub/cli/db.py +3 -4
- infrahub/computed_attribute/gather.py +3 -1
- infrahub/computed_attribute/tasks.py +23 -29
- infrahub/core/account.py +24 -47
- infrahub/core/attribute.py +13 -15
- infrahub/core/constants/__init__.py +10 -0
- infrahub/core/constants/infrahubkind.py +9 -0
- infrahub/core/constraint/node/runner.py +3 -1
- infrahub/core/convert_object_type/__init__.py +0 -0
- infrahub/core/convert_object_type/conversion.py +124 -0
- infrahub/core/convert_object_type/schema_mapping.py +56 -0
- infrahub/core/diff/coordinator.py +8 -1
- infrahub/core/diff/query/all_conflicts.py +1 -5
- infrahub/core/diff/query/artifact.py +10 -20
- infrahub/core/diff/query/delete_query.py +8 -4
- infrahub/core/diff/query/diff_get.py +3 -6
- infrahub/core/diff/query/field_specifiers.py +1 -1
- infrahub/core/diff/query/field_summary.py +2 -4
- infrahub/core/diff/query/merge.py +72 -125
- infrahub/core/diff/query/save.py +28 -43
- infrahub/core/diff/query/summary_counts_enricher.py +34 -54
- infrahub/core/diff/query/time_range_query.py +0 -1
- infrahub/core/diff/repository/repository.py +4 -0
- infrahub/core/manager.py +14 -11
- infrahub/core/migrations/graph/m003_relationship_parent_optional.py +1 -2
- infrahub/core/migrations/graph/m012_convert_account_generic.py +1 -1
- infrahub/core/migrations/graph/m013_convert_git_password_credential.py +2 -6
- infrahub/core/migrations/graph/m015_diff_format_update.py +1 -2
- infrahub/core/migrations/graph/m016_diff_delete_bug_fix.py +1 -2
- infrahub/core/migrations/graph/m019_restore_rels_to_time.py +11 -22
- infrahub/core/migrations/graph/m020_duplicate_edges.py +3 -6
- infrahub/core/migrations/graph/m021_missing_hierarchy_merge.py +1 -2
- infrahub/core/migrations/graph/m023_deduplicate_cardinality_one_relationships.py +2 -2
- infrahub/core/migrations/graph/m024_missing_hierarchy_backfill.py +1 -2
- infrahub/core/migrations/graph/m028_delete_diffs.py +1 -2
- infrahub/core/migrations/graph/m029_duplicates_cleanup.py +30 -48
- infrahub/core/migrations/graph/m030_illegal_edges.py +1 -2
- infrahub/core/migrations/query/attribute_add.py +1 -2
- infrahub/core/migrations/query/attribute_rename.py +6 -11
- infrahub/core/migrations/query/delete_element_in_schema.py +19 -17
- infrahub/core/migrations/query/node_duplicate.py +19 -21
- infrahub/core/migrations/query/relationship_duplicate.py +19 -18
- infrahub/core/migrations/schema/node_attribute_remove.py +4 -8
- infrahub/core/migrations/schema/node_remove.py +19 -20
- infrahub/core/models.py +29 -2
- infrahub/core/node/__init__.py +131 -28
- infrahub/core/node/base.py +1 -1
- infrahub/core/node/create.py +211 -0
- infrahub/core/node/resource_manager/number_pool.py +31 -5
- infrahub/core/node/standard.py +6 -1
- infrahub/core/path.py +15 -1
- infrahub/core/protocols.py +57 -0
- infrahub/core/protocols_base.py +3 -0
- infrahub/core/query/__init__.py +2 -2
- infrahub/core/query/delete.py +3 -3
- infrahub/core/query/diff.py +19 -32
- infrahub/core/query/ipam.py +10 -20
- infrahub/core/query/node.py +29 -47
- infrahub/core/query/relationship.py +55 -34
- infrahub/core/query/resource_manager.py +1 -2
- infrahub/core/query/standard_node.py +19 -5
- infrahub/core/query/subquery.py +2 -4
- infrahub/core/relationship/constraints/count.py +10 -9
- infrahub/core/relationship/constraints/interface.py +2 -1
- infrahub/core/relationship/constraints/peer_kind.py +2 -1
- infrahub/core/relationship/constraints/peer_parent.py +56 -0
- infrahub/core/relationship/constraints/peer_relatives.py +72 -0
- infrahub/core/relationship/constraints/profiles_kind.py +1 -1
- infrahub/core/relationship/model.py +4 -1
- infrahub/core/schema/__init__.py +2 -1
- infrahub/core/schema/attribute_parameters.py +160 -0
- infrahub/core/schema/attribute_schema.py +130 -7
- infrahub/core/schema/basenode_schema.py +27 -3
- infrahub/core/schema/definitions/core/__init__.py +29 -1
- infrahub/core/schema/definitions/core/group.py +45 -0
- infrahub/core/schema/definitions/core/resource_pool.py +9 -0
- infrahub/core/schema/definitions/internal.py +43 -5
- infrahub/core/schema/generated/attribute_schema.py +16 -3
- infrahub/core/schema/generated/relationship_schema.py +11 -1
- infrahub/core/schema/manager.py +7 -2
- infrahub/core/schema/schema_branch.py +104 -9
- infrahub/core/validators/__init__.py +15 -2
- infrahub/core/validators/attribute/choices.py +1 -3
- infrahub/core/validators/attribute/enum.py +1 -3
- infrahub/core/validators/attribute/kind.py +1 -3
- infrahub/core/validators/attribute/length.py +13 -7
- infrahub/core/validators/attribute/min_max.py +118 -0
- infrahub/core/validators/attribute/number_pool.py +106 -0
- infrahub/core/validators/attribute/optional.py +1 -4
- infrahub/core/validators/attribute/regex.py +5 -6
- infrahub/core/validators/attribute/unique.py +1 -3
- infrahub/core/validators/determiner.py +18 -2
- infrahub/core/validators/enum.py +12 -0
- infrahub/core/validators/node/hierarchy.py +3 -6
- infrahub/core/validators/query.py +1 -3
- infrahub/core/validators/relationship/count.py +6 -12
- infrahub/core/validators/relationship/optional.py +2 -4
- infrahub/core/validators/relationship/peer.py +177 -12
- infrahub/core/validators/tasks.py +1 -1
- infrahub/core/validators/uniqueness/query.py +5 -9
- infrahub/database/__init__.py +12 -4
- infrahub/database/validation.py +1 -2
- infrahub/dependencies/builder/constraint/grouped/node_runner.py +4 -0
- infrahub/dependencies/builder/constraint/relationship_manager/peer_parent.py +8 -0
- infrahub/dependencies/builder/constraint/relationship_manager/peer_relatives.py +8 -0
- infrahub/dependencies/builder/constraint/schema/aggregated.py +2 -0
- infrahub/dependencies/builder/constraint/schema/relationship_peer.py +8 -0
- infrahub/dependencies/builder/diff/deserializer.py +1 -1
- infrahub/dependencies/registry.py +4 -0
- infrahub/events/group_action.py +1 -0
- infrahub/events/models.py +1 -1
- infrahub/git/base.py +5 -3
- infrahub/git/integrator.py +96 -5
- infrahub/git/tasks.py +1 -0
- infrahub/graphql/analyzer.py +139 -18
- infrahub/graphql/manager.py +4 -0
- infrahub/graphql/mutations/action.py +164 -0
- infrahub/graphql/mutations/convert_object_type.py +71 -0
- infrahub/graphql/mutations/main.py +24 -175
- infrahub/graphql/mutations/proposed_change.py +20 -17
- infrahub/graphql/mutations/relationship.py +32 -0
- infrahub/graphql/mutations/resource_manager.py +63 -7
- infrahub/graphql/queries/convert_object_type_mapping.py +34 -0
- infrahub/graphql/queries/resource_manager.py +7 -1
- infrahub/graphql/resolvers/many_relationship.py +1 -1
- infrahub/graphql/resolvers/resolver.py +2 -2
- infrahub/graphql/resolvers/single_relationship.py +1 -1
- infrahub/graphql/schema.py +6 -0
- infrahub/menu/menu.py +34 -2
- infrahub/message_bus/messages/__init__.py +0 -10
- infrahub/message_bus/operations/__init__.py +0 -8
- infrahub/message_bus/operations/refresh/registry.py +3 -6
- infrahub/patch/queries/delete_duplicated_edges.py +10 -15
- infrahub/pools/models.py +14 -0
- infrahub/pools/number.py +5 -3
- infrahub/pools/registration.py +22 -0
- infrahub/pools/tasks.py +126 -0
- infrahub/prefect_server/models.py +1 -19
- infrahub/proposed_change/models.py +68 -3
- infrahub/proposed_change/tasks.py +911 -34
- infrahub/schema/__init__.py +0 -0
- infrahub/schema/tasks.py +27 -0
- infrahub/schema/triggers.py +23 -0
- infrahub/task_manager/models.py +10 -6
- infrahub/trigger/catalogue.py +6 -0
- infrahub/trigger/models.py +23 -6
- infrahub/trigger/setup.py +26 -2
- infrahub/trigger/tasks.py +4 -2
- infrahub/types.py +6 -0
- infrahub/webhook/tasks.py +4 -8
- infrahub/workflows/catalogue.py +103 -1
- infrahub_sdk/client.py +43 -10
- infrahub_sdk/ctl/generator.py +4 -4
- infrahub_sdk/ctl/repository.py +1 -1
- infrahub_sdk/node/__init__.py +39 -0
- infrahub_sdk/node/attribute.py +122 -0
- infrahub_sdk/node/constants.py +21 -0
- infrahub_sdk/{node.py → node/node.py} +158 -803
- infrahub_sdk/node/parsers.py +15 -0
- infrahub_sdk/node/property.py +24 -0
- infrahub_sdk/node/related_node.py +266 -0
- infrahub_sdk/node/relationship.py +302 -0
- infrahub_sdk/protocols.py +112 -0
- infrahub_sdk/protocols_base.py +34 -2
- infrahub_sdk/pytest_plugin/items/python_transform.py +2 -1
- infrahub_sdk/query_groups.py +17 -5
- infrahub_sdk/schema/main.py +1 -0
- infrahub_sdk/schema/repository.py +16 -0
- infrahub_sdk/spec/object.py +1 -1
- infrahub_sdk/store.py +1 -1
- infrahub_sdk/testing/schemas/car_person.py +1 -0
- infrahub_sdk/utils.py +7 -20
- infrahub_sdk/yaml.py +6 -5
- {infrahub_server-1.2.12.dist-info → infrahub_server-1.3.0.dist-info}/METADATA +3 -3
- {infrahub_server-1.2.12.dist-info → infrahub_server-1.3.0.dist-info}/RECORD +192 -166
- infrahub_testcontainers/container.py +0 -1
- infrahub_testcontainers/docker-compose.test.yml +1 -1
- infrahub_testcontainers/helpers.py +8 -2
- infrahub/message_bus/messages/check_generator_run.py +0 -26
- infrahub/message_bus/messages/finalize_validator_execution.py +0 -15
- infrahub/message_bus/messages/proposed_change/base_with_diff.py +0 -16
- infrahub/message_bus/messages/proposed_change/request_proposedchange_refreshartifacts.py +0 -11
- infrahub/message_bus/messages/request_generatordefinition_check.py +0 -20
- infrahub/message_bus/messages/request_proposedchange_pipeline.py +0 -23
- infrahub/message_bus/operations/check/__init__.py +0 -3
- infrahub/message_bus/operations/check/generator.py +0 -156
- infrahub/message_bus/operations/finalize/__init__.py +0 -3
- infrahub/message_bus/operations/finalize/validator.py +0 -133
- infrahub/message_bus/operations/requests/__init__.py +0 -9
- infrahub/message_bus/operations/requests/generator_definition.py +0 -140
- infrahub/message_bus/operations/requests/proposed_change.py +0 -629
- /infrahub/{message_bus/messages/proposed_change → actions}/__init__.py +0 -0
- {infrahub_server-1.2.12.dist-info → infrahub_server-1.3.0.dist-info}/LICENSE.txt +0 -0
- {infrahub_server-1.2.12.dist-info → infrahub_server-1.3.0.dist-info}/WHEEL +0 -0
- {infrahub_server-1.2.12.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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|