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

The OpenAPI document describes removing a team member, itself, and /metrics #5168

opened this

Merged 44d 22h ago, live in production

The OpenAPI document now has rows for the three loose routes, and a test asserts each is served. The openapi tests pass (24). I did not run the full suite, and bun x tsc --noEmit could not run here: it fails with "Cannot find type definition file for 'bun'".

Notes

opened this

The OpenAPI document now has rows for the three loose routes, and a test asserts each is served. The openapi tests pass (24). I did not run the full suite, and bun x tsc --noEmit could not run here: it fails with "Cannot find type definition file for 'bun'".

  • Team member removal: DELETE /api/v1/orgs/{org}/teams/{team}/members/{username} sits directly after the team members row. It needs an admin-scope token and answers 204. Its refusals are not_found (no such team, or the user is not in it) and last_owner (409, an organisation keeps at least one owner).
  • GET /api/v1/openapi.json: The row needs no auth and answers 308 to /contract/openapi.json.
  • GET /metrics: The row needs auth, is for site admins only, and answers 200 as Prometheus text (text/plain; version=0.0.4). A caller who is not a site admin gets not_found (404). The summary points to docs/METRICS.md.
  • Tests: The three paths are added to the want list in test/openapi-oa-agents.test.ts.

#5117's list of routes not yet described isn't in this tree, so I had nothing to remove from it. If it lands first, these three come off its list.

The new rows are in src/contract/openapi.ts.

Closes #5153

commented

The OpenAPI document now has rows for the three loose routes, and a test asserts each is served. The openapi tests pass (24). I did not run the full suite, and bun x tsc --noEmit could not run here: it fails with "Cannot find type definition file for 'bun'".

  • Team member removal: DELETE /api/v1/orgs/{org}/teams/{team}/members/{username} sits directly after the team members row. It needs an admin-scope token and answers 204. Its refusals are not_found (no such team, or the user is not in it) and last_owner (409, an organisation keeps at least one owner).
  • GET /api/v1/openapi.json: The row needs no auth and answers 308 to /contract/openapi.json.
  • GET /metrics: The row needs auth, is for site admins only, and answers 200 as Prometheus text (text/plain; version=0.0.4). A caller who is not a site admin gets not_found (404). The summary points to docs/METRICS.md.
  • Tests: The three paths are added to the want list in test/openapi-oa-agents.test.ts.

#5117's list of routes not yet described isn't in this tree, so I had nothing to remove from it. If it lands first, these three come off its list.

The new rows are in src/contract/openapi.ts.

commented

I merged main into the branch and pushed it. The only conflict was in src/contract/openapi.ts, and I resolved it by keeping both sides.

  • My side: the DELETE /api/v1/orgs/{org}/teams/{team}/members/{username} entry, which is the removal of a team member this pull documents.
  • main's side: the reworded GET /api/v1/contribute summary.

The openapi and contract tests and test/crew-proposal.test.ts pass (66 tests, 0 failures). The first full bun test run showed one failure, a 5-second timeout in test/crew-proposal.test.ts ("one tap lands a commit on the head branch and a note on the pull"). It passed on a rerun. I didn't check the other test files after that one failure.

I couldn't run the type check here. tsc fails with "Cannot find type definition file for 'bun'", so the forge's check will be the first type check of the merged code.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs