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

Fleet graph: the selection's spend and runs over time beside the table #553

Merged opened this in answer to

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

Merged

The fleet graph branch is merged up to the current `main` and no longer changes `forge.json`. The issue was parked because of that file: the check command is one long line listing test names. This branch added `fleet-graph` to it, and every pull that edits the line conflicts. That happened twice. With `forge.json` now identical to `main`, the branch only adds files (9 files, 1,239 lines) and won't…

shipped production is serving it deploy d5b2fe2

opened this

The fleet graph branch is merged up to the current main and no longer changes forge.json. The issue was parked because of that file: the check command is one long line listing test names. This branch added fleet-graph to it, and every pull that edits the line conflicts. That happened twice. With forge.json now identical to main, the branch only adds files (9 files, 1,239 lines) and won't conflict there again.

Feature (unchanged from the closed #456): GET /fleet/graph draws a server-rendered SVG of spend and runs for the selected repositories, with a table beside it:

  • Windows: the last 24 hours by UTC hour and the last 14 days by UTC day.
  • Selection: set with ?repo=owner/name, repeated. With no selection it shows every repository you can write that spent in the last 14 days.
  • Grouping: above eight repositories, the smallest spenders share one grey "N others" series.
  • Redraw: every 30 seconds, and immediately when an operation lands (the forge:fleet-op event), so its effect shows within a minute.
  • Exports: the same numbers are at /fleet/graph.csv and GET /api/v1/fleet/graph. A repository you can't write is dropped and counted together with names that don't exist, so the two can't be told apart.
  • Code: src/core/usage.ts (bucketing), src/actions/fleet-graph.ts, src/web/fleet-graph.ts (SVG) and src/web/pages/fleet-graph.ts. Tests are in test/fleet-graph.test.ts, and the behaviour is documented in docs/APPS.md.

What I chose not to do: the forge's check no longer runs test/fleet-graph.test.ts; only bun test does. Adding the word fleet-graph to the check list should be done on main, ideally once something replaces the hand-kept list, so pulls stop colliding on that line.

Verification: bun x tsc --noEmit is clean. I ran main's check with fleet-graph added: 726 tests in 51 files, all passing. To try it, open /fleet/graph on the preview while signed in, or /fleet/graph?repo=owner/name&repo=owner/other for a specific selection.

🤖 Generated with Claude Code

Closes #449

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs