fix(ci): gitea_ci status/jobs/run print raw JSON or a bare job name instead of run status #26

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

Symptom

The CI tools have no output formatters, so the whole domain is hard to read: gitea_ci status dumps a raw workflow_runs JSON blob, gitea_ci jobs prints only the job name, and gitea_ci run prints the title plus raw JSON. Status/conclusion, branch, SHA and URLs are not surfaced.

Repro

gitea_ci {action:"status", owner:"dsh-plugins", repo:"dsh-gitea", branch:"master", limit:5}
→ Unrecognised response
   {"workflow_runs":[{"id":74,"title":"docs: add the tester-Deeps QA brief","repository":{...}} (clipped)

gitea_ci {action:"jobs", owner:"dsh-plugins", repo:"dsh-gitea", run_id:74}
→ check

gitea_ci {action:"run", owner:"dsh-plugins", repo:"dsh-gitea", run_id:74}
→ title: docs: add the tester-Deeps QA brief
   {"title":"docs: add the tester-Deeps QA brief","id":74,...} (raw JSON)

gitea_ci {action:"rerun", job_id:0, ...} without confirm
→ gitea_ci failed: Rerunning a job requires confirm: true (boolean).   (gate works)

Observed vs expected

  • status: expected one line per run — #74 docs: ... [success] master abc1234 (url); observed raw JSON.
  • jobs: expected check: success per job; observed only check.
  • run: expected run id/title/status/conclusion/branch/head_sha/url and a job summary; observed raw JSON.

Root cause

lib/tool-defs/releases.js/lib/handlers/releases.js route gitea_ci through the generic wrapper, and lib/handlers/formatters.js has no gitea_ci case (unlike gitea_ci_logs_analyze). Array rows fall back to item.name (jobs) or clipSnippet (runs); the run object falls back to describeUnknownObject.

Proposed fix

Add gitea_ci formatters keyed by action (status/jobs/run/logs) with run/job ids, status/conclusion, branch, short SHA and links; keep logs/explain output readable. Add formatter tests with the recorded payloads.

Acceptance: status, jobs and run each produce a human-readable summary with status/conclusion and ids; no Unrecognised response and no raw JSON.

Duplicate check

Searched ci, actions, formatter (state all) — #12 was the publish workflow change; no CI-output issue exists.

Layer

dsh-gitea plugin/tool (formatter).

## Symptom The CI tools have no output formatters, so the whole domain is hard to read: `gitea_ci status` dumps a raw `workflow_runs` JSON blob, `gitea_ci jobs` prints only the job name, and `gitea_ci run` prints the title plus raw JSON. Status/conclusion, branch, SHA and URLs are not surfaced. ## Repro ``` gitea_ci {action:"status", owner:"dsh-plugins", repo:"dsh-gitea", branch:"master", limit:5} → Unrecognised response {"workflow_runs":[{"id":74,"title":"docs: add the tester-Deeps QA brief","repository":{...}} (clipped) gitea_ci {action:"jobs", owner:"dsh-plugins", repo:"dsh-gitea", run_id:74} → check gitea_ci {action:"run", owner:"dsh-plugins", repo:"dsh-gitea", run_id:74} → title: docs: add the tester-Deeps QA brief {"title":"docs: add the tester-Deeps QA brief","id":74,...} (raw JSON) gitea_ci {action:"rerun", job_id:0, ...} without confirm → gitea_ci failed: Rerunning a job requires confirm: true (boolean). (gate works) ``` ## Observed vs expected - status: expected one line per run — `#74 docs: ... [success] master abc1234 (url)`; observed raw JSON. - jobs: expected `check: success` per job; observed only `check`. - run: expected run id/title/status/conclusion/branch/head_sha/url and a job summary; observed raw JSON. ## Root cause `lib/tool-defs/releases.js`/`lib/handlers/releases.js` route `gitea_ci` through the generic wrapper, and `lib/handlers/formatters.js` has no `gitea_ci` case (unlike `gitea_ci_logs_analyze`). Array rows fall back to `item.name` (jobs) or `clipSnippet` (runs); the run object falls back to `describeUnknownObject`. ## Proposed fix Add `gitea_ci` formatters keyed by action (status/jobs/run/logs) with run/job ids, status/conclusion, branch, short SHA and links; keep `logs`/`explain` output readable. Add formatter tests with the recorded payloads. Acceptance: `status`, `jobs` and `run` each produce a human-readable summary with status/conclusion and ids; no `Unrecognised response` and no raw JSON. ## Duplicate check Searched `ci`, `actions`, `formatter` (state all) — #12 was the publish workflow change; no CI-output issue exists. ## Layer dsh-gitea plugin/tool (formatter).
Author
Owner

Fixed in 56f41de (PR #41) plus fbcef26 (PR #42).

  • status → one line per run: #77 title [success] branch sha + URL.
  • jobs → CI Jobs (N): #78 check [success]. Forgejo returns a bare ActionRunJob[]; the follow-up handles that shape (the first patch only covered {jobs}/{workflow_jobs}).
  • run → id/title/state/branch/SHA/URL + job summary.
  • Empty status → No CI runs.

Live: status readable; run 77 readable; jobs 77 → CI Jobs (1): #78 check [success].

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

Fixed in `56f41de` (PR #41) plus `fbcef26` (PR #42). - `status` → one line per run: `#77 title [success] branch sha` + URL. - `jobs` → `CI Jobs (N): #78 check [success]`. Forgejo returns a **bare `ActionRunJob[]`**; the follow-up handles that shape (the first patch only covered `{jobs}`/`{workflow_jobs}`). - `run` → id/title/state/branch/SHA/URL + job summary. - Empty status → `No CI runs.` Live: `status` readable; `run 77` readable; `jobs 77` → `CI Jobs (1): #78 check [success]`. Tests: `test/qa-formatters.test.mjs`.
dsh closed this issue 2026-10-24 01:25:24 +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#26
No description provided.