Skip to content

Commit 4d2bab0

Browse files
committed
fix(scripts): fail fast in debug_repo_contributor_roles when storage lacks identity/contribution APIs
1 parent 74aed55 commit 4d2bab0

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

scripts/debug_repo_contributor_roles.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ def main() -> None:
3737
print("Config repo_contributor_roles:", repo_contributor_roles)
3838
print()
3939

40+
# Fail fast if storage adapter lacks identity-link and contribution APIs
41+
required = ("list_verified_identity_mappings", "list_contributions")
42+
missing = [m for m in required if not hasattr(storage, m) or not callable(getattr(storage, m, None))]
43+
if missing:
44+
print(
45+
f"The configured storage adapter does not support identity mappings / contributions: "
46+
f"missing or not callable: {missing}. Use a storage backend that provides these methods."
47+
)
48+
return
49+
4050
# 1) Any pr_merged events for the configured repos?
4151
from datetime import datetime, timezone
4252
from ghdcbot.engine.planning import REPO_CONTRIBUTOR_EPOCH

0 commit comments

Comments
 (0)