Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasG0 committed Dec 3, 2024
1 parent 6e85638 commit a23db45
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 15 deletions.
4 changes: 0 additions & 4 deletions .github/CODEOWNERS

This file was deleted.

2 changes: 1 addition & 1 deletion backend/infrahub/core/branch/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ async def rebase_branch(branch: str) -> None:
# NOTE there is a bit additional work in order to calculate a proper diff that will
# allow us to pull only the part of the schema that has changed, for now the safest option is to pull
# Everything
# schema_diff = await merger.has_schema_changes()a
# schema_diff = await merger.has_schema_changes()
# TODO Would be good to convert this part to a Prefect Task in order to track it properly
updated_schema = await registry.schema.load_schema_from_db(
db=service.database,
Expand Down
3 changes: 3 additions & 0 deletions backend/infrahub/workflows/catalogue.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,9 @@
BRANCH_VALIDATE,
COMPUTED_ATTRIBUTE_SETUP,
COMPUTED_ATTRIBUTE_SETUP_PYTHON,
DIFF_REFRESH,
DIFF_REFRESH_ALL,
DIFF_UPDATE,
GIT_REPOSITORIES_CREATE_BRANCH,
GIT_REPOSITORIES_DIFF_NAMES_ONLY,
GIT_REPOSITORIES_IMPORT_OBJECTS,
Expand Down
2 changes: 1 addition & 1 deletion backend/tests/helpers/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from infrahub_sdk.utils import str_to_bool

INFRAHUB_USE_TEST_CONTAINERS = str_to_bool(os.getenv("INFRAHUB_USE_TEST_CONTAINERS", "false"))
INFRAHUB_USE_TEST_CONTAINERS = str_to_bool(os.getenv("INFRAHUB_USE_TEST_CONTAINERS", "true"))
PORT_NATS = 4222
PORT_REDIS = 6379
PORT_CLIENT_RABBITMQ = 5672
Expand Down
5 changes: 0 additions & 5 deletions backend/tests/helpers/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,24 +78,20 @@ async def workflow_local(self) -> AsyncGenerator[WorkflowLocalExecution, None]:

@pytest.fixture(scope="class")
async def register_internal_schema(self, db: InfrahubDatabase, default_branch: Branch) -> SchemaBranch:
print(f"start of register_internal_schema: {id(default_branch)=} and {id(registry.branch["main"])=}")
schema = SchemaRoot(**internal_schema)
schema_branch = registry.schema.register_schema(schema=schema, branch=default_branch.name)
default_branch.update_schema_hash()
await default_branch.save(db=db)
print(f"end of register_internal_schema: {id(default_branch)=} and {id(registry.branch["main"])=}")
return schema_branch

@pytest.fixture(scope="class")
async def register_core_schema(
self, db: InfrahubDatabase, default_branch: Branch, register_internal_schema: SchemaBranch
) -> SchemaBranch:
print(f"start of register_core_schema: {id(default_branch)=} and {id(registry.branch["main"])=}")
schema = SchemaRoot(**core_models)
schema_branch = registry.schema.register_schema(schema=schema, branch=default_branch.name)
default_branch.update_schema_hash()
await default_branch.save(db=db)
print(f"end of register_core_schema: {id(default_branch)=} and {id(registry.branch["main"])=}")
return schema_branch

@pytest.fixture(scope="class")
Expand Down Expand Up @@ -139,7 +135,6 @@ async def client(
async def initialize_registry(
self, db: InfrahubDatabase, register_core_schema: SchemaBranch, bus_simulator: BusSimulator, api_token: str
) -> None:
print(f"start of initialize_registry:{id(registry.branch["main"])=}")
admin_account = await create_account(
db=db, name="admin", password=config.SETTINGS.initial.admin_password, token_value=api_token
)
Expand Down
4 changes: 3 additions & 1 deletion backend/tests/integration/ipam/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from infrahub.database import InfrahubDatabase


class TestIpamReconcileBase(TestInfrahubApp):
class TestIpam(TestInfrahubApp):
@pytest.fixture(scope="class")
async def register_ipam_schema(
self, initialize_registry, ipam_schema: SchemaRoot, client: InfrahubClient
Expand All @@ -32,6 +32,8 @@ async def register_ipam_schema(
registry.get_branch_from_registry(default_branch_name).update_schema_hash()
return schema_branch


class TestIpamReconcileBase(TestIpam):
@pytest.fixture(scope="class")
async def initial_dataset(
self,
Expand Down
4 changes: 2 additions & 2 deletions backend/tests/integration/ipam/test_ipam_utilization.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from infrahub.core.node import Node
from infrahub.graphql.initialization import prepare_graphql_params
from tests.helpers.graphql import graphql
from tests.helpers.test_app import TestInfrahubApp
from tests.integration.ipam.base import TestIpam

if TYPE_CHECKING:
from infrahub.core.branch import Branch
Expand Down Expand Up @@ -56,7 +56,7 @@
}"""


class TestIpamUtilization(TestInfrahubApp):
class TestIpamUtilization(TestIpam):
@pytest.fixture(scope="class")
async def initial_dataset(
self,
Expand Down
1 change: 0 additions & 1 deletion changelog/+schema-rename-diff.fixed.md

This file was deleted.

0 comments on commit a23db45

Please sign in to comment.