infrahub-server 1.6.3__py3-none-any.whl → 1.7.0b0__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/tasks.py +4 -2
- infrahub/api/schema.py +3 -1
- infrahub/artifacts/tasks.py +1 -0
- infrahub/auth.py +2 -2
- infrahub/cli/db.py +6 -6
- infrahub/computed_attribute/gather.py +3 -4
- infrahub/computed_attribute/tasks.py +23 -6
- infrahub/config.py +8 -0
- infrahub/constants/enums.py +12 -0
- infrahub/core/account.py +5 -8
- infrahub/core/attribute.py +106 -108
- infrahub/core/branch/models.py +44 -71
- infrahub/core/branch/tasks.py +5 -3
- infrahub/core/changelog/diff.py +1 -20
- infrahub/core/changelog/models.py +0 -7
- infrahub/core/constants/__init__.py +17 -0
- infrahub/core/constants/database.py +0 -1
- infrahub/core/constants/schema.py +0 -1
- infrahub/core/convert_object_type/repository_conversion.py +3 -4
- infrahub/core/diff/data_check_synchronizer.py +3 -2
- infrahub/core/diff/enricher/cardinality_one.py +1 -1
- infrahub/core/diff/merger/merger.py +27 -1
- infrahub/core/diff/merger/serializer.py +3 -10
- infrahub/core/diff/model/diff.py +1 -1
- infrahub/core/diff/query/merge.py +376 -135
- infrahub/core/graph/__init__.py +1 -1
- infrahub/core/graph/constraints.py +2 -2
- infrahub/core/graph/schema.py +2 -12
- infrahub/core/manager.py +132 -126
- infrahub/core/metadata/__init__.py +0 -0
- infrahub/core/metadata/interface.py +37 -0
- infrahub/core/metadata/model.py +31 -0
- infrahub/core/metadata/query/__init__.py +0 -0
- infrahub/core/metadata/query/node_metadata.py +301 -0
- infrahub/core/migrations/graph/__init__.py +4 -0
- infrahub/core/migrations/graph/m013_convert_git_password_credential.py +3 -8
- infrahub/core/migrations/graph/m017_add_core_profile.py +5 -2
- infrahub/core/migrations/graph/m018_uniqueness_nulls.py +2 -1
- infrahub/core/migrations/graph/m019_restore_rels_to_time.py +0 -10
- infrahub/core/migrations/graph/m020_duplicate_edges.py +0 -8
- infrahub/core/migrations/graph/m025_uniqueness_nulls.py +2 -1
- infrahub/core/migrations/graph/m026_0000_prefix_fix.py +2 -1
- infrahub/core/migrations/graph/m029_duplicates_cleanup.py +0 -1
- infrahub/core/migrations/graph/m031_check_number_attributes.py +2 -2
- infrahub/core/migrations/graph/m038_redo_0000_prefix_fix.py +2 -1
- infrahub/core/migrations/graph/m049_remove_is_visible_relationship.py +38 -0
- infrahub/core/migrations/graph/m050_backfill_vertex_metadata.py +168 -0
- infrahub/core/migrations/query/attribute_add.py +17 -6
- infrahub/core/migrations/query/attribute_remove.py +19 -5
- infrahub/core/migrations/query/attribute_rename.py +21 -5
- infrahub/core/migrations/query/node_duplicate.py +19 -4
- infrahub/core/migrations/schema/attribute_kind_update.py +25 -7
- infrahub/core/migrations/schema/attribute_supports_profile.py +3 -1
- infrahub/core/migrations/schema/models.py +3 -0
- infrahub/core/migrations/schema/node_attribute_add.py +4 -1
- infrahub/core/migrations/schema/node_remove.py +24 -2
- infrahub/core/migrations/schema/tasks.py +4 -1
- infrahub/core/migrations/shared.py +13 -6
- infrahub/core/models.py +6 -6
- infrahub/core/node/__init__.py +156 -57
- infrahub/core/node/create.py +7 -3
- infrahub/core/node/standard.py +100 -14
- infrahub/core/property.py +0 -1
- infrahub/core/protocols_base.py +6 -2
- infrahub/core/query/__init__.py +6 -7
- infrahub/core/query/attribute.py +161 -46
- infrahub/core/query/branch.py +57 -69
- infrahub/core/query/diff.py +4 -4
- infrahub/core/query/node.py +618 -180
- infrahub/core/query/relationship.py +449 -300
- infrahub/core/query/standard_node.py +25 -5
- infrahub/core/query/utils.py +2 -4
- infrahub/core/relationship/constraints/profiles_removal.py +168 -0
- infrahub/core/relationship/model.py +293 -139
- infrahub/core/schema/attribute_parameters.py +1 -28
- infrahub/core/schema/attribute_schema.py +17 -11
- infrahub/core/schema/manager.py +63 -43
- infrahub/core/schema/relationship_schema.py +6 -2
- infrahub/core/schema/schema_branch.py +48 -76
- infrahub/core/task/task.py +4 -2
- infrahub/core/utils.py +0 -22
- infrahub/core/validators/attribute/kind.py +2 -5
- infrahub/core/validators/determiner.py +3 -3
- infrahub/database/__init__.py +3 -3
- infrahub/dependencies/builder/constraint/grouped/node_runner.py +2 -0
- infrahub/dependencies/builder/constraint/relationship_manager/profiles_removal.py +8 -0
- infrahub/dependencies/registry.py +2 -0
- infrahub/display_labels/tasks.py +12 -3
- infrahub/git/integrator.py +18 -18
- infrahub/git/tasks.py +1 -1
- infrahub/graphql/app.py +2 -2
- infrahub/graphql/constants.py +3 -0
- infrahub/graphql/context.py +1 -1
- infrahub/graphql/initialization.py +11 -0
- infrahub/graphql/loaders/account.py +134 -0
- infrahub/graphql/loaders/node.py +5 -12
- infrahub/graphql/loaders/peers.py +5 -7
- infrahub/graphql/manager.py +158 -18
- infrahub/graphql/metadata.py +91 -0
- infrahub/graphql/models.py +33 -3
- infrahub/graphql/mutations/account.py +5 -5
- infrahub/graphql/mutations/attribute.py +0 -2
- infrahub/graphql/mutations/branch.py +9 -5
- infrahub/graphql/mutations/computed_attribute.py +1 -1
- infrahub/graphql/mutations/display_label.py +1 -1
- infrahub/graphql/mutations/hfid.py +1 -1
- infrahub/graphql/mutations/ipam.py +4 -6
- infrahub/graphql/mutations/main.py +9 -4
- infrahub/graphql/mutations/profile.py +16 -22
- infrahub/graphql/mutations/proposed_change.py +4 -4
- infrahub/graphql/mutations/relationship.py +40 -10
- infrahub/graphql/mutations/repository.py +14 -12
- infrahub/graphql/mutations/schema.py +2 -2
- infrahub/graphql/queries/branch.py +62 -6
- infrahub/graphql/queries/diff/tree.py +5 -5
- infrahub/graphql/resolvers/account_metadata.py +84 -0
- infrahub/graphql/resolvers/ipam.py +6 -8
- infrahub/graphql/resolvers/many_relationship.py +77 -35
- infrahub/graphql/resolvers/resolver.py +16 -12
- infrahub/graphql/resolvers/single_relationship.py +87 -23
- infrahub/graphql/subscription/graphql_query.py +2 -0
- infrahub/graphql/types/__init__.py +0 -1
- infrahub/graphql/types/attribute.py +10 -5
- infrahub/graphql/types/branch.py +40 -53
- infrahub/graphql/types/enums.py +3 -0
- infrahub/graphql/types/metadata.py +28 -0
- infrahub/graphql/types/node.py +22 -2
- infrahub/graphql/types/relationship.py +10 -2
- infrahub/graphql/types/standard_node.py +4 -3
- infrahub/hfid/tasks.py +12 -3
- infrahub/profiles/gather.py +56 -0
- infrahub/profiles/mandatory_fields_checker.py +116 -0
- infrahub/profiles/models.py +66 -0
- infrahub/profiles/node_applier.py +153 -12
- infrahub/profiles/queries/get_profile_data.py +143 -31
- infrahub/profiles/tasks.py +79 -27
- infrahub/profiles/triggers.py +22 -0
- infrahub/proposed_change/tasks.py +4 -1
- infrahub/tasks/artifact.py +1 -0
- infrahub/transformations/tasks.py +2 -2
- infrahub/trigger/catalogue.py +2 -0
- infrahub/trigger/models.py +1 -0
- infrahub/trigger/setup.py +3 -3
- infrahub/trigger/tasks.py +3 -0
- infrahub/validators/tasks.py +1 -0
- infrahub/webhook/models.py +1 -1
- infrahub/webhook/tasks.py +1 -1
- infrahub/workers/dependencies.py +9 -3
- infrahub/workers/infrahub_async.py +13 -4
- infrahub/workflows/catalogue.py +19 -0
- infrahub_sdk/node/constants.py +1 -0
- infrahub_sdk/node/related_node.py +13 -4
- infrahub_sdk/node/relationship.py +8 -0
- {infrahub_server-1.6.3.dist-info → infrahub_server-1.7.0b0.dist-info}/METADATA +17 -16
- {infrahub_server-1.6.3.dist-info → infrahub_server-1.7.0b0.dist-info}/RECORD +161 -143
- infrahub_testcontainers/container.py +3 -3
- infrahub_testcontainers/docker-compose-cluster.test.yml +7 -7
- infrahub_testcontainers/docker-compose.test.yml +13 -5
- {infrahub_server-1.6.3.dist-info → infrahub_server-1.7.0b0.dist-info}/WHEEL +0 -0
- {infrahub_server-1.6.3.dist-info → infrahub_server-1.7.0b0.dist-info}/entry_points.txt +0 -0
- {infrahub_server-1.6.3.dist-info → infrahub_server-1.7.0b0.dist-info}/licenses/LICENSE.txt +0 -0
infrahub/core/graph/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
GRAPH_VERSION =
|
|
1
|
+
GRAPH_VERSION = 50
|
|
@@ -176,12 +176,12 @@ class ConstraintManagerBase:
|
|
|
176
176
|
return self.nodes + self.rels
|
|
177
177
|
|
|
178
178
|
@classmethod
|
|
179
|
-
def from_graph_schema(cls, db: InfrahubDatabase, schema: dict[str, dict[str, BaseModel]]) -> Self:
|
|
179
|
+
def from_graph_schema(cls, db: InfrahubDatabase, schema: dict[str, dict[str, type[BaseModel]]]) -> Self:
|
|
180
180
|
manager = cls(db=db)
|
|
181
181
|
|
|
182
182
|
# Process the nodes first
|
|
183
183
|
for schema_item in schema["nodes"].values():
|
|
184
|
-
properties_class: BaseModel = schema_item.model_fields["properties"].annotation # type: ignore[assignment]
|
|
184
|
+
properties_class: type[BaseModel] = schema_item.model_fields["properties"].annotation # type: ignore[assignment]
|
|
185
185
|
default_label = str(schema_item.model_fields["default_label"].default)
|
|
186
186
|
for field_name, field in properties_class.model_fields.items():
|
|
187
187
|
clean_field_name = field.alias or field_name
|
infrahub/core/graph/schema.py
CHANGED
|
@@ -95,9 +95,6 @@ class GraphRelationshipRelationships(BaseModel):
|
|
|
95
95
|
HAS_OWNER: GraphRelationship = Field(
|
|
96
96
|
GraphRelationship(peer="Node", direction=GraphRelDirection.OUTBOUND), description=""
|
|
97
97
|
)
|
|
98
|
-
IS_VISIBLE: GraphRelationship = Field(
|
|
99
|
-
GraphRelationship(peer="Boolean", direction=GraphRelDirection.OUTBOUND), description=""
|
|
100
|
-
)
|
|
101
98
|
IS_PROTECTED: GraphRelationship = Field(
|
|
102
99
|
GraphRelationship(peer="Boolean", direction=GraphRelDirection.OUTBOUND), description=""
|
|
103
100
|
)
|
|
@@ -133,9 +130,6 @@ class GraphAttributeRelationships(BaseModel):
|
|
|
133
130
|
HAS_OWNER: GraphRelationship = Field(
|
|
134
131
|
GraphRelationship(peer="Node", direction=GraphRelDirection.OUTBOUND), description=""
|
|
135
132
|
)
|
|
136
|
-
IS_VISIBLE: GraphRelationship = Field(
|
|
137
|
-
GraphRelationship(peer="Boolean", direction=GraphRelDirection.OUTBOUND), description=""
|
|
138
|
-
)
|
|
139
133
|
IS_PROTECTED: GraphRelationship = Field(
|
|
140
134
|
GraphRelationship(peer="Boolean", direction=GraphRelDirection.OUTBOUND), description=""
|
|
141
135
|
)
|
|
@@ -208,9 +202,6 @@ class GraphBooleanProperties(BaseModel):
|
|
|
208
202
|
|
|
209
203
|
|
|
210
204
|
class GraphBooleanRelationships(BaseModel):
|
|
211
|
-
IS_VISIBLE: GraphRelationship = Field(
|
|
212
|
-
GraphRelationship(peer="Attribute|Relationship", direction=GraphRelDirection.INBOUND), description=""
|
|
213
|
-
)
|
|
214
205
|
IS_PROTECTED: GraphRelationship = Field(
|
|
215
206
|
GraphRelationship(peer="Attribute|Relationship", direction=GraphRelDirection.INBOUND), description=""
|
|
216
207
|
)
|
|
@@ -243,7 +234,7 @@ class GraphRelationshipDefault(BaseModel):
|
|
|
243
234
|
hierarchy: Optional[str] = Field(None, description="Name of the hierarchy this relationship is part of")
|
|
244
235
|
|
|
245
236
|
|
|
246
|
-
def get_graph_schema() -> dict[str, dict[str, Any]]:
|
|
237
|
+
def get_graph_schema() -> dict[str, dict[str, type[Any]]]:
|
|
247
238
|
"""Generate the graph schema dictionary containing nodes and relationships."""
|
|
248
239
|
graph_node_list: list[type[GraphVertex]] = [
|
|
249
240
|
GraphNodeNode,
|
|
@@ -265,10 +256,9 @@ def get_graph_schema() -> dict[str, dict[str, Any]]:
|
|
|
265
256
|
"IS_RELATED": GraphRelationshipDefault,
|
|
266
257
|
"HAS_SOURCE": GraphRelationshipDefault,
|
|
267
258
|
"HAS_OWNER": GraphRelationshipDefault,
|
|
268
|
-
"IS_VISIBLE": GraphRelationshipDefault,
|
|
269
259
|
"IS_PROTECTED": GraphRelationshipDefault,
|
|
270
260
|
},
|
|
271
261
|
}
|
|
272
262
|
|
|
273
263
|
|
|
274
|
-
GRAPH_SCHEMA: dict[str, dict[str, Any]] = get_graph_schema()
|
|
264
|
+
GRAPH_SCHEMA: dict[str, dict[str, type[Any]]] = get_graph_schema()
|