fix(prs): PR summary/review/rebase/policy/template tools print bare identifiers or raw JSON #32
Labels
No labels
area/dsh
area/forgejo
experiment
priority/later
priority/next
priority/now
type/bug
type/task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
dsh-plugins/dsh-gitea#32
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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, andgitea_pr_rebase(dry-run). Related:gitea_pr_policyandgitea_pr_template_checkprintUnrecognised response+ raw JSON.Repro
For comparison,
gitea_merge_readinessandgitea_pr_impactrender 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.jshas no branches forgitea_pr_summary,gitea_pr_review,gitea_pr_rebase,gitea_pr_policyorgitea_pr_template_check; they fall through to the genericdata.number/data.titleordescribeUnknownObjectpaths (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
summarystring and render it.Acceptance:
pr_summarystates files/risk/verdict;pr_reviewprints findings or a clear "no findings";pr_rebaseprints its dry-run plan; policy/template-check print plain sentences, neverUnrecognised response.Duplicate check
Searched
merged/formatter/review(state all) — #23 coverspr_getrendering; no issue covers these five tools.Layer
dsh-gitea plugin/tool (formatter).
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 surviveslimRecord.Live: all five render as plain sentences/lists, no
Unrecognised response.Tests:
test/qa-formatters.test.mjs.