Compare commits

..

No commits in common. "86c5f754ddbdafa21b71054d97e4a085852fce02" and "0a97dc877ec973ef21e098bb07a141c3cfe32c23" have entirely different histories.

7 changed files with 11 additions and 24 deletions

View file

@ -1,9 +1,3 @@
## 1.2.0a71 (2026-03-18)
### Fix
- auto redefine in type is only for default
## 1.2.0a70 (2026-03-18) ## 1.2.0a70 (2026-03-18)
### Feat ### Feat

View file

@ -1,6 +1,6 @@
[project] [project]
name = "rougail" name = "rougail"
version = "1.2.0a71" version = "1.2.0a70"
[tool.commitizen] [tool.commitizen]
name = "cz_conventional_commits" name = "cz_conventional_commits"

View file

@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
[project] [project]
name = "rougail-base" name = "rougail-base"
version = "1.2.0a71" version = "1.2.0a70"
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}] authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
readme = "README.md" readme = "README.md"
description = "A consistency handling system that was initially designed in the configuration management" description = "A consistency handling system that was initially designed in the configuration management"

View file

@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
[project] [project]
name = "rougail" name = "rougail"
version = "1.2.0a71" version = "1.2.0a70"
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}] authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
readme = "README.md" readme = "README.md"
description = "A consistency handling system that was initially designed in the configuration management" description = "A consistency handling system that was initially designed in the configuration management"
@ -27,7 +27,7 @@ classifiers = [
dependencies = [ dependencies = [
"ruamel.yaml ~= 0.18.6", "ruamel.yaml ~= 0.18.6",
"pydantic ~= 2.9.2", "pydantic ~= 2.9.2",
"rougail-base == 1.2.0a71", "rougail-base == 1.2.0a70",
] ]
[tool.flit.sdist] [tool.flit.sdist]

View file

@ -1 +1 @@
__version__ = "1.2.0a71" __version__ = "1.2.0a70"

View file

@ -409,7 +409,7 @@ class ParserVariable:
exists = obj.pop("exists", None) exists = obj.pop("exists", None)
else: else:
exists = None exists = None
redefine = self.is_redefine(path, obj, force_redefine) redefine = obj.pop("redefine", False) or (force_redefine is True and path in self.paths)
obj_type = self.get_family_or_variable_type(obj) obj_type = self.get_family_or_variable_type(obj)
family_obj, children_obj = self.split_param_family_children(path, sources, obj_type, obj) family_obj, children_obj = self.split_param_family_children(path, sources, obj_type, obj)
if self.version != "1.0" and not family_obj and comment: if self.version != "1.0" and not family_obj and comment:
@ -430,7 +430,7 @@ class ParserVariable:
copy_before_set=True, copy_before_set=True,
custom_type=True, custom_type=True,
) )
force_redefine = True force_redefine=True
family_obj, children_obj = self.split_param_family_children(path, sources, obj_type, obj) family_obj, children_obj = self.split_param_family_children(path, sources, obj_type, obj)
family_obj["type"] = self.paths[path].type family_obj["type"] = self.paths[path].type
if path in self.paths: if path in self.paths:
@ -522,10 +522,6 @@ class ParserVariable:
copy_before_set=copy_before_set, copy_before_set=copy_before_set,
custom_type=custom_type, custom_type=custom_type,
) )
def is_redefine(self, path: str, obj, force_redefine: bool):
return obj.pop("redefine", False) or (force_redefine is True and path in self.paths and list(obj) in [[], ["default"]])
def split_param_family_children(self, path, sources, obj_type, obj): def split_param_family_children(self, path, sources, obj_type, obj):
family_obj = {} family_obj = {}
children_obj = {} children_obj = {}
@ -720,7 +716,7 @@ class ParserVariable:
self.parse_params(path, obj, sources) self.parse_params(path, obj, sources)
self.parse_secret_manager(path, obj, sources, family_is_dynamic, copy_before_set) self.parse_secret_manager(path, obj, sources, family_is_dynamic, copy_before_set)
exists = obj.pop("exists", None) exists = obj.pop("exists", None)
redefine = self.is_redefine(path, obj, force_redefine) redefine = obj.pop("redefine", False) or (force_redefine is True and path in self.paths)
if not redefine and not exists: if not redefine and not exists:
obj_type = obj.get("type") obj_type = obj.get("type")
if obj_type in self.custom_variable_types: if obj_type in self.custom_variable_types:

View file

@ -24,10 +24,7 @@ my_leadership_4:
my_leadership: my_leadership:
a_leader: a_leader: # a description
description: a description - a value leader
redefine: true - a second leader
default:
- a value leader
- a second leader
... ...