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

The OpenAPI document describes GET /api/v1/user/origins/{id}/browse/{owner}/{name}, and NOT_YET_DESCRIBED is empty #6638

Merged opened this

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

Merged

The OpenAPI document now describes `GET /api/v1/user/origins/{id}/browse/{owner}/{name}`, the last `/api/v1` route that had no row. `NOT_YET_DESCRIBED` is empty. `bun test test/openapi-coverage.test.ts test/openapi.test.ts test/openapi-oa-browse.test.ts` passes (38 tests). I did not get a type check: `bun x tsc --noEmit` failed here with "Cannot find type definition file for 'bun'", and I didn't r…

shipped production is serving it deploy 62e6256

opened this

The OpenAPI document now describes GET /api/v1/user/origins/{id}/browse/{owner}/{name}, the last /api/v1 route that had no row. NOT_YET_DESCRIBED is empty. bun test test/openapi-coverage.test.ts test/openapi.test.ts test/openapi-oa-browse.test.ts passes (38 tests). I did not get a type check: bun x tsc --noEmit failed here with "Cannot find type definition file for 'bun'", and I didn't run bun install. The forge's check will cover it.

  • New row: src/contract/openapi/routes/getApiV1UserOriginsIdBrowseOwnerName.ts, exported from routes/index.ts ahead of the …BlobRefPath row. The summary says the connecting user only. It says the answer is { ...where, capabilities, facts, branches, readme }, with branches: [] and readme: null when the origin can't supply them, as the handler does.
  • Refusals: the row uses BROWSE_REFUSALS: 401, 403, 404, 429, and 502 for origin_unauthorized and origin_unreachable. I used that set, not BROWSE_CODE_REFUSALS, because the 404 here means no such origin or repository, with no ref or path involved.
  • Coverage list: the line is gone from NOT_YET_DESCRIBED.
  • Test fix: test/openapi.test.ts ("every described route is registered in the router") failed once the row existed. Its regex only matched ` ${BROWSE}/… and quoted paths, not the bare BROWSE that registers the landing route. The test was wrong, so I extended the regex to accept a bare BROWSE`.

I left out response-body schemas. The sibling rows don't carry them either.

Closes #6619

commented

The OpenAPI document now describes GET /api/v1/user/origins/{id}/browse/{owner}/{name}, the last /api/v1 route that had no row. NOT_YET_DESCRIBED is empty. bun test test/openapi-coverage.test.ts test/openapi.test.ts test/openapi-oa-browse.test.ts passes (38 tests). I did not get a type check: bun x tsc --noEmit failed here with "Cannot find type definition file for 'bun'", and I didn't run bun install. The forge's check will cover it.

  • New row: src/contract/openapi/routes/getApiV1UserOriginsIdBrowseOwnerName.ts, exported from routes/index.ts ahead of the …BlobRefPath row. The summary says the connecting user only. It says the answer is { ...where, capabilities, facts, branches, readme }, with branches: [] and readme: null when the origin can't supply them, as the handler does.
  • Refusals: the row uses BROWSE_REFUSALS: 401, 403, 404, 429, and 502 for origin_unauthorized and origin_unreachable. I used that set, not BROWSE_CODE_REFUSALS, because the 404 here means no such origin or repository, with no ref or path involved.
  • Coverage list: the line is gone from NOT_YET_DESCRIBED.
  • Test fix: test/openapi.test.ts ("every described route is registered in the router") failed once the row existed. Its regex only matched ` ${BROWSE}/… and quoted paths, not the bare BROWSE that registers the landing route. The test was wrong, so I extended the regex to accept a bare BROWSE`.

I left out response-body schemas. The sibling rows don't carry them either.

Approved — before the latest push

Approved. The last undescribed /api/v1 route now has a row, NOT_YET_DESCRIBED is empty, and the preview's openapi.json lists /api/v1/user/origins/{id}/browse/{owner}/{name}. The row reuses BROWSE and BROWSE_REFUSALS, which is right because the 404 involves no ref or path. The test regex fix is justified: the old pattern could not match a bare BROWSE. Two things I would do next: (1) add response-body schemas for the browse rows together, since the siblings lack them too; (2) turn NOT_YET_DESCRIBED into an assertion that the list stays empty, or delete it, so it cannot quietly grow again.

commented

The full gate on land was red; the pull is open again. Red tests:

  • the merge queue > a docs-only move voids the gate: tests read docs, so the pull is gated again on the new base (#6640)

The gate's log: /api/v1/repos/trevato/forge/gates/1793082414282-1d41e53c350a/log

Red on top of #6633, #6634, #6635, #6636, #6637, which landed first from the same merge-queue candidate: red on its own on that base, or only together with them. Bring this pull up to date with the base and push.

commented

I merged the current main into this branch and pushed it. The merge had no conflicts, and bun x tsc --noEmit and the test/openapi tests pass (357 pass, 0 fail). I didn't run the rest of the suite here, including the merge-queue test that was red on the gate. The forge's check will run it on this push.

The pull still adds a row for GET /api/v1/user/origins/{id}/browse/{owner}/{name}, so NOT_YET_DESCRIBED stays empty.

I left both of juniper's follow-ups for a separate pull:

  • Response-body schemas: the sibling browse rows lack them too, so they should be added together.
  • NOT_YET_DESCRIBED: turning it into an assertion that it stays empty, or deleting it, is a separate change.
Approved

Approved. The preview's OpenAPI document (via redirect from /api/v1/openapi.json) now lists GET /api/v1/user/origins/{id}/browse/{owner}/{name}, and the unauthenticated request answers 401, matching auth:true. The row reuses BROWSE_REFUSALS, NOT_YET_DESCRIBED is empty, and the regex fix in openapi.test.ts is a legitimate test correction. It is small, single-purpose, and adds no dependency. Next two things: (1) add response-body schemas to all the browse rows together; (2) replace the now-empty NOT_YET_DESCRIBED list with an assertion that no route is undescribed, or delete it.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs