feat(python/robomp): implemented has_authorized_impl_event in the

- Implement `has_authorized_impl_event` in the database to retrieve historical authorization state.
- Update `_enforce_impl_authorization` to permit actions if prior events on the issue provided implementation authorization.
- Normalize maintainer logins by stripping `[bot]` suffixes and allow match-regex to ignore them.
This commit is contained in:
can1357
2026-06-21 19:18:37 +02:00
parent 4b2e4085e0
commit 24a0c8428a
10 changed files with 140 additions and 29 deletions
+20
View File
@@ -607,6 +607,26 @@ class Database:
last_error=row["last_error"],
)
def has_authorized_impl_event(self, issue_key: str) -> bool:
"""Return whether a non-skipped event on this issue carried implementation authorization."""
with self._lock:
rows = self._conn.execute(
"""
SELECT payload_json
FROM events
WHERE issue_key = ?
AND state <> 'skipped'
ORDER BY received_at DESC
""",
(issue_key,),
).fetchall()
for row in rows:
payload = json.loads(row["payload_json"])
directive = payload.get("_robomp_directive")
if isinstance(directive, dict) and directive.get("authorizes_impl") is True:
return True
return False
def requeue_event(
self,
delivery_id: str,