fix(ci): render Forgejo's bare job array #42

Merged
dsh merged 1 commit from fix/qa-ci-jobs-array into master 2026-10-24 01:24:59 +00:00
Owner

What

Follow-up to #41. gitea_ci action:"jobs" returned No CI runs. because Forgejo's jobs endpoint returns a bare ActionRunJob[] (routers/api/v1/repo/action.go → ctx.JSON(200, response)), and the object-shaped CI branch intercepted arrays before the generic array formatter.

The CI formatter now handles the bare array: it detects job rows (name + no head_sha) and prints CI Jobs (N); a runs-shaped array still prints CI Runs.

Verification

  • New test for the bare job array; test/qa-formatters.test.mjs 20 tests, full suite 131/131, leak scan + syntax clean.
  • Live against the fresh CI run created by #41: gitea_ci {action:"jobs", run_id:77} → CI Jobs (1): #78 check [success].

Refs #26 (the issue stays open until the whole formatter batch is closed).

## What Follow-up to #41. `gitea_ci action:"jobs"` returned `No CI runs.` because Forgejo's jobs endpoint returns a **bare `ActionRunJob[]`** (`routers/api/v1/repo/action.go` → `ctx.JSON(200, response)`), and the object-shaped CI branch intercepted arrays before the generic array formatter. The CI formatter now handles the bare array: it detects job rows (`name` + no `head_sha`) and prints `CI Jobs (N)`; a runs-shaped array still prints `CI Runs`. ## Verification - New test for the bare job array; `test/qa-formatters.test.mjs` 20 tests, full suite 131/131, leak scan + syntax clean. - Live against the fresh CI run created by #41: `gitea_ci {action:"jobs", run_id:77}` → `CI Jobs (1): #78 check [success]`. Refs #26 (the issue stays open until the whole formatter batch is closed).
The jobs endpoint returns ActionRunJob[] directly; the object-shaped CI branch intercepted it before the array formatter. Detect the bare array and print CI Jobs.
dsh merged commit fbcef26d9c into master 2026-10-24 01:24:59 +00:00
Sign in to join this conversation.
No description provided.