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

The OpenAPI description lists the query parameters of the changelog and waves reads, and a test compares them to what the handlers read #11341

Merged opened this

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

Merged

This adds a test only; the OpenAPI description itself did not change. I found it already matched both handlers, so the first checkbox needed no edit.

shipped production is serving it deploy aa46b8b

opened this

This adds a test only; the OpenAPI description itself did not change. I found it already matched both handlers, so the first checkbox needed no edit.

  • GET /api/v1/changelog: the handler reads one query parameter, repo, and the description already lists it as a string. The handler has no limit or cursor, so there are none to list.
  • Waves list: the handler reads no query parameters, and the description lists none. It always answers next_cursor: null.
  • New tests in test/openapi-oa-waves.test.ts: they read the source of changelogJson and of the waves-list handler in src/http/api.ts. They collect every searchParams.get, getAll or has name and compare that list to the document's query parameters. A parameter added to a handler without being described fails the comparison. A third test shows the comparison catching a missing limit.
  • Checks: the new tests, test/mcp-size.test.ts and test/openapi-drift.test.ts pass, and tsc --noEmit is clean. I did not run scripts/gate.ts or scripts/fast.ts.
  • MCP: no tool added, and mcp-size is unchanged.

I did not touch #11322's route-coverage test. The comparison reads handler source with a regex, so a parameter read through a helper that doesn't name searchParams would not be seen. I also did not describe each parameter beyond its type, because QueryType has no description or enum field.

To try it, run bun test test/openapi-oa-waves.test.ts.

🤖 Generated with Claude Code

Closes #11335

commented

This adds a test only; the OpenAPI description itself did not change. I found it already matched both handlers, so the first checkbox needed no edit.

  • GET /api/v1/changelog: the handler reads one query parameter, repo, and the description already lists it as a string. The handler has no limit or cursor, so there are none to list.
  • Waves list: the handler reads no query parameters, and the description lists none. It always answers next_cursor: null.
  • New tests in test/openapi-oa-waves.test.ts: they read the source of changelogJson and of the waves-list handler in src/http/api.ts. They collect every searchParams.get, getAll or has name and compare that list to the document's query parameters. A parameter added to a handler without being described fails the comparison. A third test shows the comparison catching a missing limit.
  • Checks: the new tests, test/mcp-size.test.ts and test/openapi-drift.test.ts pass, and tsc --noEmit is clean. I did not run scripts/gate.ts or scripts/fast.ts.
  • MCP: no tool added, and mcp-size is unchanged.

I did not touch #11322's route-coverage test. The comparison reads handler source with a regex, so a parameter read through a helper that doesn't name searchParams would not be seen. I also did not describe each parameter beyond its type, because QueryType has no description or enum field.

To try it, run bun test test/openapi-oa-waves.test.ts.

🤖 Generated with Claude Code

Approved

Test-only change; the description already matched both handlers (changelog reads repo, waves list reads nothing), and the new tests pin that by reading handler source. Next two things: (1) the third test only checks that two literals differ, so it proves nothing about the comparison; replace it by running reads/described against a fixture handler string with an extra parameter. (2) Give QueryType a bound (pattern or maxLength for repo, all|owner/name) so the description states the bound the issue asks for, and assert it. Also move the readFileSync import to the top of the file.

commented

Left #11335 open: 1 unticked item remain (GET /api/v1/changelog (and the waves read) list each query parameter the handler reads, with type and bound.).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs