Follow-up to #444 and #443, as the platform session requested: an issue in the repository follows the status of its finding.
Behaviour
Finding becomes
Issue
Behoben (by the scan: "nicht mehr gefunden" / "jetzt Herstellercode"; or by a person)
comment explaining why, then closed
Fehlalarm – Regel/Zuordnung, Ignoriert
comment, closed
Risiko akzeptiert
comment with the person's reason, label risk:accepted (Gitea), closed
Offen / Bewertet / Zu prüfen again (the scan finds it again, or a person reopens it)
comment, reopened
Comments are German then English, like the labels.
Triggers:
PATCH /findings/{id}/status;
PATCH /findings/bulk-status;
the scan's close and reopen from #443 (RunFindings::status_changed).
In every case the sync runs in the background, so neither the API response nor the scan waits for it.
Robust: the sync reads the finding's current status when it runs, so a change made in between wins. It does nothing when the issue already matches. A tracker that can't be reached is logged, and the next change tries again.
build_tracker is now a free function, so the API can use it; the orchestrator method delegates to it.
TrackerDispatch gains update_issue_status and add_comment, which existed in the trait but were never called.
GiteaTracker gains add_labels.
pruefwerk_labels() gains risk:accepted, created via ensure_labels like the others.
Tests
End-to-end (issue_sync::tests::an_issue_follows_its_findings_status, real Mongo plus a fake Gitea), using a target whose tracker is a managed Gitea repository:
scan-closed finding → comment "Bei der Prüfung nicht mehr gefunden…" + state: closed;
same status synced again → no further call;
finding open again → state: open;
accepted risk → labels: [42], then state: closed.
Unit tests for the status-to-action mapping and the comment texts (DE/EN, with the reason quoted).
Label tests updated (7 labels).
Agent lib tests: 533. Integration tests resolve_findings, live_findings and git_source pass against local Mongo.
Follow-up to #444 and #443, as the platform session requested: **an issue in the repository follows the status of its finding.**
## Behaviour
| Finding becomes | Issue |
|---|---|
| **Behoben** (by the scan: "nicht mehr gefunden" / "jetzt Herstellercode"; or by a person) | comment explaining why, then **closed** |
| **Fehlalarm – Regel/Zuordnung**, **Ignoriert** | comment, **closed** |
| **Risiko akzeptiert** | comment with the person's reason, label **`risk:accepted`** (Gitea), **closed** |
| **Offen / Bewertet / Zu prüfen** again (the scan finds it again, or a person reopens it) | comment, **reopened** |
- Comments are German then English, like the labels.
- **Triggers:**
- `PATCH /findings/{id}/status`;
- `PATCH /findings/bulk-status`;
- the scan's close and reopen from #443 (`RunFindings::status_changed`).
- In every case the sync runs in the background, so neither the API response nor the scan waits for it.
- **Robust:** the sync reads the finding's **current** status when it runs, so a change made in between wins. It does nothing when the issue already matches. A tracker that can't be reached is logged, and the next change tries again.
## Code
- `pipeline/issue_sync.rs` (new): `IssueSync { db, config, secrets, net_guard }::spawn(ids)`.
- `build_tracker` is now a free function, so the API can use it; the orchestrator method delegates to it.
- `TrackerDispatch` gains `update_issue_status` and `add_comment`, which existed in the trait but were never called.
- `GiteaTracker` gains `add_labels`.
- `pruefwerk_labels()` gains `risk:accepted`, created via `ensure_labels` like the others.
## Tests
- **End-to-end** (`issue_sync::tests::an_issue_follows_its_findings_status`, real Mongo plus a fake Gitea), using a target whose tracker is a managed Gitea repository:
1. scan-closed finding → comment "Bei der Prüfung nicht mehr gefunden…" + `state: closed`;
2. same status synced again → no further call;
3. finding open again → `state: open`;
4. accepted risk → `labels: [42]`, then `state: closed`.
- Unit tests for the status-to-action mapping and the comment texts (DE/EN, with the reason quoted).
- Label tests updated (7 labels).
- Agent lib tests: 533. Integration tests `resolve_findings`, `live_findings` and `git_source` pass against local Mongo.
- fmt and clippy with the CI flags.
- Docs: `managed-git.md` (DE) and `managed-git-en.md`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
#444 opens an issue per finding in the managed repository, but nothing
updated it afterwards. Now, when a finding's status changes, by a person
(single or bulk) or by the scan (#443 closes and reopens), its issue
follows, in the background:
- resolved, false positive (rule or mapping) or ignored: a comment with
the reason, then closed;
- accepted risk: the comment (with the person's reason) and, on Gitea,
the new `risk:accepted` label, then closed;
- open, triaged or needs review again: reopened with a comment.
The sync reads the finding's current status when it runs, so a change in
between wins, and does nothing when the issue already matches. Comments
are German then English, like the labels. build_tracker is now a free
function the API can use; TrackerDispatch gains update_issue_status and
add_comment; GiteaTracker gains add_labels.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
sharang
merged commit 654f387c80 into main2026-10-05 14:14:14 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Follow-up to #444 and #443, as the platform session requested: an issue in the repository follows the status of its finding.
Behaviour
risk:accepted(Gitea), closedPATCH /findings/{id}/status;PATCH /findings/bulk-status;RunFindings::status_changed).Code
pipeline/issue_sync.rs(new):IssueSync { db, config, secrets, net_guard }::spawn(ids).build_trackeris now a free function, so the API can use it; the orchestrator method delegates to it.TrackerDispatchgainsupdate_issue_statusandadd_comment, which existed in the trait but were never called.GiteaTrackergainsadd_labels.pruefwerk_labels()gainsrisk:accepted, created viaensure_labelslike the others.Tests
issue_sync::tests::an_issue_follows_its_findings_status, real Mongo plus a fake Gitea), using a target whose tracker is a managed Gitea repository:state: closed;state: open;labels: [42], thenstate: closed.resolve_findings,live_findingsandgit_sourcepass against local Mongo.managed-git.md(DE) andmanaged-git-en.md.🤖 Generated with Claude Code
https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p