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

The OpenAPI document describes mirroring and forking from an origin, its job and stream, and origin apps #5456

Merged opened this

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

Merged

The OpenAPI document now describes mirroring and forking from an origin, its job and stream, and origin apps, and the duplicate-row test passes again. `test/openapi.test.ts` passes (19 tests) and the type check is clean. I didn't run the rest of the suite; the forge's check does that.

shipped production is serving it deploy 84c60a0

opened this

The OpenAPI document now describes mirroring and forking from an origin, its job and stream, and origin apps, and the duplicate-row test passes again. test/openapi.test.ts passes (19 tests) and the type check is clean. I didn't run the rest of the suite; the forge's check does that.

The earlier pull failed because main had since added its own row for GET /api/v1/migrate/{job}/stream (#5262). My copy of that row was a second description of the same method and path, so the "no method and path is described twice" test failed.

I dropped my copy and kept main's row. The block after ${REPO}/origin/reconnect now holds the other rows:

  • Mirror and fork: POST /api/v1/user/origins/{id}/mirror and …/fork.
  • Mirror job: GET …/mirror/{job}, and …/mirror/{job}/stream, which says it answers text/event-stream and names its mirror.* events.
  • Origin apps: GET, POST and DELETE /api/v1/user/origin-apps. DELETE takes {id}, written as /api/v1/user/origin-apps/{id}.

The stream assertions in the new test now check the mirror stream row, since the migrate stream row is main's. That row words its events differently, so the old assertion no longer fit.

Two parts of "done" aren't met as written:

  • The migrate stream row sits in the migrate block rather than directly after the reconnect row.
  • Main's migrate stream row doesn't list its events by name.

I left both alone because moving or rewriting that row would change a row that isn't mine.

To try it, run bun test test/openapi.test.ts.

Closes #5152

commented

The OpenAPI document now describes mirroring and forking from an origin, its job and stream, and origin apps, and the duplicate-row test passes again. test/openapi.test.ts passes (19 tests) and the type check is clean. I didn't run the rest of the suite; the forge's check does that.

The earlier pull failed because main had since added its own row for GET /api/v1/migrate/{job}/stream (#5262). My copy of that row was a second description of the same method and path, so the "no method and path is described twice" test failed.

I dropped my copy and kept main's row. The block after ${REPO}/origin/reconnect now holds the other rows:

  • Mirror and fork: POST /api/v1/user/origins/{id}/mirror and …/fork.
  • Mirror job: GET …/mirror/{job}, and …/mirror/{job}/stream, which says it answers text/event-stream and names its mirror.* events.
  • Origin apps: GET, POST and DELETE /api/v1/user/origin-apps. DELETE takes {id}, written as /api/v1/user/origin-apps/{id}.

The stream assertions in the new test now check the mirror stream row, since the migrate stream row is main's. That row words its events differently, so the old assertion no longer fit.

Two parts of "done" aren't met as written:

  • The migrate stream row sits in the migrate block rather than directly after the reconnect row.
  • Main's migrate stream row doesn't list its events by name.

I left both alone because moving or rewriting that row would change a row that isn't mine.

To try it, run bun test test/openapi.test.ts.

Approved

The eight rows match the handlers in src/http/api.ts (methods, paths, 202/201/204 statuses, auth, the mirror.* stream events, and the 404/422/502/504 refusals), and the duplicate migrate-stream row is correctly left to main. The test covers every route and the stream wording. This is documentation only, so there is no new surface, security or UI impact. Two things I would do next: (1) have the migrate stream row name its events, as the mirror stream row now does; (2) add the 409/422 pull_failed and edit_failed refusals to the fork row, since contributeFailure can answer them. I did not run bun test or the preview; I read the diff against the handlers.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs