Skip to content

Commit

Permalink
Merge pull request #4425 from opsmill/lgu-fix-generator-definition
Browse files Browse the repository at this point in the history
Add missing docs link for GeneratorDefinition/GeneratorInstance
  • Loading branch information
LucasG0 authored Sep 23, 2024
2 parents 64ee086 + e217b43 commit 90c0540
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
4 changes: 1 addition & 3 deletions backend/infrahub/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,9 +513,7 @@ def diff(self, other: Self) -> HashableModelDiff:
in_both, local_only, other_only = compare_lists(
list1=list(self.model_fields.keys()), list2=list(other.model_fields.keys())
)
diff_result = HashableModelDiff(
added={item: None for item in local_only}, removed={item: None for item in other_only}
)
diff_result = HashableModelDiff(added=dict.fromkeys(local_only), removed=dict.fromkeys(other_only))

for field_name in in_both:
if field_name.startswith("_") or field_name in self._exclude_from_hash:
Expand Down
4 changes: 2 additions & 2 deletions backend/infrahub/core/schema/basenode_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ def _diff_element(

elements_diff = HashableModelDiff()
if present_local:
elements_diff.added = {name: None for name in present_local}
elements_diff.added = dict.fromkeys(present_local)
if present_other:
elements_diff.removed = {name: None for name in present_other}
elements_diff.removed = dict.fromkeys(present_other)

# Process element b
for name in sorted(present_both):
Expand Down
2 changes: 2 additions & 0 deletions backend/infrahub/core/schema/definitions/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1801,6 +1801,7 @@
"uniqueness_constraints": [["name__value"]],
"generate_profile": False,
"inherit_from": [InfrahubKind.TASKTARGET],
"documentation": "/topics/generator",
"attributes": [
{"name": "name", "kind": "Text", "unique": True},
{"name": "description", "kind": "Text", "optional": True},
Expand Down Expand Up @@ -1848,6 +1849,7 @@
"branch": BranchSupportType.LOCAL.value,
"generate_profile": False,
"inherit_from": [InfrahubKind.TASKTARGET],
"documentation": "/topics/generator",
"attributes": [
{"name": "name", "kind": "Text"},
{
Expand Down
1 change: 1 addition & 0 deletions changelog/4316.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add documentation links for Generator Definition and Generator Instance pages to Generator topic

0 comments on commit 90c0540

Please sign in to comment.