infrahub-server 1.2.8__py3-none-any.whl → 1.2.9rc0__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/cli/db.py +14 -5
- infrahub/core/initialization.py +23 -7
- infrahub/core/migrations/graph/m014_remove_index_attr_value.py +4 -2
- infrahub/core/validators/uniqueness/query.py +24 -8
- infrahub/database/__init__.py +0 -7
- infrahub/database/memgraph.py +0 -12
- infrahub/database/neo4j.py +0 -12
- infrahub/graphql/mutations/computed_attribute.py +5 -1
- infrahub/server.py +1 -5
- {infrahub_server-1.2.8.dist-info → infrahub_server-1.2.9rc0.dist-info}/METADATA +1 -1
- {infrahub_server-1.2.8.dist-info → infrahub_server-1.2.9rc0.dist-info}/RECORD +16 -17
- infrahub_testcontainers/container.py +1 -0
- infrahub_testcontainers/docker-compose.test.yml +2 -0
- infrahub/database/manager.py +0 -15
- {infrahub_server-1.2.8.dist-info → infrahub_server-1.2.9rc0.dist-info}/LICENSE.txt +0 -0
- {infrahub_server-1.2.8.dist-info → infrahub_server-1.2.9rc0.dist-info}/WHEEL +0 -0
- {infrahub_server-1.2.8.dist-info → infrahub_server-1.2.9rc0.dist-info}/entry_points.txt +0 -0
infrahub/cli/db.py
CHANGED
|
@@ -23,7 +23,7 @@ from infrahub import config
|
|
|
23
23
|
from infrahub.core import registry
|
|
24
24
|
from infrahub.core.graph import GRAPH_VERSION
|
|
25
25
|
from infrahub.core.graph.constraints import ConstraintManagerBase, ConstraintManagerMemgraph, ConstraintManagerNeo4j
|
|
26
|
-
from infrahub.core.graph.index import node_indexes, rel_indexes
|
|
26
|
+
from infrahub.core.graph.index import attr_value_index, node_indexes, rel_indexes
|
|
27
27
|
from infrahub.core.graph.schema import (
|
|
28
28
|
GRAPH_SCHEMA,
|
|
29
29
|
GraphAttributeProperties,
|
|
@@ -48,6 +48,8 @@ from infrahub.core.utils import delete_all_nodes
|
|
|
48
48
|
from infrahub.core.validators.models.validate_migration import SchemaValidateMigrationData
|
|
49
49
|
from infrahub.core.validators.tasks import schema_validate_migrations
|
|
50
50
|
from infrahub.database import DatabaseType
|
|
51
|
+
from infrahub.database.memgraph import IndexManagerMemgraph
|
|
52
|
+
from infrahub.database.neo4j import IndexManagerNeo4j
|
|
51
53
|
from infrahub.log import get_logger
|
|
52
54
|
from infrahub.services import InfrahubServices
|
|
53
55
|
from infrahub.services.adapters.message_bus.local import BusSimulator
|
|
@@ -59,6 +61,7 @@ from .patch import patch_app
|
|
|
59
61
|
if TYPE_CHECKING:
|
|
60
62
|
from infrahub.cli.context import CliContext
|
|
61
63
|
from infrahub.database import InfrahubDatabase
|
|
64
|
+
from infrahub.database.index import IndexManagerBase
|
|
62
65
|
|
|
63
66
|
app = AsyncTyper()
|
|
64
67
|
app.add_typer(patch_app, name="patch")
|
|
@@ -249,14 +252,20 @@ async def index(
|
|
|
249
252
|
|
|
250
253
|
context: CliContext = ctx.obj
|
|
251
254
|
dbdriver = await context.init_db(retry=1)
|
|
252
|
-
dbdriver.
|
|
255
|
+
if dbdriver.db_type is DatabaseType.MEMGRAPH:
|
|
256
|
+
index_manager: IndexManagerBase = IndexManagerMemgraph(db=dbdriver)
|
|
257
|
+
index_manager = IndexManagerNeo4j(db=dbdriver)
|
|
258
|
+
|
|
259
|
+
if config.SETTINGS.experimental_features.value_db_index:
|
|
260
|
+
node_indexes.append(attr_value_index)
|
|
261
|
+
index_manager.init(nodes=node_indexes, rels=rel_indexes)
|
|
253
262
|
|
|
254
263
|
if action == IndexAction.ADD:
|
|
255
|
-
await
|
|
264
|
+
await index_manager.add()
|
|
256
265
|
elif action == IndexAction.DROP:
|
|
257
|
-
await
|
|
266
|
+
await index_manager.drop()
|
|
258
267
|
|
|
259
|
-
indexes = await
|
|
268
|
+
indexes = await index_manager.list()
|
|
260
269
|
|
|
261
270
|
console = Console()
|
|
262
271
|
|
infrahub/core/initialization.py
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import importlib
|
|
2
|
+
from typing import TYPE_CHECKING
|
|
2
3
|
from uuid import uuid4
|
|
3
4
|
|
|
4
5
|
from infrahub import config, lock
|
|
6
|
+
from infrahub.constants.database import DatabaseType
|
|
5
7
|
from infrahub.core import registry
|
|
6
8
|
from infrahub.core.branch import Branch
|
|
7
9
|
from infrahub.core.constants import (
|
|
@@ -13,6 +15,7 @@ from infrahub.core.constants import (
|
|
|
13
15
|
PermissionDecision,
|
|
14
16
|
)
|
|
15
17
|
from infrahub.core.graph import GRAPH_VERSION
|
|
18
|
+
from infrahub.core.graph.index import attr_value_index, node_indexes, rel_indexes
|
|
16
19
|
from infrahub.core.manager import NodeManager
|
|
17
20
|
from infrahub.core.node import Node
|
|
18
21
|
from infrahub.core.node.ipam import BuiltinIPPrefix
|
|
@@ -25,6 +28,8 @@ from infrahub.core.root import Root
|
|
|
25
28
|
from infrahub.core.schema import SchemaRoot, core_models, internal_schema
|
|
26
29
|
from infrahub.core.schema.manager import SchemaManager
|
|
27
30
|
from infrahub.database import InfrahubDatabase
|
|
31
|
+
from infrahub.database.memgraph import IndexManagerMemgraph
|
|
32
|
+
from infrahub.database.neo4j import IndexManagerNeo4j
|
|
28
33
|
from infrahub.exceptions import DatabaseError
|
|
29
34
|
from infrahub.graphql.manager import GraphQLSchemaManager
|
|
30
35
|
from infrahub.log import get_logger
|
|
@@ -32,6 +37,9 @@ from infrahub.menu.utils import create_default_menu
|
|
|
32
37
|
from infrahub.permissions import PermissionBackend
|
|
33
38
|
from infrahub.storage import InfrahubObjectStorage
|
|
34
39
|
|
|
40
|
+
if TYPE_CHECKING:
|
|
41
|
+
from infrahub.database.index import IndexManagerBase
|
|
42
|
+
|
|
35
43
|
log = get_logger()
|
|
36
44
|
|
|
37
45
|
|
|
@@ -115,7 +123,19 @@ async def initialize_registry(db: InfrahubDatabase, initialize: bool = False) ->
|
|
|
115
123
|
registry.permission_backends = initialize_permission_backends()
|
|
116
124
|
|
|
117
125
|
|
|
118
|
-
async def
|
|
126
|
+
async def add_indexes(db: InfrahubDatabase) -> None:
|
|
127
|
+
if db.db_type is DatabaseType.MEMGRAPH:
|
|
128
|
+
index_manager: IndexManagerBase = IndexManagerMemgraph(db=db)
|
|
129
|
+
index_manager = IndexManagerNeo4j(db=db)
|
|
130
|
+
|
|
131
|
+
if config.SETTINGS.experimental_features.value_db_index:
|
|
132
|
+
node_indexes.append(attr_value_index)
|
|
133
|
+
index_manager.init(nodes=node_indexes, rels=rel_indexes)
|
|
134
|
+
log.debug("Loading database indexes ..")
|
|
135
|
+
await index_manager.add()
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
async def initialization(db: InfrahubDatabase, add_database_indexes: bool = False) -> None:
|
|
119
139
|
if config.SETTINGS.database.db_type == config.DatabaseType.MEMGRAPH:
|
|
120
140
|
session = await db.session()
|
|
121
141
|
await session.run(query="SET DATABASE SETTING 'log.level' TO 'INFO'")
|
|
@@ -129,12 +149,8 @@ async def initialization(db: InfrahubDatabase) -> None:
|
|
|
129
149
|
log.debug("Checking Root Node")
|
|
130
150
|
await initialize_registry(db=db, initialize=True)
|
|
131
151
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
log.debug("Loading database indexes ..")
|
|
135
|
-
await db.manager.index.add()
|
|
136
|
-
else:
|
|
137
|
-
log.warning("The database index manager hasn't been initialized.")
|
|
152
|
+
if add_database_indexes:
|
|
153
|
+
await add_indexes(db=db)
|
|
138
154
|
|
|
139
155
|
# ---------------------------------------------------
|
|
140
156
|
# Load all schema in the database into the registry
|
|
@@ -7,6 +7,7 @@ from infrahub.core.migrations.shared import MigrationResult
|
|
|
7
7
|
from infrahub.core.query import Query # noqa: TC001
|
|
8
8
|
from infrahub.database import DatabaseType
|
|
9
9
|
from infrahub.database.index import IndexItem
|
|
10
|
+
from infrahub.database.neo4j import IndexManagerNeo4j
|
|
10
11
|
|
|
11
12
|
from ..shared import GraphMigration
|
|
12
13
|
|
|
@@ -30,8 +31,9 @@ class Migration014(GraphMigration):
|
|
|
30
31
|
return result
|
|
31
32
|
|
|
32
33
|
try:
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
index_manager = IndexManagerNeo4j(db=db)
|
|
35
|
+
index_manager.init(nodes=[INDEX_TO_DELETE], rels=[])
|
|
36
|
+
await index_manager.drop()
|
|
35
37
|
except Exception as exc:
|
|
36
38
|
result.errors.append(str(exc))
|
|
37
39
|
return result
|
|
@@ -30,7 +30,7 @@ class NodeUniqueAttributeConstraintQuery(Query):
|
|
|
30
30
|
def get_context(self) -> dict[str, str]:
|
|
31
31
|
return {"kind": self.query_request.kind}
|
|
32
32
|
|
|
33
|
-
async def query_init(self, db: InfrahubDatabase, **kwargs: Any) -> None: # noqa: ARG002
|
|
33
|
+
async def query_init(self, db: InfrahubDatabase, **kwargs: Any) -> None: # noqa: ARG002,PLR0915
|
|
34
34
|
branch_filter, branch_params = self.branch.get_query_filter_path(at=self.at.to_string(), is_isolated=False)
|
|
35
35
|
self.params.update(branch_params)
|
|
36
36
|
from_times = db.render_list_comprehension(items="relationships(potential_path)", item_name="from")
|
|
@@ -105,16 +105,28 @@ class NodeUniqueAttributeConstraintQuery(Query):
|
|
|
105
105
|
attr_paths_subquery = """
|
|
106
106
|
MATCH attr_path = (start_node:%(node_kind)s)-[:HAS_ATTRIBUTE]->(attr:Attribute)-[r:HAS_VALUE]->(attr_value:AttributeValue)
|
|
107
107
|
WHERE attr.name in $attribute_names
|
|
108
|
-
AND
|
|
109
|
-
OR (attr_value.value in $attr_values AND [attr.name, type(r), attr_value.value] in $attr_paths_with_value))
|
|
108
|
+
AND [attr.name, type(r)] in $attr_paths
|
|
110
109
|
RETURN start_node, attr_path as potential_path, NULL as rel_identifier, attr.name as potential_attr, attr_value.value as potential_attr_value
|
|
111
110
|
""" % {"node_kind": self.query_request.kind}
|
|
112
111
|
|
|
113
|
-
|
|
112
|
+
attr_paths_with_value_subquery = """
|
|
113
|
+
MATCH attr_path = (start_node:%(node_kind)s)-[:HAS_ATTRIBUTE]->(attr:Attribute)-[r:HAS_VALUE]->(attr_value:AttributeValue)
|
|
114
|
+
WHERE attr.name in $attribute_names AND attr_value.value in $attr_values
|
|
115
|
+
AND [attr.name, type(r), attr_value.value] in $attr_paths_with_value
|
|
116
|
+
RETURN start_node, attr_path as potential_path, NULL as rel_identifier, attr.name as potential_attr, attr_value.value as potential_attr_value
|
|
117
|
+
""" % {"node_kind": self.query_request.kind}
|
|
118
|
+
|
|
119
|
+
relationship_attr_paths_subquery = """
|
|
114
120
|
MATCH rel_path = (start_node:%(node_kind)s)-[:IS_RELATED]-(relationship_node:Relationship)-[:IS_RELATED]-(related_n:Node)-[:HAS_ATTRIBUTE]->(rel_attr:Attribute)-[:HAS_VALUE]->(rel_attr_value:AttributeValue)
|
|
115
121
|
WHERE relationship_node.name in $relationship_names
|
|
116
|
-
AND
|
|
117
|
-
|
|
122
|
+
AND [relationship_node.name, rel_attr.name] in $relationship_attr_paths
|
|
123
|
+
RETURN start_node, rel_path as potential_path, relationship_node.name as rel_identifier, rel_attr.name as potential_attr, rel_attr_value.value as potential_attr_value
|
|
124
|
+
""" % {"node_kind": self.query_request.kind}
|
|
125
|
+
|
|
126
|
+
relationship_attr_paths_with_value_subquery = """
|
|
127
|
+
MATCH rel_path = (start_node:%(node_kind)s)-[:IS_RELATED]-(relationship_node:Relationship)-[:IS_RELATED]-(related_n:Node)-[:HAS_ATTRIBUTE]->(rel_attr:Attribute)-[:HAS_VALUE]->(rel_attr_value:AttributeValue)
|
|
128
|
+
WHERE relationship_node.name in $relationship_names AND rel_attr_value.value in $relationship_attr_values
|
|
129
|
+
AND [relationship_node.name, rel_attr.name, rel_attr_value.value] in $relationship_attr_paths_with_value
|
|
118
130
|
RETURN start_node, rel_path as potential_path, relationship_node.name as rel_identifier, rel_attr.name as potential_attr, rel_attr_value.value as potential_attr_value
|
|
119
131
|
""" % {"node_kind": self.query_request.kind}
|
|
120
132
|
|
|
@@ -130,9 +142,13 @@ class NodeUniqueAttributeConstraintQuery(Query):
|
|
|
130
142
|
}
|
|
131
143
|
|
|
132
144
|
select_subqueries = []
|
|
133
|
-
if attr_paths
|
|
145
|
+
if attr_paths:
|
|
134
146
|
select_subqueries.append(attr_paths_subquery)
|
|
135
|
-
if
|
|
147
|
+
if attr_paths_with_value:
|
|
148
|
+
select_subqueries.append(attr_paths_with_value_subquery)
|
|
149
|
+
if relationship_attr_paths:
|
|
150
|
+
select_subqueries.append(relationship_attr_paths_subquery)
|
|
151
|
+
if relationship_attr_paths_with_value:
|
|
136
152
|
select_subqueries.append(relationship_attr_paths_with_value_subquery)
|
|
137
153
|
if relationship_only_attr_paths:
|
|
138
154
|
select_subqueries.append(relationship_only_attr_paths_subquery)
|
infrahub/database/__init__.py
CHANGED
|
@@ -33,9 +33,7 @@ from infrahub.exceptions import DatabaseError
|
|
|
33
33
|
from infrahub.log import get_logger
|
|
34
34
|
from infrahub.utils import InfrahubStringEnum
|
|
35
35
|
|
|
36
|
-
from .memgraph import DatabaseManagerMemgraph
|
|
37
36
|
from .metrics import CONNECTION_POOL_USAGE, QUERY_EXECUTION_METRICS, TRANSACTION_RETRIES
|
|
38
|
-
from .neo4j import DatabaseManagerNeo4j
|
|
39
37
|
|
|
40
38
|
if TYPE_CHECKING:
|
|
41
39
|
from types import TracebackType
|
|
@@ -158,11 +156,6 @@ class InfrahubDatabase:
|
|
|
158
156
|
else:
|
|
159
157
|
self.db_type = config.SETTINGS.database.db_type
|
|
160
158
|
|
|
161
|
-
if self.db_type == DatabaseType.NEO4J:
|
|
162
|
-
self.manager = DatabaseManagerNeo4j(db=self)
|
|
163
|
-
elif self.db_type == DatabaseType.MEMGRAPH:
|
|
164
|
-
self.manager = DatabaseManagerMemgraph(db=self)
|
|
165
|
-
|
|
166
159
|
def __del__(self) -> None:
|
|
167
160
|
if not self._session or not self._is_session_local or self._session.closed():
|
|
168
161
|
return
|
infrahub/database/memgraph.py
CHANGED
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
from typing import TYPE_CHECKING
|
|
4
|
-
|
|
5
3
|
from infrahub.constants.database import EntityType, IndexType
|
|
6
4
|
|
|
7
5
|
from .index import IndexInfo, IndexItem, IndexManagerBase
|
|
8
|
-
from .manager import DatabaseManager
|
|
9
|
-
|
|
10
|
-
if TYPE_CHECKING:
|
|
11
|
-
from . import InfrahubDatabase
|
|
12
6
|
|
|
13
7
|
|
|
14
8
|
class IndexNodeMemgraph(IndexItem):
|
|
@@ -52,9 +46,3 @@ class IndexManagerMemgraph(IndexManagerBase):
|
|
|
52
46
|
)
|
|
53
47
|
|
|
54
48
|
return results
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
class DatabaseManagerMemgraph(DatabaseManager):
|
|
58
|
-
def __init__(self, db: InfrahubDatabase) -> None:
|
|
59
|
-
super().__init__(db=db)
|
|
60
|
-
self.index = IndexManagerMemgraph(db=db)
|
infrahub/database/neo4j.py
CHANGED
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
from typing import TYPE_CHECKING
|
|
4
|
-
|
|
5
3
|
from infrahub.constants.database import EntityType, IndexType
|
|
6
4
|
from infrahub.core.query import QueryType
|
|
7
5
|
|
|
8
6
|
from .index import IndexInfo, IndexItem, IndexManagerBase
|
|
9
|
-
from .manager import DatabaseManager
|
|
10
|
-
|
|
11
|
-
if TYPE_CHECKING:
|
|
12
|
-
from . import InfrahubDatabase
|
|
13
7
|
|
|
14
8
|
|
|
15
9
|
class IndexRelNeo4j(IndexItem):
|
|
@@ -68,9 +62,3 @@ class IndexManagerNeo4j(IndexManagerBase):
|
|
|
68
62
|
)
|
|
69
63
|
|
|
70
64
|
return results
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
class DatabaseManagerNeo4j(DatabaseManager):
|
|
74
|
-
def __init__(self, db: InfrahubDatabase) -> None:
|
|
75
|
-
super().__init__(db=db)
|
|
76
|
-
self.index = IndexManagerNeo4j(db=db)
|
|
@@ -71,7 +71,11 @@ class UpdateComputedAttribute(Mutation):
|
|
|
71
71
|
|
|
72
72
|
if not (
|
|
73
73
|
target_node := await NodeManager.get_one(
|
|
74
|
-
db=graphql_context.db,
|
|
74
|
+
db=graphql_context.db,
|
|
75
|
+
kind=node_schema.kind,
|
|
76
|
+
id=str(data.id),
|
|
77
|
+
branch=graphql_context.branch,
|
|
78
|
+
fields={target_attribute.name: None},
|
|
75
79
|
)
|
|
76
80
|
):
|
|
77
81
|
raise NodeNotFoundError(
|
infrahub/server.py
CHANGED
|
@@ -23,7 +23,6 @@ from infrahub import __version__, config
|
|
|
23
23
|
from infrahub.api import router as api
|
|
24
24
|
from infrahub.api.exception_handlers import generic_api_exception_handler
|
|
25
25
|
from infrahub.components import ComponentType
|
|
26
|
-
from infrahub.core.graph.index import attr_value_index, node_indexes, rel_indexes
|
|
27
26
|
from infrahub.core.initialization import initialization
|
|
28
27
|
from infrahub.database import InfrahubDatabase, InfrahubDatabaseMode, get_db
|
|
29
28
|
from infrahub.dependencies.registry import build_component_registry
|
|
@@ -58,9 +57,6 @@ async def app_initialization(application: FastAPI, enable_scheduler: bool = True
|
|
|
58
57
|
|
|
59
58
|
# Initialize database Driver and load local registry
|
|
60
59
|
database = application.state.db = InfrahubDatabase(mode=InfrahubDatabaseMode.DRIVER, driver=await get_db())
|
|
61
|
-
if config.SETTINGS.experimental_features.value_db_index:
|
|
62
|
-
node_indexes.append(attr_value_index)
|
|
63
|
-
database.manager.index.init(nodes=node_indexes, rels=rel_indexes)
|
|
64
60
|
|
|
65
61
|
build_component_registry()
|
|
66
62
|
|
|
@@ -85,7 +81,7 @@ async def app_initialization(application: FastAPI, enable_scheduler: bool = True
|
|
|
85
81
|
initialize_lock(service=service)
|
|
86
82
|
# We must initialize DB after initialize lock and initialize lock depends on cache initialization
|
|
87
83
|
async with application.state.db.start_session() as db:
|
|
88
|
-
await initialization(db=db)
|
|
84
|
+
await initialization(db=db, add_database_indexes=True)
|
|
89
85
|
|
|
90
86
|
application.state.service = service
|
|
91
87
|
application.state.response_delay = config.SETTINGS.miscellaneous.response_delay
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: infrahub-server
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.9rc0
|
|
4
4
|
Summary: Infrahub is taking a new approach to Infrastructure Management by providing a new generation of datastore to organize and control all the data that defines how an infrastructure should run.
|
|
5
5
|
Home-page: https://opsmill.com
|
|
6
6
|
License: AGPL-3.0-only
|
|
@@ -27,7 +27,7 @@ infrahub/auth.py,sha256=g4pQX4kI1k-iWIQNduXODhpeZXIjY3XqLslh7QFRBq4,9194
|
|
|
27
27
|
infrahub/cli/__init__.py,sha256=zQjE9zMrwAmk_4qb5mbUgNi06g3HKvrPwQvJLQmv9JY,1814
|
|
28
28
|
infrahub/cli/constants.py,sha256=CoCeTMnfsA3j7ArdLKLZK4VPxOM7ls17qpxGJmND0m8,129
|
|
29
29
|
infrahub/cli/context.py,sha256=20CJj_D1VhigR9uhTDPHiVHnV7vzsgK8v-uLKs06kzA,398
|
|
30
|
-
infrahub/cli/db.py,sha256=
|
|
30
|
+
infrahub/cli/db.py,sha256=XmXcCJ0mRyLY22VliCQ_m2M4Xhy53Y9gPNLZHM4IDwU,28414
|
|
31
31
|
infrahub/cli/events.py,sha256=nJmowQgTxRs6qaT41A71Ei9jm6qtYaL2amAT5TA1H_k,1726
|
|
32
32
|
infrahub/cli/git_agent.py,sha256=ajT9-kdd3xLIysOPe8GqZyCDMkpNyhqfWjBg9HPWVcg,5240
|
|
33
33
|
infrahub/cli/patch.py,sha256=ztOkWyo0l_Wo0WX10bvSqGZibKzowrwx82oi69cjwkY,6018
|
|
@@ -121,7 +121,7 @@ infrahub/core/graph/__init__.py,sha256=vg81QN-hmdl7ziUJird8wna034Z7HFur47608Dflj
|
|
|
121
121
|
infrahub/core/graph/constraints.py,sha256=lmuzrKDFoeSKRiLtycB9PXi6zhMYghczKrPYvfWyy90,10396
|
|
122
122
|
infrahub/core/graph/index.py,sha256=IHLP-zPRp7HJYLGHMRDRXQp8RC69ztP10Tr5NcL2j4Y,1736
|
|
123
123
|
infrahub/core/graph/schema.py,sha256=FmEPPb1XOFv3nnS_XJCuUqlp8HsStX5A2frHjlhoqvE,10105
|
|
124
|
-
infrahub/core/initialization.py,sha256=
|
|
124
|
+
infrahub/core/initialization.py,sha256=6xbY4D17hnnriycBud4JcLDUB5e-pJJJ-z6H-77xv8w,20730
|
|
125
125
|
infrahub/core/integrity/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
126
126
|
infrahub/core/integrity/object_conflict/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
127
127
|
infrahub/core/integrity/object_conflict/conflict_recorder.py,sha256=gDOx-Ohle0GxfsNm-FEaBMipaQLMxMVg3BoAHEhuK5E,6125
|
|
@@ -150,7 +150,7 @@ infrahub/core/migrations/graph/m010_add_generate_profile_attr_generic.py,sha256=
|
|
|
150
150
|
infrahub/core/migrations/graph/m011_remove_profile_relationship_schema.py,sha256=TYQ1jXNucLIBbqLS35nUb_72OmMspXexSSW83Ax0oEw,1980
|
|
151
151
|
infrahub/core/migrations/graph/m012_convert_account_generic.py,sha256=XvOKS0CSJSOdXQfan7N_Nrak6CB75r9xyT5rErUb61w,10998
|
|
152
152
|
infrahub/core/migrations/graph/m013_convert_git_password_credential.py,sha256=-3tPM6RDPFlx0YFEohPTKUjvPsCNK-Q171PFCVmb5d4,12818
|
|
153
|
-
infrahub/core/migrations/graph/m014_remove_index_attr_value.py,sha256=
|
|
153
|
+
infrahub/core/migrations/graph/m014_remove_index_attr_value.py,sha256=Amds1gl8YtNIekU0tSXpHzdfk8UFqChC2LOLfnQ1YTM,1441
|
|
154
154
|
infrahub/core/migrations/graph/m015_diff_format_update.py,sha256=DETKst0UNXmuE0aQJep1SJxukajZSK8avF9Z-c0W4ME,1267
|
|
155
155
|
infrahub/core/migrations/graph/m016_diff_delete_bug_fix.py,sha256=hcnJN3dOoDfbKcEzlRPew2XbJ-hqsEsjkDSGEnjwbFs,1275
|
|
156
156
|
infrahub/core/migrations/graph/m017_add_core_profile.py,sha256=Z_--D73C8aUtmZPh1okxhY3ipf66vsLcvuIi6LphDTo,1361
|
|
@@ -307,13 +307,12 @@ infrahub/core/validators/uniqueness/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQ
|
|
|
307
307
|
infrahub/core/validators/uniqueness/checker.py,sha256=RpiLpIjbdkwwjivry-vjEkVim6ZoC-t2H5Bal7ngASQ,10375
|
|
308
308
|
infrahub/core/validators/uniqueness/index.py,sha256=Jw1o-UVinQquNduZ5vCCzt8GUfIEdVzBo-1XyRti8F8,5068
|
|
309
309
|
infrahub/core/validators/uniqueness/model.py,sha256=V2aejcuHPhgC5nTrS7xX0JFMzprVu90QAau-rUzruCY,5135
|
|
310
|
-
infrahub/core/validators/uniqueness/query.py,sha256=
|
|
311
|
-
infrahub/database/__init__.py,sha256=
|
|
310
|
+
infrahub/core/validators/uniqueness/query.py,sha256=gx2eInPf4GA4Q9U5oyyHYNPfCK-UxgW7704uk_XMM0o,11665
|
|
311
|
+
infrahub/database/__init__.py,sha256=yDdkliw-BS7aj7akxvURIoaS_LCgBaz2vss_I9O0dH8,20544
|
|
312
312
|
infrahub/database/index.py,sha256=ATLqw9Grqbq7haGGm14VSEPmcPniid--YATiffo4sA0,1676
|
|
313
|
-
infrahub/database/
|
|
314
|
-
infrahub/database/memgraph.py,sha256=9-SHIVsb5BhufpJU09kr4UFFfo2lBo09-jbP2zPtgFg,2052
|
|
313
|
+
infrahub/database/memgraph.py,sha256=Fg3xHP9s0MiBBmMvcEmsJvuIUSq8U_XCS362HDE9d1s,1742
|
|
315
314
|
infrahub/database/metrics.py,sha256=xU4OSKFbsxcw_yZlt_39PmGtF7S7yPbPuOIlSCu5sI0,739
|
|
316
|
-
infrahub/database/neo4j.py,sha256=
|
|
315
|
+
infrahub/database/neo4j.py,sha256=ou7PGE9rbcVD4keBEFCDFm30MEexnijbZOo3kqrfW3k,2337
|
|
317
316
|
infrahub/dependencies/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
318
317
|
infrahub/dependencies/builder/constraint/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
319
318
|
infrahub/dependencies/builder/constraint/grouped/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -432,7 +431,7 @@ infrahub/graphql/mutations/account.py,sha256=O3KktPQcTW-fcH0g9oMxIDxLTpcIlgVfgJF
|
|
|
432
431
|
infrahub/graphql/mutations/artifact_definition.py,sha256=OQWSjPl88X0EetGpMXl3TLCJBAfXbts3foxNJObjkX0,3427
|
|
433
432
|
infrahub/graphql/mutations/attribute.py,sha256=a35MP8Pvy_42N5dkO3HKATgJDW6qy9ncDu5t8YI3AUE,2734
|
|
434
433
|
infrahub/graphql/mutations/branch.py,sha256=ixL_B-IQOStt7GYfSl6uJi4NIluN7dEWd5xlvam-mTI,10693
|
|
435
|
-
infrahub/graphql/mutations/computed_attribute.py,sha256=
|
|
434
|
+
infrahub/graphql/mutations/computed_attribute.py,sha256=T3ir4izEe44zSk63kEXJgYpJki-5vbTj14ulLuklxzM,4666
|
|
436
435
|
infrahub/graphql/mutations/diff.py,sha256=UfEkgIeKsxr79U0_ih7mhl0986rFITM_GDXevsWBSqo,4776
|
|
437
436
|
infrahub/graphql/mutations/diff_conflict.py,sha256=JngQfyKXCVlmtlqQ_VyabmrOEDOEKYsoWbyYSc9TT5c,3147
|
|
438
437
|
infrahub/graphql/mutations/generator.py,sha256=Ulw4whZm8Gc8lJjwfUFoFSsR0cOUliFKl87Oca4B9O0,3579
|
|
@@ -582,7 +581,7 @@ infrahub/serve/__init__.py,sha256=cWzvEH-Zwr1nQsoNJO9q1pef5KLuSK3VQLOumlnsQxk,73
|
|
|
582
581
|
infrahub/serve/gunicorn_config.py,sha256=BkClF6yjz-sIhZ-oDizXUmGSEE-FQSmy21JfVnRI5tA,102
|
|
583
582
|
infrahub/serve/log.py,sha256=qUidwbtE5AlyLHnWKVoEggOoHKhfMMjYlUH1d-iGwqg,953
|
|
584
583
|
infrahub/serve/worker.py,sha256=nNGQORkUM474UiFNfb0GBHo2vx-NuAuZCcscwoKnGwE,1371
|
|
585
|
-
infrahub/server.py,sha256=
|
|
584
|
+
infrahub/server.py,sha256=cogLT_ahijWhPbWfjsMGBT11TDjbXAdGEOzWIQAMv_M,8010
|
|
586
585
|
infrahub/services/__init__.py,sha256=WQ9s6y0YFNrP8rRndKqQAB7iJa4-Q-5KvHxUXS4xlQA,7036
|
|
587
586
|
infrahub/services/adapters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
588
587
|
infrahub/services/adapters/cache/__init__.py,sha256=QPHboyYJU3TkNQRGnXR8e12ktVj1tCoyEEVQr2cW05E,1816
|
|
@@ -758,8 +757,8 @@ infrahub_sdk/uuidt.py,sha256=Tz-4nHkJwbi39UT3gaIe2wJeZNAoBqf6tm3sw7LZbXc,2155
|
|
|
758
757
|
infrahub_sdk/yaml.py,sha256=512OKgxAYPt4QLBFlucUB4GgwKJ09dzgC86pO57YFFw,5018
|
|
759
758
|
infrahub_testcontainers/__init__.py,sha256=oPpmesGgYBSdKTg1L37FGwYBeao1EHury5SJGul-CT8,216
|
|
760
759
|
infrahub_testcontainers/constants.py,sha256=mZ4hLvcf4rKk9wC7EId4MQxAY0sk4V99deB04N0J2bg,85
|
|
761
|
-
infrahub_testcontainers/container.py,sha256
|
|
762
|
-
infrahub_testcontainers/docker-compose.test.yml,sha256=
|
|
760
|
+
infrahub_testcontainers/container.py,sha256=-NccmHKJw8rnGY4nSgqIJdGBrX8eObi9kq7q7mQz1zs,12308
|
|
761
|
+
infrahub_testcontainers/docker-compose.test.yml,sha256=3rUOn2UB_n5z_XlYykO6c6j35OMgyvZXwVSFqlem54Y,8465
|
|
763
762
|
infrahub_testcontainers/haproxy.cfg,sha256=QUkG2Xu-hKoknPOeYKAkBT_xJH6U9CfIS0DTMFZJsnk,1305
|
|
764
763
|
infrahub_testcontainers/helpers.py,sha256=zsvBOql5qM2OX1ybPcklqF-nzWYHkZI3Gk3KZhxWOtU,3578
|
|
765
764
|
infrahub_testcontainers/host.py,sha256=Z4_gGoGKKeM_HGVS7SdYL1FTNGyLBk8wzicdSKHpfmM,1486
|
|
@@ -768,8 +767,8 @@ infrahub_testcontainers/models.py,sha256=ASYyvl7d_WQz_i7y8-3iab9hwwmCl3OCJavqVbe
|
|
|
768
767
|
infrahub_testcontainers/performance_test.py,sha256=CZ0YeGqnc9RCEPPk5-jFh0b0zFz-DYweOBF-Lfo0bc8,6037
|
|
769
768
|
infrahub_testcontainers/plugin.py,sha256=g24SMg4EAqVe2N8i9F66EV34cNqIdDU4mRP7OeOJO1w,5381
|
|
770
769
|
infrahub_testcontainers/prometheus.yml,sha256=610xQEyj3xuVJMzPkC4m1fRnCrjGpiRBrXA2ytCLa54,599
|
|
771
|
-
infrahub_server-1.2.
|
|
772
|
-
infrahub_server-1.2.
|
|
773
|
-
infrahub_server-1.2.
|
|
774
|
-
infrahub_server-1.2.
|
|
775
|
-
infrahub_server-1.2.
|
|
770
|
+
infrahub_server-1.2.9rc0.dist-info/LICENSE.txt,sha256=TfPDBt3ar0uv_f9cqCDMZ5rIzW3CY8anRRd4PkL6ejs,34522
|
|
771
|
+
infrahub_server-1.2.9rc0.dist-info/METADATA,sha256=TIOicC4ngay7aqMkXrQgH8F2VbmFQhQlAVh4rRs7y8o,8192
|
|
772
|
+
infrahub_server-1.2.9rc0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
773
|
+
infrahub_server-1.2.9rc0.dist-info/entry_points.txt,sha256=UXIeFWDsrV-4IllNvUEd6KieYGzQfn9paga2YyABOQI,393
|
|
774
|
+
infrahub_server-1.2.9rc0.dist-info/RECORD,,
|
|
@@ -130,6 +130,7 @@ services:
|
|
|
130
130
|
INFRAHUB_TRACE_EXPORTER_PROTOCOL: ${INFRAHUB_TRACE_EXPORTER_PROTOCOL:-grpc}
|
|
131
131
|
INFRAHUB_TRACE_EXPORTER_TYPE: ${INFRAHUB_TRACE_EXPORTER_TYPE:-console}
|
|
132
132
|
INFRAHUB_TRACE_INSECURE: ${INFRAHUB_TRACE_INSECURE:-true}
|
|
133
|
+
INFRAHUB_SCHEMA_STRICT_MODE: ${INFRAHUB_TESTING_SCHEMA_STRICT_MODE}
|
|
133
134
|
OTEL_RESOURCE_ATTRIBUTES:
|
|
134
135
|
depends_on:
|
|
135
136
|
database:
|
|
@@ -177,6 +178,7 @@ services:
|
|
|
177
178
|
INFRAHUB_TRACE_EXPORTER_PROTOCOL: ${INFRAHUB_TRACE_EXPORTER_PROTOCOL:-grpc}
|
|
178
179
|
INFRAHUB_TRACE_EXPORTER_TYPE: ${INFRAHUB_TRACE_EXPORTER_TYPE:-console}
|
|
179
180
|
INFRAHUB_TRACE_INSECURE: ${INFRAHUB_TRACE_INSECURE:-true}
|
|
181
|
+
INFRAHUB_SCHEMA_STRICT_MODE: ${INFRAHUB_TESTING_SCHEMA_STRICT_MODE}
|
|
180
182
|
OTEL_RESOURCE_ATTRIBUTES:
|
|
181
183
|
depends_on:
|
|
182
184
|
- infrahub-server
|
infrahub/database/manager.py
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from abc import ABC
|
|
4
|
-
from typing import TYPE_CHECKING
|
|
5
|
-
|
|
6
|
-
if TYPE_CHECKING:
|
|
7
|
-
from . import InfrahubDatabase
|
|
8
|
-
from .index import IndexManagerBase
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class DatabaseManager(ABC):
|
|
12
|
-
index: IndexManagerBase
|
|
13
|
-
|
|
14
|
-
def __init__(self, db: InfrahubDatabase) -> None:
|
|
15
|
-
self.db = db
|
|
File without changes
|
|
File without changes
|
|
File without changes
|