Public: anyone can read this; the crew can change it.

`GET /api/v1/fleet/rows?q=` answers the rows `/fleet` shows #10145

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

`GET /api/v1/fleet/rows?q=<line>&sort=<column>` now answers `{ kind, columns, items }` through `viewFleet`, the same read `/fleet` uses. It is pushed. The new test file, the OpenAPI/contract tests, the fleet-table test and the other fleet/MCP tests I ran all pass, `bun x tsc --noEmit` is clean, and `bun scripts/gate.ts` printed nothing. I did not run `scripts/design-lint.ts` (no `src/web/` change)…

shipped production is serving it deploy ef71500

opened this

GET /api/v1/fleet/rows?q=<line>&sort=<column> now answers { kind, columns, items } through viewFleet, the same read /fleet uses. It is pushed. The new test file, the OpenAPI/contract tests, the fleet-table test and the other fleet/MCP tests I ran all pass, bun x tsc --noEmit is clean, and bun scripts/gate.ts printed nothing. I did not run scripts/design-lint.ts (no src/web/ change). I did not run the full suite or the tests scripts/fast.ts names: it said 1570 of 2349 files, about 134 minutes expected. I also did not call keep_plan, which isn't available in this session.

  • Rows: a signed-out caller sees public repositories only, and a signed-in one sees what they may read.
  • Refusals: a line that doesn't parse is a 422 invalid_query carrying the parse reason. An empty q and a q over 500 characters are also 422 invalid_query.
  • Sort: sort is a column key, with - in front to reverse. An unknown column is a 422 invalid_sort.
  • Docs: the route is in the OpenAPI description (src/contract/openapi/routes/getApiV1FleetRows.ts, with the index regenerated), and docs/features/fleet.md lists the API as a third door.
  • Tests: test/fleet-rows-api.test.ts checks that the API and /fleet select the same rows for one line per kind (repo, run, issue). It checks that a stranger sees only the public repository's rows. It also covers sorting and the 422 cases.

Differences from /fleet, and what I left out:

  • Sort: /fleet quietly ignores an unknown sort; the API refuses it. I chose that so a script learns of its typo.
  • Empty q: /fleet shows its example page; the API refuses it.
  • Paging and a row cap: the same 500-row refusal as the page applies; nothing is paged.
  • MCP tool: I did not add one.

Closes #10131

commented

GET /api/v1/fleet/rows?q=<line>&sort=<column> now answers { kind, columns, items } through viewFleet, the same read /fleet uses. It is pushed. The new test file, the OpenAPI/contract tests, the fleet-table test and the other fleet/MCP tests I ran all pass, bun x tsc --noEmit is clean, and bun scripts/gate.ts printed nothing. I did not run scripts/design-lint.ts (no src/web/ change). I did not run the full suite or the tests scripts/fast.ts names: it said 1570 of 2349 files, about 134 minutes expected. I also did not call keep_plan, which isn't available in this session.

  • Rows: a signed-out caller sees public repositories only, and a signed-in one sees what they may read.
  • Refusals: a line that doesn't parse is a 422 invalid_query carrying the parse reason. An empty q and a q over 500 characters are also 422 invalid_query.
  • Sort: sort is a column key, with - in front to reverse. An unknown column is a 422 invalid_sort.
  • Docs: the route is in the OpenAPI description (src/contract/openapi/routes/getApiV1FleetRows.ts, with the index regenerated), and docs/features/fleet.md lists the API as a third door.
  • Tests: test/fleet-rows-api.test.ts checks that the API and /fleet select the same rows for one line per kind (repo, run, issue). It checks that a stranger sees only the public repository's rows. It also covers sorting and the 422 cases.

Differences from /fleet, and what I left out:

  • Sort: /fleet quietly ignores an unknown sort; the API refuses it. I chose that so a script learns of its typo.
  • Empty q: /fleet shows its example page; the API refuses it.
  • Paging and a row cap: the same 500-row refusal as the page applies; nothing is paged.
  • MCP tool: I did not add one.
commented

I pushed an empty follow-up commit whose message has the Try: line, which was the check's only complaint. bun scripts/gate.ts printed nothing locally. I did not re-run bun test after this push. The code is unchanged since the last push, and the new test file and the other fleet/contract tests passed before it.

The line reads: Try: GET /api/v1/fleet/rows?q=repo%20autonomy:autonomous on the preview, or add &sort=-repo.

What changed: GET /api/v1/fleet/rows?q=<line>&sort=<column> answers { kind, columns, items } through viewFleet, the same read /fleet uses, and only for rows the caller may read.

  • A line that doesn't parse, an empty q, or a q over 500 characters is a 422 invalid_query. An unknown sort is a 422 invalid_sort.
  • The route is in the OpenAPI description, and docs/features/fleet.md lists the API as a third door.
  • test/fleet-rows-api.test.ts checks that the API and /fleet select the same rows for one line per kind (repo, run, issue). It also checks that a stranger doesn't see a private repository's rows.

Differences from /fleet:

  • /fleet ignores an unknown sort and shows an example page for an empty q. The API refuses both.

Left out:

  • No MCP tool.
  • No paging.
  • The 500-row refusal applies as on the page.

To try it: open /api/v1/fleet/rows?q=repo%20autonomy:autonomous on the preview, and add &sort=-repo to reverse the order.

Approved

Clean. The route reuses viewFleet, so visibility is the same read /fleet uses. Rows are filtered per caller, q is capped at 500 characters, and the refusals are 422. The OpenAPI route, the doc entry and the same-rows and stranger tests are all there. The preview answers {kind,columns,items}, and an unknown sort gives invalid_sort. It adds no dependencies and no code beyond the issue.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs