feat(issues): poll Gitea for issues a person closed or reopened (#953) (#972)
CI / Check (push) Skipped
CI / Agent integration (push) Skipped
CI / Detect Changes (push) Successful in 4s
CI / Deploy Dashboard (push) Skipped
CI / Deploy MCP (push) Skipped
CI / Deploy Docs (push) Successful in 1m14s
CI / Deploy Agent (push) Successful in 6m58s

The back-sync of #960 only listened to the managed git source's
organisation webhook, which most targets do not have: repositories with a
Gitea issue tracker get no webhook at all. Every GIT_SOURCE_SYNC_MINUTES
(30 by default) the agent now lists the issues of each target that has
Prüfwerk issues, one listing per repository, and compares their state with
its records. For an issue whose state differs it reads the timeline to see
who closed or reopened it; a person's change is carried back exactly as a
webhook delivery is (same rules: an undecided finding is resolved as
"closed in the ticket", a decision already made stays, a CVE issue only
records the close). Changes by the bot user that opened the issue are left
alone. Targets are polled one after the other, so a small Gitea sees one
listing at a time; tenants go through the same entitlement check as the
webhook. Where the webhook delivered a change already, the records match
and the poll does nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit was merged in pull request #972.
This commit is contained in:
sharangandClaude Opus 5.5 committed 2026-11-10 21:31:02 +00:00
1 parent f5ed826b99
commit 692840df59
10 files changed
+620 -15

No files matched your search

+7 -4
View File
@@ -42,7 +42,9 @@ Repository-Organisation dieser Instanz automatisch prüfen:
offen. Eine Entscheidung, die schon im Prüfwerk getroffen wurde (etwa ein
akzeptiertes Risiko), bleibt beim Schließen bestehen. Ein CVE-Issue, das
jemand schließt, bleibt geschlossen, solange die Prüfung die Schwachstelle
unverändert findet; einen VEX-Status setzt das nicht.
unverändert findet; einen VEX-Status setzt das nicht. Prüfwerk fragt den
Stand seiner Issues alle 30 Minuten selbst ab; mit dem Ereignis **Issues**
im Webhook kommt eine Änderung sofort an.
- **Abgleich.** Alle 30 Minuten gleicht Prüfwerk die Repository-Liste der
Organisation mit den Prüfobjekten ab, falls ein Webhook verloren ging.
@@ -89,9 +91,10 @@ Die Antwort enthält `webhook_url` und – nur beim ersten Mal oder mit
Organisations- oder System-Webhook (Typ Gitea, `application/json`) mit den
Ereignissen **Repository**, **Push** und **Issues** angelegt; die Antwort
nennt sie in `webhook_events`. Prüfwerk kann den Webhook nicht selbst anlegen
oder ändern (der Bot hat keine Administrationsrechte): Bei einem Webhook, der
vor dem Abgleich der Issues angelegt wurde, muss das Ereignis **Issues** in
Gitea nachgetragen werden. Ein erneuter `PUT` ohne
oder ändern (der Bot hat keine Administrationsrechte). Fehlt einem älteren
Webhook das Ereignis **Issues**, kommen geschlossene und wieder geöffnete
Issues trotzdem an, beim nächsten Abfragen (alle 30 Minuten); nachgetragen
kommen sie sofort. Ein erneuter `PUT` ohne
`bot_token` behält das gespeicherte Token, ohne `rotate_webhook_secret` das
Secret. `GET` liefert die Quelle ohne Geheimnisse, `DELETE` entfernt sie und
archiviert ihre Prüfobjekte.