fix(qa): render PR, CI, commit, compare, search and timeline payloads #41

Merged
dsh merged 1 commit from fix/qa-formatters into master 2026-10-24 01:22:26 +00:00
Owner

What

Six output-quality defects from the tester sweep. These tools had no formatters, so the generic array/object fallbacks emitted clipped JSON or a bare #N.

#25 — commits / PR files / compare

  • gitea_repo_commits: ca4117f Merge pull request #1 (pvlb-dev, 2026-08-06).
  • gitea_pr_files: lib/handlers/formatters.js (+17/-3) [changed].
  • gitea_repo_compare: Compare: N commit(s), M file(s) (ahead/behind) + file list, or Compare: No changes.

#26 — CI

  • status: one line per run (#76 title [success] branch sha + URL).
  • jobs: accepts both {jobs} and Forgejo's real {workflow_jobs} envelope; #id name [status/conclusion].
  • run: id/title/state/branch/SHA/URL + job summary.
  • Removed the Unrecognised response fallback for these shapes.

Handler now caps matches globally (git grep --max-count was per file) and returns {items,total_count,truncated,limit}. Formatter prints path:line: snippet and … showing N of M matches.

#32 — PR analysis

  • pr_summary: files, +/-, areas, tests, risks, approvals, mergeable.
  • pr_review: verdict, summary, risks, questions.
  • pr_rebase: dry-run plan (head → base, steps, note).
  • pr_policy: “not configured” / violation list.
  • pr_template_check: “complete” / missing sections + risk checklist.

#33 — notifications / users / org members

  • Notifications: unread marker, repo — subject [type, reason] (updated).
  • User search and org members: login (name) — url.

#34 — issue timeline

Per-type rendering: added type/task, old → new, milestone title, added @dsh, comment body, reaction — instead of empty colons.

RECORD_KEYS gained the fields these formatters need (workflow_jobs, commits, subject, reason, unread, label, old_title, new_title, risks, areas, testFiles, head_branch, ahead_by, …); without that slimRecord dropped them before rendering.

Verification

  • test/qa-formatters.test.mjs (19 tests).
  • npm test 131/131, leak scan clean, node --check clean.
  • Live: commits, PR files, compare, CI status/run, code search, PR summary/review/rebase/policy/template, notifications/users/org members, timeline all render readable output. CI jobs is checked against the fresh run created by this PR’s merge.

Closes #25, #26, #27, #32, #33, #34.

## What Six output-quality defects from the tester sweep. These tools had no formatters, so the generic array/object fallbacks emitted clipped JSON or a bare `#N`. ### #25 — commits / PR files / compare - `gitea_repo_commits`: `ca4117f Merge pull request #1 (pvlb-dev, 2026-08-06)`. - `gitea_pr_files`: `lib/handlers/formatters.js (+17/-3) [changed]`. - `gitea_repo_compare`: `Compare: N commit(s), M file(s) (ahead/behind)` + file list, or `Compare: No changes.` ### #26 — CI - `status`: one line per run (`#76 title [success] branch sha` + URL). - `jobs`: accepts both `{jobs}` and Forgejo's real `{workflow_jobs}` envelope; `#id name [status/conclusion]`. - `run`: id/title/state/branch/SHA/URL + job summary. - Removed the `Unrecognised response` fallback for these shapes. ### #27 — code search Handler now caps matches **globally** (`git grep --max-count` was per file) and returns `{items,total_count,truncated,limit}`. Formatter prints `path:line: snippet` and `… showing N of M matches`. ### #32 — PR analysis - `pr_summary`: files, +/-, areas, tests, risks, approvals, mergeable. - `pr_review`: verdict, summary, risks, questions. - `pr_rebase`: dry-run plan (head → base, steps, note). - `pr_policy`: “not configured” / violation list. - `pr_template_check`: “complete” / missing sections + risk checklist. ### #33 — notifications / users / org members - Notifications: unread marker, `repo — subject [type, reason] (updated)`. - User search and org members: `login (name) — url`. ### #34 — issue timeline Per-type rendering: `added type/task`, `old → new`, milestone title, `added @dsh`, comment body, reaction — instead of empty colons. `RECORD_KEYS` gained the fields these formatters need (`workflow_jobs`, `commits`, `subject`, `reason`, `unread`, `label`, `old_title`, `new_title`, `risks`, `areas`, `testFiles`, `head_branch`, `ahead_by`, …); without that `slimRecord` dropped them before rendering. ## Verification - `test/qa-formatters.test.mjs` (19 tests). - `npm test` 131/131, leak scan clean, `node --check` clean. - Live: commits, PR files, compare, CI status/run, code search, PR summary/review/rebase/policy/template, notifications/users/org members, timeline all render readable output. CI `jobs` is checked against the fresh run created by this PR’s merge. Closes #25, #26, #27, #32, #33, #34.
Add explicit formatters for the QA-sweep gaps: commit/pr-file/compare lists, CI runs/jobs/run (including Forgejo's workflow_jobs envelope), code-search path:line:snippet with a global cap, PR summary/review/rebase/policy/template, notifications/users/org members, and per-type issue timeline events. Keep the new fields through slimRecord.
dsh merged commit 56f41de16d into master 2026-10-24 01:22:26 +00:00
Sign in to join this conversation.
No description provided.