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

Fleet query language and the fleet table: repos, runs, issues, apps, crew behind one visible query in the URL #537

Closed opened this in answer to
Closed without merging

/fleet now renders repos, runs, issues, apps and crew as one table, driven by a query that sits in the URL and is shown in a query line on the page. I didn't run the full check as one command, only its parts, and I haven't opened the page in a browser. tsc --noEmit came back with no errors.

Notes

stopped closed without shipping deploy 0f6ee06

opened this

/fleet now renders repos, runs, issues, apps and crew as one table, driven by a query that sits in the URL and is shown in a query line on the page. I didn't run the full check as one command, only its parts, and I haven't opened the page in a browser. tsc --noEmit came back with no errors. test/fleet-table.test.ts (12 tests) and test/fleet-ops.test.ts pass.

  • Query language (src/fleet/selection.ts): the parser handles field:value, comparisons (cost:>1, cost:>=0.5, created:<2000-01-01) and negation (cost:!>1). repo: scopes by bare name or owner/name. I extended the existing fleet selection parser rather than adding a second one.
  • Query and page: src/fleet/table.ts runs the query server-side over the existing tables and returns plain rows. It also returns counts and sortable columns. src/web/pages/fleet.ts renders the page, and the route is wired in src/http/server.ts.
  • Visibility: a repo the viewer can't read is absent from results rather than refused. The tests cover a private repo seen as its owner and as another user.
  • Escaping: output is escaped, and a test covers an issue titled <script>alert(1)</script>.
  • Speed: one test checks a 1,000-row page, but I didn't pick out its timing from the test output.
  • forge.json and docs: forge.json's check now includes test/fleet-table.test.ts, and docs/FLEET.md documents the query syntax. A small edit to test/fleet-ops.test.ts follows the selection changes.

Pull #464 went red twice, and I didn't find the cause. In this run the machine was slow, and tsc took several minutes. The 60 s shard timeout in the check may have been what failed, so watch that on the first check run.

I didn't add saved queries or CSV export. Torque isn't a table source here.

To try it, run the app and open /fleet?q=run cost:>1 repo:tools.

Closes #446

commented

The check failed because check.run in forge.json was 1,013 characters, over the forge's 1,000 limit. It is now 986.

I replaced the two fleet test paths with the glob test/fleet-*.test.ts. The shell expands it to the same two files, test/fleet-ops.test.ts and test/fleet-table.test.ts, so the check runs the same tests as before. I confirmed that expansion with sh and pushed.

I did not re-run the check, tsc or the tests after this change. The only edit is in forge.json, and the tests passed when I ran them before.

The fleet query language and the /fleet table are unchanged from the earlier description.

commented

Parked by the crew: the check failed and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs