fix(prs): PR summary/review/rebase/policy/template tools print bare identifiers or raw JSON #32

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

Symptom

Several PR analysis tools render only the PR number or title, dropping the very analysis they were called for: gitea_pr_summary, gitea_pr_review, and gitea_pr_rebase (dry-run). Related: gitea_pr_policy and gitea_pr_template_check print Unrecognised response + raw JSON.

Repro

gitea_pr_summary {owner:"dsh-plugins", repo:"dsh-gitea", number:18}
→ #18 "fix(labels): default bootstrap to the house taxonomy and make the dry run truthful"

gitea_pr_review {owner:"dsh-plugins", repo:"dsh-gitea", number:18}
→ #18

gitea_pr_rebase {owner:"dsh-plugins", repo:"dsh-gitea", number:18}
→ #18

gitea_pr_policy {owner:"dsh-plugins", repo:"dsh-gitea", files:["lib/handlers/formatters.js"]}
→ Unrecognised response
   {"present":false,"note":"Policy file not found (.gitea/pr-policy.yml)","violations":[]}

gitea_pr_template_check {body:"## What\n..."}
→ Unrecognised response
   {"template":{"ok":false,"missing":["Summary","Related Issue","User Impact","Documentation"]},"riskChecklistNeeded":false}

For comparison, gitea_merge_readiness and gitea_pr_impact render well.

Observed vs expected

  • pr_summary: expected files/areas/tests/risk/mergeability summary; observed the title only.
  • pr_review: expected the rule findings/verdict; observed #18.
  • pr_rebase: expected the dry-run plan or "already up to date"; observed #18.
  • pr_policy/pr_template_check: expected "No policy configured" / "Missing sections: ..."; observed raw JSON prefixed with "Unrecognised response".

Root cause

lib/handlers/formatters.js has no branches for gitea_pr_summary, gitea_pr_review, gitea_pr_rebase, gitea_pr_policy or gitea_pr_template_check; they fall through to the generic data.number/data.title or describeUnknownObject paths (the same family as #23/#25/#26).

Proposed fix

Add explicit formatters for all five tools, reusing the structured data the handlers already produce; test each with the recorded payloads. Alternatively have handlers return a summary string and render it.

Acceptance: pr_summary states files/risk/verdict; pr_review prints findings or a clear "no findings"; pr_rebase prints its dry-run plan; policy/template-check print plain sentences, never Unrecognised response.

Duplicate check

Searched merged/formatter/review (state all) — #23 covers pr_get rendering; no issue covers these five tools.

Layer

dsh-gitea plugin/tool (formatter).

## Symptom Several PR analysis tools render only the PR number or title, dropping the very analysis they were called for: `gitea_pr_summary`, `gitea_pr_review`, and `gitea_pr_rebase` (dry-run). Related: `gitea_pr_policy` and `gitea_pr_template_check` print `Unrecognised response` + raw JSON. ## Repro ``` gitea_pr_summary {owner:"dsh-plugins", repo:"dsh-gitea", number:18} → #18 "fix(labels): default bootstrap to the house taxonomy and make the dry run truthful" gitea_pr_review {owner:"dsh-plugins", repo:"dsh-gitea", number:18} → #18 gitea_pr_rebase {owner:"dsh-plugins", repo:"dsh-gitea", number:18} → #18 gitea_pr_policy {owner:"dsh-plugins", repo:"dsh-gitea", files:["lib/handlers/formatters.js"]} → Unrecognised response {"present":false,"note":"Policy file not found (.gitea/pr-policy.yml)","violations":[]} gitea_pr_template_check {body:"## What\n..."} → Unrecognised response {"template":{"ok":false,"missing":["Summary","Related Issue","User Impact","Documentation"]},"riskChecklistNeeded":false} ``` For comparison, `gitea_merge_readiness` and `gitea_pr_impact` render well. ## Observed vs expected - `pr_summary`: expected files/areas/tests/risk/mergeability summary; observed the title only. - `pr_review`: expected the rule findings/verdict; observed `#18`. - `pr_rebase`: expected the dry-run plan or "already up to date"; observed `#18`. - `pr_policy`/`pr_template_check`: expected "No policy configured" / "Missing sections: ..."; observed raw JSON prefixed with "Unrecognised response". ## Root cause `lib/handlers/formatters.js` has no branches for `gitea_pr_summary`, `gitea_pr_review`, `gitea_pr_rebase`, `gitea_pr_policy` or `gitea_pr_template_check`; they fall through to the generic `data.number`/`data.title` or `describeUnknownObject` paths (the same family as #23/#25/#26). ## Proposed fix Add explicit formatters for all five tools, reusing the structured data the handlers already produce; test each with the recorded payloads. Alternatively have handlers return a `summary` string and render it. Acceptance: `pr_summary` states files/risk/verdict; `pr_review` prints findings or a clear "no findings"; `pr_rebase` prints its dry-run plan; policy/template-check print plain sentences, never `Unrecognised response`. ## Duplicate check Searched `merged`/`formatter`/`review` (state all) — #23 covers `pr_get` rendering; no issue covers these five tools. ## Layer dsh-gitea plugin/tool (formatter).
Author
Owner

Fixed in 56f41de (PR #41).

Added explicit formatters:

  • pr_summary: title/state/author, files + additions/deletions, areas, tests, risks, approvals, mergeable (+ missing data).
  • pr_review: verdict, summary, risks, questions.
  • pr_rebase: dry-run head → base plan with steps and note.
  • pr_policy: “not configured (…)” or a violation list.
  • pr_template_check: complete / missing sections + risk checklist.

The fields these use (risks, areas, testFiles, verdict, questions, steps, present, policy, violations, template, …) now survive slimRecord.

Live: all five render as plain sentences/lists, no Unrecognised response.

Tests: test/qa-formatters.test.mjs.

Fixed in `56f41de` (PR #41). Added explicit formatters: - `pr_summary`: title/state/author, files + additions/deletions, areas, tests, risks, approvals, mergeable (+ missing data). - `pr_review`: verdict, summary, risks, questions. - `pr_rebase`: dry-run head → base plan with steps and note. - `pr_policy`: “not configured (…)” or a violation list. - `pr_template_check`: complete / missing sections + risk checklist. The fields these use (`risks`, `areas`, `testFiles`, `verdict`, `questions`, `steps`, `present`, `policy`, `violations`, `template`, …) now survive `slimRecord`. Live: all five render as plain sentences/lists, no `Unrecognised response`. Tests: `test/qa-formatters.test.mjs`.
dsh closed this issue 2026-10-24 01:25:26 +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#32
No description provided.