infrahub-server 1.5.4__py3-none-any.whl → 1.6.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.
Files changed (129) hide show
  1. infrahub/api/artifact.py +5 -3
  2. infrahub/auth.py +5 -6
  3. infrahub/cli/db.py +3 -3
  4. infrahub/cli/db_commands/clean_duplicate_schema_fields.py +2 -2
  5. infrahub/cli/dev.py +30 -0
  6. infrahub/config.py +62 -14
  7. infrahub/constants/database.py +5 -5
  8. infrahub/core/branch/models.py +24 -6
  9. infrahub/core/constants/__init__.py +1 -0
  10. infrahub/core/diff/model/diff.py +2 -2
  11. infrahub/core/graph/constraints.py +2 -2
  12. infrahub/core/manager.py +191 -60
  13. infrahub/core/merge.py +29 -2
  14. infrahub/core/migrations/shared.py +2 -2
  15. infrahub/core/models.py +5 -6
  16. infrahub/core/node/__init__.py +12 -6
  17. infrahub/core/node/create.py +36 -8
  18. infrahub/core/node/ipam.py +4 -4
  19. infrahub/core/node/node_property_attribute.py +2 -2
  20. infrahub/core/node/standard.py +1 -1
  21. infrahub/core/query/attribute.py +1 -1
  22. infrahub/core/query/branch.py +11 -0
  23. infrahub/core/query/node.py +9 -5
  24. infrahub/core/query/standard_node.py +3 -0
  25. infrahub/core/relationship/model.py +15 -10
  26. infrahub/core/schema/__init__.py +3 -3
  27. infrahub/core/schema/generic_schema.py +1 -1
  28. infrahub/core/schema/schema_branch.py +35 -16
  29. infrahub/core/task/user_task.py +2 -2
  30. infrahub/core/validators/determiner.py +3 -6
  31. infrahub/core/validators/enum.py +2 -2
  32. infrahub/database/__init__.py +1 -1
  33. infrahub/dependencies/interface.py +2 -2
  34. infrahub/events/constants.py +2 -2
  35. infrahub/git/base.py +42 -1
  36. infrahub/git/models.py +2 -1
  37. infrahub/git/repository.py +5 -1
  38. infrahub/git/tasks.py +28 -1
  39. infrahub/git/utils.py +9 -0
  40. infrahub/graphql/analyzer.py +4 -4
  41. infrahub/graphql/loaders/peers.py +6 -0
  42. infrahub/graphql/mutations/computed_attribute.py +1 -1
  43. infrahub/graphql/mutations/convert_object_type.py +1 -1
  44. infrahub/graphql/mutations/display_label.py +1 -1
  45. infrahub/graphql/mutations/hfid.py +1 -1
  46. infrahub/graphql/mutations/ipam.py +1 -1
  47. infrahub/graphql/mutations/profile.py +9 -1
  48. infrahub/graphql/mutations/relationship.py +2 -2
  49. infrahub/graphql/mutations/resource_manager.py +1 -1
  50. infrahub/graphql/queries/__init__.py +2 -1
  51. infrahub/graphql/queries/branch.py +58 -3
  52. infrahub/graphql/queries/ipam.py +9 -4
  53. infrahub/graphql/queries/resource_manager.py +7 -11
  54. infrahub/graphql/queries/search.py +5 -6
  55. infrahub/graphql/resolvers/ipam.py +20 -0
  56. infrahub/graphql/resolvers/many_relationship.py +12 -11
  57. infrahub/graphql/resolvers/resolver.py +6 -2
  58. infrahub/graphql/resolvers/single_relationship.py +1 -11
  59. infrahub/graphql/schema.py +2 -0
  60. infrahub/graphql/types/__init__.py +3 -1
  61. infrahub/graphql/types/branch.py +98 -2
  62. infrahub/lock.py +6 -6
  63. infrahub/log.py +1 -1
  64. infrahub/message_bus/messages/__init__.py +0 -12
  65. infrahub/patch/constants.py +2 -2
  66. infrahub/profiles/node_applier.py +9 -0
  67. infrahub/proposed_change/tasks.py +1 -1
  68. infrahub/task_manager/task.py +4 -4
  69. infrahub/telemetry/constants.py +2 -2
  70. infrahub/trigger/models.py +2 -2
  71. infrahub/trigger/setup.py +6 -9
  72. infrahub/utils.py +19 -1
  73. infrahub/validators/tasks.py +1 -1
  74. infrahub/workers/infrahub_async.py +39 -1
  75. infrahub_sdk/async_typer.py +2 -1
  76. infrahub_sdk/batch.py +2 -2
  77. infrahub_sdk/client.py +121 -10
  78. infrahub_sdk/config.py +2 -2
  79. infrahub_sdk/ctl/branch.py +176 -2
  80. infrahub_sdk/ctl/check.py +3 -3
  81. infrahub_sdk/ctl/cli.py +2 -2
  82. infrahub_sdk/ctl/cli_commands.py +10 -9
  83. infrahub_sdk/ctl/generator.py +2 -2
  84. infrahub_sdk/ctl/graphql.py +3 -4
  85. infrahub_sdk/ctl/importer.py +2 -3
  86. infrahub_sdk/ctl/repository.py +5 -6
  87. infrahub_sdk/ctl/task.py +2 -4
  88. infrahub_sdk/ctl/utils.py +4 -4
  89. infrahub_sdk/ctl/validate.py +1 -2
  90. infrahub_sdk/diff.py +80 -3
  91. infrahub_sdk/graphql/constants.py +14 -1
  92. infrahub_sdk/graphql/renderers.py +5 -1
  93. infrahub_sdk/node/attribute.py +10 -10
  94. infrahub_sdk/node/constants.py +2 -3
  95. infrahub_sdk/node/node.py +54 -11
  96. infrahub_sdk/node/related_node.py +1 -2
  97. infrahub_sdk/node/relationship.py +1 -2
  98. infrahub_sdk/object_store.py +4 -4
  99. infrahub_sdk/operation.py +2 -2
  100. infrahub_sdk/protocols_base.py +0 -1
  101. infrahub_sdk/protocols_generator/generator.py +1 -1
  102. infrahub_sdk/pytest_plugin/items/jinja2_transform.py +1 -1
  103. infrahub_sdk/pytest_plugin/models.py +1 -1
  104. infrahub_sdk/pytest_plugin/plugin.py +1 -1
  105. infrahub_sdk/query_groups.py +2 -2
  106. infrahub_sdk/schema/__init__.py +10 -14
  107. infrahub_sdk/schema/main.py +2 -2
  108. infrahub_sdk/schema/repository.py +2 -2
  109. infrahub_sdk/spec/object.py +2 -2
  110. infrahub_sdk/spec/range_expansion.py +1 -1
  111. infrahub_sdk/template/__init__.py +2 -1
  112. infrahub_sdk/transfer/importer/json.py +3 -3
  113. infrahub_sdk/types.py +2 -2
  114. infrahub_sdk/utils.py +2 -2
  115. {infrahub_server-1.5.4.dist-info → infrahub_server-1.6.0.dist-info}/METADATA +58 -59
  116. {infrahub_server-1.5.4.dist-info → infrahub_server-1.6.0.dist-info}/RECORD +239 -245
  117. {infrahub_server-1.5.4.dist-info → infrahub_server-1.6.0.dist-info}/WHEEL +1 -1
  118. infrahub_server-1.6.0.dist-info/entry_points.txt +12 -0
  119. infrahub_testcontainers/container.py +2 -2
  120. infrahub_testcontainers/docker-compose-cluster.test.yml +1 -1
  121. infrahub_testcontainers/docker-compose.test.yml +1 -1
  122. infrahub/core/schema/generated/__init__.py +0 -0
  123. infrahub/core/schema/generated/attribute_schema.py +0 -133
  124. infrahub/core/schema/generated/base_node_schema.py +0 -111
  125. infrahub/core/schema/generated/genericnode_schema.py +0 -30
  126. infrahub/core/schema/generated/node_schema.py +0 -40
  127. infrahub/core/schema/generated/relationship_schema.py +0 -141
  128. infrahub_server-1.5.4.dist-info/entry_points.txt +0 -13
  129. {infrahub_server-1.5.4.dist-info → infrahub_server-1.6.0.dist-info/licenses}/LICENSE.txt +0 -0
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.1.3
2
+ Generator: hatchling 1.28.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -0,0 +1,12 @@
1
+ [console_scripts]
2
+ infrahub = infrahub.cli:app
3
+ infrahub-git-askpass = infrahub.git_credential.askpass:app
4
+ infrahub-git-credential = infrahub.git_credential.helper:app
5
+ infrahubctl = infrahub_sdk.ctl.cli:app
6
+
7
+ [prefect.collections]
8
+ infrahubasync = infrahub.workers.infrahub_async
9
+
10
+ [pytest11]
11
+ pytest-infrahub = infrahub_sdk.pytest_plugin.plugin
12
+ pytest-infrahub-performance-test = infrahub_testcontainers.plugin
@@ -33,7 +33,7 @@ PROJECT_ENV_VARIABLES: dict[str, str] = {
33
33
  "MESSAGE_QUEUE_DOCKER_IMAGE": "rabbitmq:3.13.7-management",
34
34
  "CACHE_DOCKER_IMAGE": "redis:7.2.11",
35
35
  "INFRAHUB_TESTING_DOCKER_IMAGE": "registry.opsmill.io/opsmill/infrahub",
36
- "INFRAHUB_TESTING_DOCKER_ENTRYPOINT": f"gunicorn --config backend/infrahub/serve/gunicorn_config.py -w {os.environ.get('INFRAHUB_TESTING_WEB_CONCURRENCY', 4)} --logger-class infrahub.serve.log.GunicornLogger infrahub.server:app", # noqa: E501
36
+ "INFRAHUB_TESTING_DOCKER_ENTRYPOINT": f"gunicorn --config backend/infrahub/serve/gunicorn_config.py -w {os.environ.get('INFRAHUB_TESTING_WEB_CONCURRENCY', '4')} --logger-class infrahub.serve.log.GunicornLogger infrahub.server:app", # noqa: E501
37
37
  "INFRAHUB_TESTING_IMAGE_VERSION": infrahub_version,
38
38
  "INFRAHUB_TESTING_PRODUCTION": "false",
39
39
  "INFRAHUB_TESTING_DB_ADDRESS": "database",
@@ -149,7 +149,7 @@ class InfrahubDockerCompose(DockerCompose):
149
149
  PROJECT_ENV_VARIABLES.update(
150
150
  {
151
151
  "INFRAHUB_TESTING_DOCKER_IMAGE": "registry.opsmill.io/opsmill/infrahub-enterprise",
152
- "INFRAHUB_TESTING_DOCKER_ENTRYPOINT": f"gunicorn --config community/backend/infrahub/serve/gunicorn_config.py -w {os.environ.get('INFRAHUB_TESTING_WEB_CONCURRENCY', 4)} --logger-class infrahub.serve.log.GunicornLogger infrahub_enterprise.server:app", # noqa: E501
152
+ "INFRAHUB_TESTING_DOCKER_ENTRYPOINT": f"gunicorn --config community/backend/infrahub/serve/gunicorn_config.py -w {os.environ.get('INFRAHUB_TESTING_WEB_CONCURRENCY', '4')} --logger-class infrahub.serve.log.GunicornLogger infrahub_enterprise.server:app", # noqa: E501
153
153
  "INFRAHUB_TESTING_WORKFLOW_DEFAULT_WORKER_TYPE": "infrahubentasync",
154
154
  "INFRAHUB_TESTING_PREFECT_UI_ENABLED": "false",
155
155
  "NEO4J_DOCKER_IMAGE": "neo4j:2025.03.0-enterprise",
@@ -196,7 +196,7 @@ services:
196
196
 
197
197
  WEB_CONCURRENCY: ${INFRAHUB_TESTING_TASKMGR_API_WORKERS:-1}
198
198
  healthcheck:
199
- test: /usr/local/bin/httpx http://localhost:4200/api/health || exit 1
199
+ test: curl -s -f -o /dev/null http://localhost:4200/api/health || exit 1
200
200
  interval: 5s
201
201
  timeout: 5s
202
202
  retries: 20
@@ -107,7 +107,7 @@ services:
107
107
 
108
108
  WEB_CONCURRENCY: ${INFRAHUB_TESTING_TASKMGR_API_WORKERS:-1}
109
109
  healthcheck:
110
- test: /usr/local/bin/httpx http://localhost:4200/api/health || exit 1
110
+ test: curl -s -f -o /dev/null http://localhost:4200/api/health || exit 1
111
111
  interval: 5s
112
112
  timeout: 5s
113
113
  retries: 20
File without changes
@@ -1,133 +0,0 @@
1
- # Generated by "invoke backend.generate", do not edit directly
2
-
3
- from __future__ import annotations
4
-
5
- from typing import Any
6
-
7
- from pydantic import Field
8
-
9
- from infrahub.core.constants import AllowOverrideType, BranchSupportType, HashableModelState
10
- from infrahub.core.models import HashableModel
11
- from infrahub.core.schema.attribute_parameters import (
12
- AttributeParameters,
13
- NumberAttributeParameters,
14
- NumberPoolParameters,
15
- TextAttributeParameters,
16
- )
17
- from infrahub.core.schema.computed_attribute import ComputedAttribute # noqa: TC001
18
- from infrahub.core.schema.dropdown import DropdownChoice # noqa: TC001
19
-
20
-
21
- class GeneratedAttributeSchema(HashableModel):
22
- id: str | None = Field(
23
- default=None, description="The ID of the attribute", json_schema_extra={"update": "not_applicable"}
24
- )
25
- name: str = Field(
26
- ...,
27
- description="Attribute name, must be unique within a model and must be all lowercase.",
28
- pattern=r"^[a-z0-9\_]+$",
29
- min_length=3,
30
- max_length=32,
31
- json_schema_extra={"update": "migration_required"},
32
- )
33
- kind: str = Field(
34
- ..., description="Defines the type of the attribute.", json_schema_extra={"update": "migration_required"}
35
- )
36
- enum: list | None = Field(
37
- default=None,
38
- description="Define a list of valid values for the attribute.",
39
- json_schema_extra={"update": "validate_constraint"},
40
- )
41
- computed_attribute: ComputedAttribute | None = Field(
42
- default=None,
43
- description="Defines how the value of this attribute will be populated.",
44
- json_schema_extra={"update": "allowed"},
45
- )
46
- choices: list[DropdownChoice] | None = Field(
47
- default=None,
48
- description="Define a list of valid choices for a dropdown attribute.",
49
- json_schema_extra={"update": "validate_constraint"},
50
- )
51
- regex: str | None = Field(
52
- default=None,
53
- description="Regex uses to limit the characters allowed in for the attributes. (deprecated: please use parameters.regex instead)",
54
- json_schema_extra={"update": "validate_constraint"},
55
- )
56
- max_length: int | None = Field(
57
- default=None,
58
- description="Set a maximum number of characters allowed for a given attribute. (deprecated: please use parameters.max_length instead)",
59
- json_schema_extra={"update": "validate_constraint"},
60
- )
61
- min_length: int | None = Field(
62
- default=None,
63
- description="Set a minimum number of characters allowed for a given attribute. (deprecated: please use parameters.min_length instead)",
64
- json_schema_extra={"update": "validate_constraint"},
65
- )
66
- label: str | None = Field(
67
- default=None,
68
- description="Human friendly representation of the name. Will be autogenerated if not provided",
69
- max_length=32,
70
- json_schema_extra={"update": "allowed"},
71
- )
72
- description: str | None = Field(
73
- default=None,
74
- description="Short description of the attribute.",
75
- max_length=128,
76
- json_schema_extra={"update": "allowed"},
77
- )
78
- read_only: bool = Field(
79
- default=False,
80
- description="Set the attribute as Read-Only, users won't be able to change its value. Mainly relevant for internal object.",
81
- json_schema_extra={"update": "migration_required"},
82
- )
83
- unique: bool = Field(
84
- default=False,
85
- description="Indicate if the value of this attribute must be unique in the database for a given model.",
86
- json_schema_extra={"update": "validate_constraint"},
87
- )
88
- optional: bool = Field(
89
- default=False,
90
- description="Indicate if this attribute is mandatory or optional.",
91
- json_schema_extra={"update": "migration_required"},
92
- )
93
- branch: BranchSupportType | None = Field(
94
- default=None,
95
- description="Type of branch support for the attribute, if not defined it will be inherited from the node.",
96
- json_schema_extra={"update": "not_supported"},
97
- )
98
- order_weight: int | None = Field(
99
- default=None,
100
- description="Number used to order the attribute in the frontend (table and view). Lowest value will be ordered first.",
101
- json_schema_extra={"update": "allowed"},
102
- )
103
- default_value: Any | None = Field(
104
- default=None, description="Default value of the attribute.", json_schema_extra={"update": "allowed"}
105
- )
106
- inherited: bool = Field(
107
- default=False,
108
- description="Internal value to indicate if the attribute was inherited from a Generic node.",
109
- json_schema_extra={"update": "not_applicable"},
110
- )
111
- state: HashableModelState = Field(
112
- default=HashableModelState.PRESENT,
113
- description="Expected state of the attribute after loading the schema",
114
- json_schema_extra={"update": "not_applicable"},
115
- )
116
- allow_override: AllowOverrideType = Field(
117
- default=AllowOverrideType.ANY,
118
- description="Type of allowed override for the attribute.",
119
- json_schema_extra={"update": "allowed"},
120
- )
121
- parameters: AttributeParameters | TextAttributeParameters | NumberAttributeParameters | NumberPoolParameters = (
122
- Field(
123
- default_factory=AttributeParameters,
124
- description="Extra parameters specific to this kind of attribute",
125
- json_schema_extra={"update": "validate_constraint"},
126
- )
127
- )
128
- deprecation: str | None = Field(
129
- default=None,
130
- description="Mark attribute as deprecated and provide a user-friendly message to display",
131
- max_length=128,
132
- json_schema_extra={"update": "allowed"},
133
- )
@@ -1,111 +0,0 @@
1
- # Generated by "invoke backend.generate", do not edit directly
2
-
3
- from __future__ import annotations
4
-
5
- from pydantic import Field
6
-
7
- from infrahub.core.constants import BranchSupportType, HashableModelState
8
- from infrahub.core.models import HashableModel
9
- from infrahub.core.schema.attribute_schema import AttributeSchema # noqa: TC001
10
- from infrahub.core.schema.relationship_schema import RelationshipSchema # noqa: TC001
11
-
12
-
13
- class GeneratedBaseNodeSchema(HashableModel):
14
- id: str | None = Field(
15
- default=None, description="The ID of the node", json_schema_extra={"update": "not_applicable"}
16
- )
17
- name: str = Field(
18
- ...,
19
- description="Node name, must be unique within a namespace and must start with an uppercase letter.",
20
- pattern="^[A-Z][a-zA-Z0-9]+$",
21
- min_length=2,
22
- max_length=32,
23
- json_schema_extra={"update": "migration_required"},
24
- )
25
- namespace: str = Field(
26
- ...,
27
- description="Node Namespace, Namespaces are used to organize models into logical groups and to prevent name collisions.",
28
- pattern="^[A-Z][a-z0-9]+$",
29
- min_length=3,
30
- max_length=32,
31
- json_schema_extra={"update": "migration_required"},
32
- )
33
- description: str | None = Field(
34
- default=None,
35
- description="Short description of the model, will be visible in the frontend.",
36
- max_length=128,
37
- json_schema_extra={"update": "allowed"},
38
- )
39
- label: str | None = Field(
40
- default=None,
41
- description="Human friendly representation of the name/kind",
42
- max_length=64,
43
- json_schema_extra={"update": "allowed"},
44
- )
45
- branch: BranchSupportType = Field(
46
- default=BranchSupportType.AWARE,
47
- description="Type of branch support for the model.",
48
- json_schema_extra={"update": "not_supported"},
49
- )
50
- default_filter: str | None = Field(
51
- default=None,
52
- description="Default filter used to search for a node in addition to its ID. (deprecated: please use human_friendly_id instead)",
53
- pattern=r"^[a-z0-9\_]*$",
54
- json_schema_extra={"update": "allowed"},
55
- )
56
- human_friendly_id: list[str] | None = Field(
57
- default=None,
58
- description="Human friendly and unique identifier for the object.",
59
- json_schema_extra={"update": "allowed"},
60
- )
61
- display_label: str | None = Field(
62
- default=None,
63
- description="Attribute or Jinja2 template to use to generate the display label",
64
- json_schema_extra={"update": "allowed"},
65
- )
66
- display_labels: list[str] | None = Field(
67
- default=None,
68
- description="List of attributes to use to generate the display label (deprecated)",
69
- json_schema_extra={"update": "allowed"},
70
- )
71
- include_in_menu: bool | None = Field(
72
- default=None,
73
- description="Defines if objects of this kind should be included in the menu.",
74
- json_schema_extra={"update": "allowed"},
75
- )
76
- menu_placement: str | None = Field(
77
- default=None,
78
- description="Defines where in the menu this object should be placed.",
79
- json_schema_extra={"update": "allowed"},
80
- )
81
- icon: str | None = Field(
82
- default=None,
83
- description="Defines the icon to use in the menu. Must be a valid value from the MDI library https://icon-sets.iconify.design/mdi/",
84
- json_schema_extra={"update": "allowed"},
85
- )
86
- order_by: list[str] | None = Field(
87
- default=None,
88
- description="List of attributes to use to order the results by default",
89
- json_schema_extra={"update": "allowed"},
90
- )
91
- uniqueness_constraints: list[list[str]] | None = Field(
92
- default=None,
93
- description="List of multi-element uniqueness constraints that can combine relationships and attributes",
94
- json_schema_extra={"update": "validate_constraint"},
95
- )
96
- documentation: str | None = Field(
97
- default=None,
98
- description="Link to a documentation associated with this object, can be internal or external.",
99
- json_schema_extra={"update": "allowed"},
100
- )
101
- state: HashableModelState = Field(
102
- default=HashableModelState.PRESENT,
103
- description="Expected state of the node/generic after loading the schema",
104
- json_schema_extra={"update": "not_applicable"},
105
- )
106
- attributes: list[AttributeSchema] = Field(
107
- default_factory=list, description="Node attributes", json_schema_extra={"update": "not_applicable"}
108
- )
109
- relationships: list[RelationshipSchema] = Field(
110
- default_factory=list, description="Node Relationships", json_schema_extra={"update": "not_applicable"}
111
- )
@@ -1,30 +0,0 @@
1
- # Generated by "invoke backend.generate", do not edit directly
2
-
3
- from __future__ import annotations
4
-
5
- from pydantic import Field
6
-
7
- from infrahub.core.schema.basenode_schema import BaseNodeSchema
8
-
9
-
10
- class GeneratedGenericSchema(BaseNodeSchema):
11
- hierarchical: bool = Field(
12
- default=False,
13
- description="Defines if the Generic support the hierarchical mode.",
14
- json_schema_extra={"update": "validate_constraint"},
15
- )
16
- generate_profile: bool = Field(
17
- default=True,
18
- description="Indicate if a profile schema should be generated for this schema",
19
- json_schema_extra={"update": "validate_constraint"},
20
- )
21
- generate_template: bool = Field(
22
- default=False,
23
- description="Indicate if an object template schema should be generated for this schema",
24
- json_schema_extra={"update": "allowed"},
25
- )
26
- used_by: list[str] = Field(
27
- default_factory=list,
28
- description="List of Nodes that are referencing this Generic",
29
- json_schema_extra={"update": "not_applicable"},
30
- )
@@ -1,40 +0,0 @@
1
- # Generated by "invoke backend.generate", do not edit directly
2
-
3
- from __future__ import annotations
4
-
5
- from pydantic import Field
6
-
7
- from infrahub.core.schema.basenode_schema import BaseNodeSchema
8
-
9
-
10
- class GeneratedNodeSchema(BaseNodeSchema):
11
- inherit_from: list[str] = Field(
12
- default_factory=list,
13
- description="List of Generic Kind that this node is inheriting from",
14
- json_schema_extra={"update": "validate_constraint"},
15
- )
16
- generate_profile: bool = Field(
17
- default=True,
18
- description="Indicate if a profile schema should be generated for this schema",
19
- json_schema_extra={"update": "validate_constraint"},
20
- )
21
- generate_template: bool = Field(
22
- default=False,
23
- description="Indicate if an object template schema should be generated for this schema",
24
- json_schema_extra={"update": "allowed"},
25
- )
26
- hierarchy: str | None = Field(
27
- default=None,
28
- description="Internal value to track the name of the Hierarchy, must match the name of a Generic supporting hierarchical mode",
29
- json_schema_extra={"update": "validate_constraint"},
30
- )
31
- parent: str | None = Field(
32
- default=None,
33
- description="Expected Kind for the parent node in a Hierarchy, default to the main generic defined if not defined.",
34
- json_schema_extra={"update": "validate_constraint"},
35
- )
36
- children: str | None = Field(
37
- default=None,
38
- description="Expected Kind for the children nodes in a Hierarchy, default to the main generic defined if not defined.",
39
- json_schema_extra={"update": "validate_constraint"},
40
- )
@@ -1,141 +0,0 @@
1
- # Generated by "invoke backend.generate", do not edit directly
2
-
3
- from __future__ import annotations
4
-
5
- from pydantic import Field
6
-
7
- from infrahub.core.constants import (
8
- AllowOverrideType,
9
- BranchSupportType,
10
- HashableModelState,
11
- RelationshipCardinality,
12
- RelationshipDeleteBehavior,
13
- RelationshipDirection,
14
- RelationshipKind,
15
- )
16
- from infrahub.core.models import HashableModel
17
-
18
-
19
- class GeneratedRelationshipSchema(HashableModel):
20
- id: str | None = Field(
21
- default=None, description="The ID of the relationship schema", json_schema_extra={"update": "not_applicable"}
22
- )
23
- name: str = Field(
24
- ...,
25
- description="Relationship name, must be unique within a model and must be all lowercase.",
26
- pattern=r"^[a-z0-9\_]+$",
27
- min_length=3,
28
- max_length=32,
29
- json_schema_extra={"update": "allowed"},
30
- )
31
- peer: str = Field(
32
- ...,
33
- description="Type (kind) of objects supported on the other end of the relationship.",
34
- pattern="^[A-Z][a-zA-Z0-9]+$",
35
- json_schema_extra={"update": "validate_constraint"},
36
- )
37
- kind: RelationshipKind = Field(
38
- default=RelationshipKind.GENERIC,
39
- description="Defines the type of the relationship.",
40
- json_schema_extra={"update": "allowed"},
41
- )
42
- label: str | None = Field(
43
- default=None,
44
- description="Human friendly representation of the name. Will be autogenerated if not provided",
45
- max_length=32,
46
- json_schema_extra={"update": "allowed"},
47
- )
48
- description: str | None = Field(
49
- default=None,
50
- description="Short description of the relationship.",
51
- max_length=128,
52
- json_schema_extra={"update": "allowed"},
53
- )
54
- identifier: str | None = Field(
55
- default=None,
56
- description="Unique identifier of the relationship within a model, identifiers must match to traverse a relationship on both direction.",
57
- pattern=r"^[a-z0-9\_]+$",
58
- max_length=128,
59
- json_schema_extra={"update": "allowed"},
60
- )
61
- cardinality: RelationshipCardinality = Field(
62
- default=RelationshipCardinality.MANY,
63
- description="Defines how many objects are expected on the other side of the relationship.",
64
- json_schema_extra={"update": "validate_constraint"},
65
- )
66
- min_count: int = Field(
67
- default=0,
68
- description="Defines the minimum objects allowed on the other side of the relationship.",
69
- json_schema_extra={"update": "validate_constraint"},
70
- )
71
- max_count: int = Field(
72
- default=0,
73
- description="Defines the maximum objects allowed on the other side of the relationship.",
74
- json_schema_extra={"update": "validate_constraint"},
75
- )
76
- common_parent: str | None = Field(
77
- default=None,
78
- description="Name of a parent relationship on the peer schema that must share the same related object with the object's parent.",
79
- json_schema_extra={"update": "validate_constraint"},
80
- )
81
- common_relatives: list[str] | None = Field(
82
- default=None,
83
- description="List of relationship names on the peer schema for which all objects must share the same set of peers.",
84
- json_schema_extra={"update": "allowed"},
85
- )
86
- order_weight: int | None = Field(
87
- default=None,
88
- description="Number used to order the relationship in the frontend (table and view). Lowest value will be ordered first.",
89
- json_schema_extra={"update": "allowed"},
90
- )
91
- optional: bool = Field(
92
- default=True,
93
- description="Indicate if this relationship is mandatory or optional.",
94
- json_schema_extra={"update": "validate_constraint"},
95
- )
96
- branch: BranchSupportType | None = Field(
97
- default=None,
98
- description="Type of branch support for the relatioinship, if not defined it will be determine based both peers.",
99
- json_schema_extra={"update": "not_supported"},
100
- )
101
- inherited: bool = Field(
102
- default=False,
103
- description="Internal value to indicate if the relationship was inherited from a Generic node.",
104
- json_schema_extra={"update": "not_applicable"},
105
- )
106
- direction: RelationshipDirection = Field(
107
- default=RelationshipDirection.BIDIR,
108
- description="Defines the direction of the relationship, Unidirectional relationship are required when the same model is on both side.",
109
- json_schema_extra={"update": "not_supported"},
110
- )
111
- hierarchical: str | None = Field(
112
- default=None,
113
- description="Internal attribute to track the type of hierarchy this relationship is part of, must match a valid Generic Kind",
114
- json_schema_extra={"update": "not_supported"},
115
- )
116
- state: HashableModelState = Field(
117
- default=HashableModelState.PRESENT,
118
- description="Expected state of the relationship after loading the schema",
119
- json_schema_extra={"update": "not_applicable"},
120
- )
121
- on_delete: RelationshipDeleteBehavior | None = Field(
122
- default=None,
123
- description="Default is no-action. If cascade, related node(s) are deleted when this node is deleted.",
124
- json_schema_extra={"update": "allowed"},
125
- )
126
- allow_override: AllowOverrideType = Field(
127
- default=AllowOverrideType.ANY,
128
- description="Type of allowed override for the relationship.",
129
- json_schema_extra={"update": "allowed"},
130
- )
131
- read_only: bool = Field(
132
- default=False,
133
- description="Set the relationship as read-only, users won't be able to change its value.",
134
- json_schema_extra={"update": "allowed"},
135
- )
136
- deprecation: str | None = Field(
137
- default=None,
138
- description="Mark relationship as deprecated and provide a user-friendly message to display",
139
- max_length=128,
140
- json_schema_extra={"update": "allowed"},
141
- )
@@ -1,13 +0,0 @@
1
- [console_scripts]
2
- infrahub=infrahub.cli:app
3
- infrahub-git-askpass=infrahub.git_credential.askpass:app
4
- infrahub-git-credential=infrahub.git_credential.helper:app
5
- infrahubctl=infrahub_sdk.ctl.cli:app
6
-
7
- [prefect.collections]
8
- infrahubasync=infrahub.workers.infrahub_async
9
-
10
- [pytest11]
11
- pytest-infrahub=infrahub_sdk.pytest_plugin.plugin
12
- pytest-infrahub-performance-test=infrahub_testcontainers.plugin
13
-