fix(incidents): gitea_incident_report dry run reports "Incident Ticket: Created" #29

Closed
opened 2026-10-24 00:59:03 +00:00 by dsh · 1 comment
Owner

Symptom

gitea_incident_report with dry_run: true prints Incident Ticket: Created ..., which is false: no issue is created. The operator cannot tell a preview from a real ticket.

Repro

gitea_incident_report {
  service:"dsh-gitea", alert:"QA probe alert", dry_run:true
}
→ Incident Ticket: Created "[INCIDENT] dsh-gitea: QA probe alert" (sanitized).

gitea_issue_list on ml-lab/tardits afterwards shows only #1 and #2 — no incident issue was created.

Observed vs expected

  • Observed: dry-run output claims creation.
  • Expected: Incident Ticket (dry-run): would create "..." (labels: ...) — pass dry_run:false to file it, ideally with the sanitized body preview. Real creation should keep the "Created" wording and include the issue number/URL.

Root cause

lib/incident-report.js correctly returns { dryRun: true, title, body, labels, sanitizedLogs } early. The formatter (lib/handlers/formatters.js, gitea_incident_report branch) ignores data.dryRun:

return [{ type: 'text', text: `Incident Ticket: Created "${data.title}" (sanitized).` }]

Proposed fix

Branch on data.dryRun in the formatter and show a preview; on real creation include the issue number/link. Add formatter tests for both shapes.

Acceptance: dry-run never says "Created"; real creation reports the issue number.

Duplicate check

Searched incident (state all) — no existing issue.

Layer

dsh-gitea plugin/tool (formatter).

## Symptom `gitea_incident_report` with `dry_run: true` prints `Incident Ticket: Created ...`, which is false: no issue is created. The operator cannot tell a preview from a real ticket. ## Repro ``` gitea_incident_report { service:"dsh-gitea", alert:"QA probe alert", dry_run:true } → Incident Ticket: Created "[INCIDENT] dsh-gitea: QA probe alert" (sanitized). ``` `gitea_issue_list` on `ml-lab/tardits` afterwards shows only `#1` and `#2` — no incident issue was created. ## Observed vs expected - Observed: dry-run output claims creation. - Expected: `Incident Ticket (dry-run): would create "..." (labels: ...) — pass dry_run:false to file it`, ideally with the sanitized body preview. Real creation should keep the "Created" wording and include the issue number/URL. ## Root cause `lib/incident-report.js` correctly returns `{ dryRun: true, title, body, labels, sanitizedLogs }` early. The formatter (`lib/handlers/formatters.js`, `gitea_incident_report` branch) ignores `data.dryRun`: ```js return [{ type: 'text', text: `Incident Ticket: Created "${data.title}" (sanitized).` }] ``` ## Proposed fix Branch on `data.dryRun` in the formatter and show a preview; on real creation include the issue number/link. Add formatter tests for both shapes. Acceptance: dry-run never says "Created"; real creation reports the issue number. ## Duplicate check Searched `incident` (state all) — no existing issue. ## Layer dsh-gitea plugin/tool (formatter).
Author
Owner

Fixed in 281eade (PR #40).

The formatter branches on dryRun: Incident Ticket (dry-run): would create "…" with labels […] — pass dry_run:false to file it. plus a sanitized body preview; real creation reports #N and the URL. Also fixed the write path: default labels are now the house type/bug + priority/now, resolved to ids, and label names are never sent to Forgejo (previously the upstream type/incident/priority/critical/status/ready set would fail on house repos).

Live dry run: correct preview, no “Created”.

Tests: test/qa-defaults.test.mjs (dry run, real creation, resolved ids, no-name fallback).

Fixed in `281eade` (PR #40). The formatter branches on `dryRun`: `Incident Ticket (dry-run): would create "…" with labels […] — pass dry_run:false to file it.` plus a sanitized body preview; real creation reports `#N` and the URL. Also fixed the write path: default labels are now the house `type/bug` + `priority/now`, resolved to ids, and label names are never sent to Forgejo (previously the upstream `type/incident`/`priority/critical`/`status/ready` set would fail on house repos). Live dry run: correct preview, no “Created”. Tests: `test/qa-defaults.test.mjs` (dry run, real creation, resolved ids, no-name fallback).
dsh closed this issue 2026-10-24 01:16:41 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
dsh-plugins/dsh-gitea#29
No description provided.