Skip to content

Commit d91840a

Browse files
committed
config: add failed_label_prefix uniqueness validator
Ensure backport_label_prefix and failed_label_prefix are different to avoid infinite loops.
1 parent e6d3bc1 commit d91840a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

patchback/config.py

+11
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,17 @@ class PatchbackConfig:
3838
Set to None to disable adding a label on failure.
3939
"""
4040

41+
@failed_label_prefix.validator
42+
def _v_failed_label_prefix(self, _, value: str | None) -> None:
43+
"""
44+
Ensure backport_label_prefix and failed_label_prefix are different
45+
to avoid infinite loops
46+
"""
47+
if value == self.backport_label_prefix:
48+
raise ValueError(
49+
'failed_label_prefix and backport_label_prefix must be unique values'
50+
)
51+
4152

4253
async def get_patchback_config(
4354
*,

0 commit comments

Comments
 (0)