From 310296bc143c56cb1afe6a36a192ca371a9d2211 Mon Sep 17 00:00:00 2001 From: Sola Infrahub User Date: Thu, 27 Nov 2025 11:00:21 +0100 Subject: [PATCH 1/2] merge develop to infrahub-develop --- changelog/+08aa1a85.removed.md | 1 + infrahub_sdk/node/attribute.py | 3 +- infrahub_sdk/node/constants.py | 2 +- infrahub_sdk/protocols_base.py | 1 - infrahub_sdk/schema/__init__.py | 3 -- tests/unit/sdk/conftest.py | 85 ++++----------------------------- tests/unit/sdk/test_node.py | 52 +++----------------- 7 files changed, 18 insertions(+), 129 deletions(-) create mode 100644 changelog/+08aa1a85.removed.md diff --git a/changelog/+08aa1a85.removed.md b/changelog/+08aa1a85.removed.md new file mode 100644 index 00000000..c87698d2 --- /dev/null +++ b/changelog/+08aa1a85.removed.md @@ -0,0 +1 @@ +Remove `is_visible` property from infrahub diff --git a/infrahub_sdk/node/attribute.py b/infrahub_sdk/node/attribute.py index c1dd3111..60034572 100644 --- a/infrahub_sdk/node/attribute.py +++ b/infrahub_sdk/node/attribute.py @@ -53,8 +53,7 @@ def __init__(self, name: str, schema: AttributeSchemaAPI, data: Any | dict) -> N self.is_inherited: bool | None = data.get("is_inherited") self.updated_at: str | None = data.get("updated_at") - self.is_visible: bool | None = data.get("is_visible") - self.is_protected: bool | None = data.get("is_protected") + self.is_protected: bool | None = data.get("is_protected", None) self.source: NodeProperty | None = None self.owner: NodeProperty | None = None diff --git a/infrahub_sdk/node/constants.py b/infrahub_sdk/node/constants.py index 2d3b02ec..cfb9f67a 100644 --- a/infrahub_sdk/node/constants.py +++ b/infrahub_sdk/node/constants.py @@ -1,7 +1,7 @@ import ipaddress import re -PROPERTIES_FLAG = ["is_visible", "is_protected"] +PROPERTIES_FLAG = ["is_protected"] PROPERTIES_OBJECT = ["source", "owner"] SAFE_VALUE = re.compile(r"(^[\. /:a-zA-Z0-9_-]+$)|(^$)") diff --git a/infrahub_sdk/protocols_base.py b/infrahub_sdk/protocols_base.py index a3daa1fb..8a841b5b 100644 --- a/infrahub_sdk/protocols_base.py +++ b/infrahub_sdk/protocols_base.py @@ -56,7 +56,6 @@ class Attribute(Protocol): is_from_profile: bool | None is_inherited: bool | None updated_at: str | None - is_visible: bool | None is_protected: bool | None diff --git a/infrahub_sdk/schema/__init__.py b/infrahub_sdk/schema/__init__.py index af378f8d..3e61ad2a 100644 --- a/infrahub_sdk/schema/__init__.py +++ b/infrahub_sdk/schema/__init__.py @@ -154,7 +154,6 @@ def generate_payload_create( source: str | None = None, owner: str | None = None, is_protected: bool | None = None, - is_visible: bool | None = None, ) -> dict[str, Any]: obj_data: dict[str, Any] = {} item_metadata: dict[str, Any] = {} @@ -164,8 +163,6 @@ def generate_payload_create( item_metadata["owner"] = str(owner) if is_protected is not None: item_metadata["is_protected"] = is_protected - if is_visible is not None: - item_metadata["is_visible"] = is_visible for key, value in data.items(): obj_data[key] = {} diff --git a/tests/unit/sdk/conftest.py b/tests/unit/sdk/conftest.py index c41f9b8d..59fe6b8d 100644 --- a/tests/unit/sdk/conftest.py +++ b/tests/unit/sdk/conftest.py @@ -309,21 +309,18 @@ async def location_data01_no_pagination() -> dict[str, Any]: "display_label": "dfw1", "name": { "is_protected": True, - "is_visible": True, "owner": None, "source": None, "value": "DFW", }, "description": { "is_protected": False, - "is_visible": True, "owner": None, "source": None, "value": None, }, "type": { "is_protected": True, - "is_visible": True, "owner": None, "source": None, "value": "SITE", @@ -333,7 +330,6 @@ async def location_data01_no_pagination() -> dict[str, Any]: "display_label": "red", "__typename": "RelatedTag", "_relation__is_protected": True, - "_relation__is_visible": True, "_relation__owner": None, "_relation__source": None, }, @@ -343,7 +339,6 @@ async def location_data01_no_pagination() -> dict[str, Any]: "display_label": "blue", "__typename": "RelatedTag", "_relation__is_protected": True, - "_relation__is_visible": True, "_relation__owner": None, "_relation__source": None, } @@ -359,7 +354,6 @@ async def location_data02_no_pagination() -> dict[str, Any]: "display_label": "dfw1", "name": { "is_protected": True, - "is_visible": True, "owner": None, "source": { "__typename": "Account", @@ -370,14 +364,12 @@ async def location_data02_no_pagination() -> dict[str, Any]: }, "description": { "is_protected": False, - "is_visible": True, "owner": None, "source": None, "value": None, }, "type": { "is_protected": True, - "is_visible": True, "owner": None, "source": { "__typename": "Account", @@ -391,7 +383,6 @@ async def location_data02_no_pagination() -> dict[str, Any]: "display_label": "red", "__typename": "RelatedTag", "_relation__is_protected": True, - "_relation__is_visible": True, "_relation__owner": None, "_relation__source": { "__typename": "Account", @@ -405,7 +396,6 @@ async def location_data02_no_pagination() -> dict[str, Any]: "display_label": "blue", "__typename": "RelatedTag", "_relation__is_protected": True, - "_relation__is_visible": True, "_relation__owner": None, "_relation__source": { "__typename": "Account", @@ -465,21 +455,18 @@ async def location_data01_property() -> dict[str, Any]: "display_label": "dfw1", "name": { "is_protected": True, - "is_visible": True, "owner": None, "source": None, "value": "DFW", }, "description": { "is_protected": False, - "is_visible": True, "owner": None, "source": None, "value": None, }, "type": { "is_protected": True, - "is_visible": True, "owner": None, "source": None, "value": "SITE", @@ -487,7 +474,6 @@ async def location_data01_property() -> dict[str, Any]: "primary_tag": { "properties": { "is_protected": True, - "is_visible": True, "owner": None, "source": None, }, @@ -503,7 +489,6 @@ async def location_data01_property() -> dict[str, Any]: { "properties": { "is_protected": True, - "is_visible": True, "owner": None, "source": None, }, @@ -567,7 +552,6 @@ async def location_data02_property() -> dict[str, Any]: "display_label": "dfw1", "name": { "is_protected": True, - "is_visible": True, "owner": None, "source": { "__typename": "Account", @@ -578,14 +562,12 @@ async def location_data02_property() -> dict[str, Any]: }, "description": { "is_protected": False, - "is_visible": True, "owner": None, "source": None, "value": None, }, "type": { "is_protected": True, - "is_visible": True, "owner": None, "source": { "__typename": "Account", @@ -597,7 +579,6 @@ async def location_data02_property() -> dict[str, Any]: "primary_tag": { "properties": { "is_protected": True, - "is_visible": True, "owner": None, "source": { "__typename": "Account", @@ -617,7 +598,6 @@ async def location_data02_property() -> dict[str, Any]: { "properties": { "is_protected": True, - "is_visible": True, "owner": None, "source": { "__typename": "Account", @@ -681,7 +661,6 @@ async def tag_blue_data_no_pagination() -> dict[str, Any]: "display_label": "blue", "name": { "is_protected": False, - "is_visible": True, "owner": None, "source": { "__typename": "Account", @@ -692,7 +671,6 @@ async def tag_blue_data_no_pagination() -> dict[str, Any]: }, "description": { "is_protected": False, - "is_visible": True, "owner": None, "source": None, "value": None, @@ -708,7 +686,6 @@ async def tag_red_data_no_pagination() -> dict[str, Any]: "display_label": "red", "name": { "is_protected": False, - "is_visible": True, "owner": None, "source": { "__typename": "Account", @@ -719,7 +696,6 @@ async def tag_red_data_no_pagination() -> dict[str, Any]: }, "description": { "is_protected": False, - "is_visible": True, "owner": None, "source": None, "value": None, @@ -735,7 +711,6 @@ async def tag_green_data_no_pagination() -> dict[str, Any]: "display_label": "green", "name": { "is_protected": False, - "is_visible": True, "owner": None, "source": { "__typename": "Account", @@ -746,7 +721,6 @@ async def tag_green_data_no_pagination() -> dict[str, Any]: }, "description": { "is_protected": False, - "is_visible": True, "owner": None, "source": None, "value": None, @@ -763,7 +737,6 @@ async def tag_blue_data() -> dict[str, Any]: "display_label": "blue", "name": { "is_protected": False, - "is_visible": True, "owner": None, "source": { "__typename": "Account", @@ -774,7 +747,6 @@ async def tag_blue_data() -> dict[str, Any]: }, "description": { "is_protected": False, - "is_visible": True, "owner": None, "source": None, "value": None, @@ -792,7 +764,6 @@ async def tag_red_data() -> dict[str, Any]: "display_label": "red", "name": { "is_protected": False, - "is_visible": True, "owner": None, "source": { "__typename": "Account", @@ -803,7 +774,6 @@ async def tag_red_data() -> dict[str, Any]: }, "description": { "is_protected": False, - "is_visible": True, "owner": None, "source": None, "value": None, @@ -821,7 +791,6 @@ async def tag_green_data() -> dict[str, Any]: "display_label": "green", "name": { "is_protected": False, - "is_visible": True, "owner": None, "source": { "__typename": "Account", @@ -832,7 +801,6 @@ async def tag_green_data() -> dict[str, Any]: }, "description": { "is_protected": False, - "is_visible": True, "owner": None, "source": None, "value": None, @@ -983,7 +951,6 @@ async def ipam_ipprefix_data() -> dict[str, Any]: "display_label": "192.0.2.0/24", "prefix": { "is_protected": True, - "is_visible": True, "owner": None, "source": { "__typename": "Account", @@ -994,14 +961,12 @@ async def ipam_ipprefix_data() -> dict[str, Any]: }, "description": { "is_protected": False, - "is_visible": True, "owner": None, "source": None, "value": None, }, "member_type": { "is_protected": True, - "is_visible": True, "owner": None, "source": { "__typename": "Account", @@ -1012,7 +977,6 @@ async def ipam_ipprefix_data() -> dict[str, Any]: }, "is_pool": { "is_protected": True, - "is_visible": True, "owner": None, "source": { "__typename": "Account", @@ -1024,7 +988,6 @@ async def ipam_ipprefix_data() -> dict[str, Any]: "ip_namespace": { "properties": { "is_protected": True, - "is_visible": True, "owner": None, "source": { "__typename": "Account", @@ -1179,28 +1142,24 @@ async def address_data() -> dict[str, Any]: "display_label": "test_address", "street_number": { "is_protected": False, - "is_visible": True, "owner": None, "source": None, "value": "1234", }, "street_name": { "is_protected": False, - "is_visible": True, "owner": None, "source": None, "value": "Fake Street", }, "postal_code": { "is_protected": False, - "is_visible": True, "owner": None, "source": None, "value": "123ABC", }, "computed_address": { "is_protected": False, - "is_visible": True, "owner": None, "source": None, "value": "1234 Fake Street 123ABC", @@ -1268,7 +1227,6 @@ async def device_data() -> dict[str, Any]: "__typename": "InfraDevice", "name": { "value": "atl1-edge1", - "is_visible": True, "is_protected": True, "source": { "id": "1799f644-d5eb-8e37-3403-c512518ae06a", @@ -1277,10 +1235,9 @@ async def device_data() -> dict[str, Any]: }, "owner": None, }, - "description": {"value": None, "is_visible": True, "is_protected": False, "source": None, "owner": None}, + "description": {"value": None, "is_protected": False, "source": None, "owner": None}, "type": { "value": "7280R3", - "is_visible": True, "is_protected": False, "source": { "id": "1799f644-d5eb-8e37-3403-c512518ae06a", @@ -1296,7 +1253,6 @@ async def device_data() -> dict[str, Any]: "__typename": "BuiltinLocation", }, "properties": { - "is_visible": True, "is_protected": True, "source": { "id": "1799f644-d5eb-8e37-3403-c512518ae06a", @@ -1313,7 +1269,6 @@ async def device_data() -> dict[str, Any]: "__typename": "BuiltinStatus", }, "properties": { - "is_visible": True, "is_protected": None, "source": None, "owner": { @@ -1330,7 +1285,6 @@ async def device_data() -> dict[str, Any]: "__typename": "BuiltinRole", }, "properties": { - "is_visible": True, "is_protected": True, "source": { "id": "1799f644-d5eb-8e37-3403-c512518ae06a", @@ -1351,7 +1305,6 @@ async def device_data() -> dict[str, Any]: "__typename": "InfraAutonomousSystem", }, "properties": { - "is_visible": True, "is_protected": True, "source": { "id": "1799f644-d5eb-8e37-3403-c512518ae06a", @@ -1374,7 +1327,7 @@ async def device_data() -> dict[str, Any]: "display_label": "green", "__typename": "BuiltinTag", }, - "properties": {"is_visible": True, "is_protected": None, "source": None, "owner": None}, + "properties": {"is_protected": None, "source": None, "owner": None}, }, { "node": { @@ -1382,7 +1335,7 @@ async def device_data() -> dict[str, Any]: "display_label": "red", "__typename": "BuiltinTag", }, - "properties": {"is_visible": True, "is_protected": None, "source": None, "owner": None}, + "properties": {"is_protected": None, "source": None, "owner": None}, }, ], }, @@ -1392,7 +1345,7 @@ async def device_data() -> dict[str, Any]: "display_label": "172.20.20.20/24", "__typename": "InfraIPAddress", }, - "properties": {"is_visible": True, "is_protected": None, "source": None, "owner": None}, + "properties": {"is_protected": None, "source": None, "owner": None}, }, "platform": { "node": { @@ -1401,7 +1354,6 @@ async def device_data() -> dict[str, Any]: "__typename": "InfraPlatform", }, "properties": { - "is_visible": True, "is_protected": True, "source": { "id": "1799f644-d5eb-8e37-3403-c512518ae06a", @@ -1441,7 +1393,6 @@ async def artifact_definition_data() -> dict[str, Any]: "__typename": "CoreArtifactDefinition", "name": { "value": "Startup Config for Edge devices", - "is_visible": True, "is_protected": True, "source": { "id": "1799fd6b-f0a9-9d23-304d-c51b05d142c5", @@ -1452,7 +1403,6 @@ async def artifact_definition_data() -> dict[str, Any]: }, "artifact_name": { "value": "startup-config", - "is_visible": True, "is_protected": True, "source": { "id": "1799fd6b-f0a9-9d23-304d-c51b05d142c5", @@ -1917,42 +1867,36 @@ async def mock_rest_api_artifact_fetch(httpx_mock: HTTPXMock) -> HTTPXMock: "__typename": "CoreArtifact", "name": { "value": "Startup Config for Edge devices", - "is_visible": True, "is_protected": False, "source": None, "owner": None, }, "status": { "value": "Ready", - "is_visible": True, "is_protected": False, "source": None, "owner": None, }, "content_type": { "value": "text/plain", - "is_visible": True, "is_protected": False, "source": None, "owner": None, }, "checksum": { "value": "58d949c1a1c0fcd06e79bc032be8373a", - "is_visible": True, "is_protected": False, "source": None, "owner": None, }, "storage_id": { "value": "1799fd71-950c-5a85-3041-c515082800ff", - "is_visible": True, "is_protected": False, "source": None, "owner": None, }, "parameters": { "value": None, - "is_visible": True, "is_protected": False, "source": None, "owner": None, @@ -1963,7 +1907,7 @@ async def mock_rest_api_artifact_fetch(httpx_mock: HTTPXMock) -> HTTPXMock: "display_label": "atl1-edge1", "__typename": "InfraDevice", }, - "properties": {"is_visible": True, "is_protected": None, "source": None, "owner": None}, + "properties": {"is_protected": None, "source": None, "owner": None}, }, "definition": { "node": { @@ -1971,7 +1915,7 @@ async def mock_rest_api_artifact_fetch(httpx_mock: HTTPXMock) -> HTTPXMock: "display_label": "Startup Config for Edge devices", "__typename": "CoreArtifactDefinition", }, - "properties": {"is_visible": True, "is_protected": None, "source": None, "owner": None}, + "properties": {"is_protected": None, "source": None, "owner": None}, }, }, ] @@ -2010,42 +1954,36 @@ async def mock_rest_api_artifact_generate(httpx_mock: HTTPXMock, schema_query_04 "__typename": "CoreArtifact", "name": { "value": "Startup Config for Edge devices", - "is_visible": True, "is_protected": False, "source": None, "owner": None, }, "status": { "value": "Ready", - "is_visible": True, "is_protected": False, "source": None, "owner": None, }, "content_type": { "value": "text/plain", - "is_visible": True, "is_protected": False, "source": None, "owner": None, }, "checksum": { "value": "58d949c1a1c0fcd06e79bc032be8373a", - "is_visible": True, "is_protected": False, "source": None, "owner": None, }, "storage_id": { "value": "1799fd71-950c-5a85-3041-c515082800ff", - "is_visible": True, "is_protected": False, "source": None, "owner": None, }, "parameters": { "value": None, - "is_visible": True, "is_protected": False, "source": None, "owner": None, @@ -2056,7 +1994,7 @@ async def mock_rest_api_artifact_generate(httpx_mock: HTTPXMock, schema_query_04 "display_label": "atl1-edge1", "__typename": "InfraDevice", }, - "properties": {"is_visible": True, "is_protected": None, "source": None, "owner": None}, + "properties": {"is_protected": None, "source": None, "owner": None}, }, "definition": { "node": { @@ -2064,7 +2002,7 @@ async def mock_rest_api_artifact_generate(httpx_mock: HTTPXMock, schema_query_04 "display_label": "Startup Config for Edge devices", "__typename": "CoreArtifactDefinition", }, - "properties": {"is_visible": True, "is_protected": None, "source": None, "owner": None}, + "properties": {"is_protected": None, "source": None, "owner": None}, }, }, ] @@ -2087,7 +2025,6 @@ async def mock_rest_api_artifact_generate(httpx_mock: HTTPXMock, schema_query_04 "__typename": "CoreArtifactDefinition", "name": { "value": "Startup Config for Edge devices", - "is_visible": True, "is_protected": True, "source": { "id": "1799fd6b-f0a9-9d23-304d-c51b05d142c5", @@ -2098,7 +2035,6 @@ async def mock_rest_api_artifact_generate(httpx_mock: HTTPXMock, schema_query_04 }, "artifact_name": { "value": "startup-config", - "is_visible": True, "is_protected": True, "source": { "id": "1799fd6b-f0a9-9d23-304d-c51b05d142c5", @@ -2109,14 +2045,12 @@ async def mock_rest_api_artifact_generate(httpx_mock: HTTPXMock, schema_query_04 }, "description": { "value": None, - "is_visible": True, "is_protected": False, "source": None, "owner": None, }, "parameters": { "value": {"device": "name__value"}, - "is_visible": True, "is_protected": True, "source": { "id": "1799fd6b-f0a9-9d23-304d-c51b05d142c5", @@ -2127,7 +2061,6 @@ async def mock_rest_api_artifact_generate(httpx_mock: HTTPXMock, schema_query_04 }, "content_type": { "value": "text/plain", - "is_visible": True, "is_protected": True, "source": { "id": "1799fd6b-f0a9-9d23-304d-c51b05d142c5", @@ -2143,7 +2076,6 @@ async def mock_rest_api_artifact_generate(httpx_mock: HTTPXMock, schema_query_04 "__typename": "CoreStandardGroup", }, "properties": { - "is_visible": True, "is_protected": True, "source": { "id": "1799fd6b-f0a9-9d23-304d-c51b05d142c5", @@ -2160,7 +2092,6 @@ async def mock_rest_api_artifact_generate(httpx_mock: HTTPXMock, schema_query_04 "__typename": "CoreRFile", }, "properties": { - "is_visible": True, "is_protected": True, "source": { "id": "1799fd6b-f0a9-9d23-304d-c51b05d142c5", diff --git a/tests/unit/sdk/test_node.py b/tests/unit/sdk/test_node.py index fa615fd6..67c19932 100644 --- a/tests/unit/sdk/test_node.py +++ b/tests/unit/sdk/test_node.py @@ -316,7 +316,6 @@ async def test_query_data_no_filters_property(clients, location_schema: NodeSche "is_default": None, "is_from_profile": None, "is_protected": None, - "is_visible": None, "owner": { "__typename": None, "display_label": None, @@ -333,7 +332,6 @@ async def test_query_data_no_filters_property(clients, location_schema: NodeSche "is_default": None, "is_from_profile": None, "is_protected": None, - "is_visible": None, "owner": { "__typename": None, "display_label": None, @@ -350,7 +348,6 @@ async def test_query_data_no_filters_property(clients, location_schema: NodeSche "is_default": None, "is_from_profile": None, "is_protected": None, - "is_visible": None, "owner": { "__typename": None, "display_label": None, @@ -366,7 +363,6 @@ async def test_query_data_no_filters_property(clients, location_schema: NodeSche "primary_tag": { "properties": { "is_protected": None, - "is_visible": None, "owner": { "__typename": None, "display_label": None, @@ -451,7 +447,6 @@ async def test_query_data_node_property(clients, location_schema: NodeSchemaAPI, "is_default": None, "is_from_profile": None, "is_protected": None, - "is_visible": None, "owner": {"__typename": None, "display_label": None, "id": None}, "source": {"__typename": None, "display_label": None, "id": None}, "value": None, @@ -460,7 +455,6 @@ async def test_query_data_node_property(clients, location_schema: NodeSchemaAPI, "is_default": None, "is_from_profile": None, "is_protected": None, - "is_visible": None, "owner": {"__typename": None, "display_label": None, "id": None}, "source": {"__typename": None, "display_label": None, "id": None}, "value": None, @@ -469,7 +463,6 @@ async def test_query_data_node_property(clients, location_schema: NodeSchemaAPI, "is_default": None, "is_from_profile": None, "is_protected": None, - "is_visible": None, "owner": {"__typename": None, "display_label": None, "id": None}, "source": {"__typename": None, "display_label": None, "id": None}, "value": None, @@ -477,7 +470,6 @@ async def test_query_data_node_property(clients, location_schema: NodeSchemaAPI, "primary_tag": { "properties": { "is_protected": None, - "is_visible": None, "owner": { "__typename": None, "display_label": None, @@ -558,7 +550,6 @@ async def test_query_data_with_prefetch_relationships_property(clients, mock_sch "is_default": None, "is_from_profile": None, "is_protected": None, - "is_visible": None, "owner": { "__typename": None, "display_label": None, @@ -575,7 +566,6 @@ async def test_query_data_with_prefetch_relationships_property(clients, mock_sch "is_default": None, "is_from_profile": None, "is_protected": None, - "is_visible": None, "owner": { "__typename": None, "display_label": None, @@ -592,7 +582,6 @@ async def test_query_data_with_prefetch_relationships_property(clients, mock_sch "is_default": None, "is_from_profile": None, "is_protected": None, - "is_visible": None, "owner": { "__typename": None, "display_label": None, @@ -608,7 +597,6 @@ async def test_query_data_with_prefetch_relationships_property(clients, mock_sch "primary_tag": { "properties": { "is_protected": None, - "is_visible": None, "owner": { "__typename": None, "display_label": None, @@ -629,7 +617,6 @@ async def test_query_data_with_prefetch_relationships_property(clients, mock_sch "is_default": None, "is_from_profile": None, "is_protected": None, - "is_visible": None, "owner": { "__typename": None, "display_label": None, @@ -646,7 +633,6 @@ async def test_query_data_with_prefetch_relationships_property(clients, mock_sch "is_default": None, "is_from_profile": None, "is_protected": None, - "is_visible": None, "owner": { "__typename": None, "display_label": None, @@ -737,7 +723,6 @@ async def test_query_data_node_with_prefetch_relationships_property(clients, moc "is_default": None, "is_from_profile": None, "is_protected": None, - "is_visible": None, "owner": {"__typename": None, "display_label": None, "id": None}, "source": {"__typename": None, "display_label": None, "id": None}, "value": None, @@ -746,7 +731,6 @@ async def test_query_data_node_with_prefetch_relationships_property(clients, moc "is_default": None, "is_from_profile": None, "is_protected": None, - "is_visible": None, "owner": {"__typename": None, "display_label": None, "id": None}, "source": {"__typename": None, "display_label": None, "id": None}, "value": None, @@ -758,7 +742,6 @@ async def test_query_data_node_with_prefetch_relationships_property(clients, moc "is_default": None, "is_from_profile": None, "is_protected": None, - "is_visible": None, "owner": {"__typename": None, "display_label": None, "id": None}, "source": {"__typename": None, "display_label": None, "id": None}, "value": None, @@ -770,7 +753,6 @@ async def test_query_data_node_with_prefetch_relationships_property(clients, moc "is_default": None, "is_from_profile": None, "is_protected": None, - "is_visible": None, "owner": {"__typename": None, "display_label": None, "id": None}, "source": {"__typename": None, "display_label": None, "id": None}, "value": None, @@ -778,7 +760,6 @@ async def test_query_data_node_with_prefetch_relationships_property(clients, moc }, "properties": { "is_protected": None, - "is_visible": None, "owner": {"__typename": None, "display_label": None, "id": None}, "source": {"__typename": None, "display_label": None, "id": None}, }, @@ -787,7 +768,6 @@ async def test_query_data_node_with_prefetch_relationships_property(clients, moc "is_default": None, "is_from_profile": None, "is_protected": None, - "is_visible": None, "owner": {"__typename": None, "display_label": None, "id": None}, "source": {"__typename": None, "display_label": None, "id": None}, "value": None, @@ -890,7 +870,6 @@ async def test_query_data_generic_fragment_property(clients, mock_schema_query_0 "is_default": None, "is_from_profile": None, "is_protected": None, - "is_visible": None, "owner": { "__typename": None, "display_label": None, @@ -908,7 +887,6 @@ async def test_query_data_generic_fragment_property(clients, mock_schema_query_0 "is_default": None, "is_from_profile": None, "is_protected": None, - "is_visible": None, "owner": { "__typename": None, "display_label": None, @@ -931,7 +909,6 @@ async def test_query_data_generic_fragment_property(clients, mock_schema_query_0 }, "properties": { "is_protected": None, - "is_visible": None, "owner": { "__typename": None, "display_label": None, @@ -949,7 +926,6 @@ async def test_query_data_generic_fragment_property(clients, mock_schema_query_0 "is_default": None, "is_from_profile": None, "is_protected": None, - "is_visible": None, "owner": { "__typename": None, "display_label": None, @@ -969,7 +945,6 @@ async def test_query_data_generic_fragment_property(clients, mock_schema_query_0 "is_default": None, "is_from_profile": None, "is_protected": None, - "is_visible": None, "owner": { "__typename": None, "display_label": None, @@ -987,7 +962,6 @@ async def test_query_data_generic_fragment_property(clients, mock_schema_query_0 "is_default": None, "is_from_profile": None, "is_protected": None, - "is_visible": None, "owner": { "__typename": None, "display_label": None, @@ -1102,7 +1076,6 @@ async def test_query_data_include_property( "is_default": None, "is_from_profile": None, "is_protected": None, - "is_visible": None, "owner": { "__typename": None, "display_label": None, @@ -1119,7 +1092,6 @@ async def test_query_data_include_property( "is_default": None, "is_from_profile": None, "is_protected": None, - "is_visible": None, "owner": { "__typename": None, "display_label": None, @@ -1136,7 +1108,6 @@ async def test_query_data_include_property( "is_default": None, "is_from_profile": None, "is_protected": None, - "is_visible": None, "owner": { "__typename": None, "display_label": None, @@ -1152,7 +1123,6 @@ async def test_query_data_include_property( "primary_tag": { "properties": { "is_protected": None, - "is_visible": None, "owner": { "__typename": None, "display_label": None, @@ -1176,7 +1146,6 @@ async def test_query_data_include_property( "edges": { "properties": { "is_protected": None, - "is_visible": None, "owner": { "__typename": None, "display_label": None, @@ -1285,7 +1254,6 @@ async def test_query_data_exclude_property(client, location_schema: NodeSchemaAP "is_default": None, "is_from_profile": None, "is_protected": None, - "is_visible": None, "owner": { "__typename": None, "display_label": None, @@ -1302,7 +1270,6 @@ async def test_query_data_exclude_property(client, location_schema: NodeSchemaAP "is_default": None, "is_from_profile": None, "is_protected": None, - "is_visible": None, "owner": { "__typename": None, "display_label": None, @@ -1703,10 +1670,10 @@ async def test_update_input_data__with_relationships_01( expected_result_with_property = { "data": { "id": "llllllll-llll-llll-llll-llllllllllll", - "name": {"is_protected": True, "is_visible": True, "value": "DFW"}, + "name": {"is_protected": True, "value": "DFW"}, "primary_tag": {"id": "gggggggg-gggg-gggg-gggg-gggggggggggg"}, "tags": [{"id": "gggggggg-gggg-gggg-gggg-gggggggggggg"}, {"id": "rrrrrrrr-rrrr-rrrr-rrrr-rrrrrrrrrrrr"}], - "type": {"is_protected": True, "is_visible": True, "value": "SITE"}, + "type": {"is_protected": True, "value": "SITE"}, }, } @@ -1753,27 +1720,23 @@ async def test_update_input_data_with_relationships_02( "id": "llllllll-llll-llll-llll-llllllllllll", "name": { "is_protected": True, - "is_visible": True, "source": "cccccccc-cccc-cccc-cccc-cccccccccccc", "value": "dfw1", }, "primary_tag": { "_relation__is_protected": True, - "_relation__is_visible": True, "_relation__source": "cccccccc-cccc-cccc-cccc-cccccccccccc", "id": "rrrrrrrr-rrrr-rrrr-rrrr-rrrrrrrrrrrr", }, "tags": [ { "_relation__is_protected": True, - "_relation__is_visible": True, "_relation__source": "cccccccc-cccc-cccc-cccc-cccccccccccc", "id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb", }, ], "type": { "is_protected": True, - "is_visible": True, "source": "cccccccc-cccc-cccc-cccc-cccccccccccc", "value": "SITE", }, @@ -1811,7 +1774,6 @@ async def test_update_input_data_with_relationships_02_exclude_unmodified( "id": "llllllll-llll-llll-llll-llllllllllll", "primary_tag": { "_relation__is_protected": True, - "_relation__is_visible": True, "_relation__source": "cccccccc-cccc-cccc-cccc-cccccccccccc", "id": "rrrrrrrr-rrrr-rrrr-rrrr-rrrrrrrrrrrr", }, @@ -1862,10 +1824,10 @@ async def test_update_input_data_empty_relationship( expected_result_with_property = { "data": { "id": "llllllll-llll-llll-llll-llllllllllll", - "name": {"is_protected": True, "is_visible": True, "value": "DFW"}, + "name": {"is_protected": True, "value": "DFW"}, "primary_tag": None, "tags": [], - "type": {"is_protected": True, "is_visible": True, "value": "SITE"}, + "type": {"is_protected": True, "value": "SITE"}, }, } @@ -2088,9 +2050,9 @@ async def test_read_only_attr( assert address._generate_input_data()["data"] == { "data": { "id": "d5994b18-b25e-4261-9e63-17c2844a0b45", - "street_number": {"is_protected": False, "is_visible": True, "value": "1234"}, - "street_name": {"is_protected": False, "is_visible": True, "value": "Fake Street"}, - "postal_code": {"is_protected": False, "is_visible": True, "value": "123ABC"}, + "street_number": {"is_protected": False, "value": "1234"}, + "street_name": {"is_protected": False, "value": "Fake Street"}, + "postal_code": {"is_protected": False, "value": "123ABC"}, }, } assert address.computed_address.value == "1234 Fake Street 123ABC" From e14e8384479caae4a332c54e0cc9d3e2ecb0d617 Mon Sep 17 00:00:00 2001 From: Sola Infrahub User Date: Thu, 27 Nov 2025 11:08:29 +0100 Subject: [PATCH 2/2] fix python lint --- infrahub_sdk/node/attribute.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infrahub_sdk/node/attribute.py b/infrahub_sdk/node/attribute.py index 60034572..a0d00a96 100644 --- a/infrahub_sdk/node/attribute.py +++ b/infrahub_sdk/node/attribute.py @@ -53,7 +53,7 @@ def __init__(self, name: str, schema: AttributeSchemaAPI, data: Any | dict) -> N self.is_inherited: bool | None = data.get("is_inherited") self.updated_at: str | None = data.get("updated_at") - self.is_protected: bool | None = data.get("is_protected", None) + self.is_protected: bool | None = data.get("is_protected") self.source: NodeProperty | None = None self.owner: NodeProperty | None = None