in jbi/models.py [0:0]
def validate_steps(cls, function_names: list[str]):
"""Validate that all configure step functions exist in the steps module"""
invalid_functions = [
func_name for func_name in function_names if not hasattr(steps, func_name)
]
if invalid_functions:
raise ValueError(
f"The following functions are not available in the `steps` module: {', '.join(invalid_functions)}"
)
# Make sure `maybe_update_resolution` comes after `maybe_update_status`.
try:
idx_resolution = function_names.index("maybe_update_issue_resolution")
idx_status = function_names.index("maybe_update_issue_status")
assert idx_resolution > idx_status, (
"Step `maybe_update_resolution` should be put after `maybe_update_issue_status`"
)
except ValueError:
# One of these 2 steps not listed.
pass
return function_names