feat(api): sql-workbench routes as spec'd UI API extension endpoints (#20) #21

Merged
KofTwentyTwo merged 2 commits from feature/arch-ui-api-specs into develop 2026-10-14 12:21:37 +00:00
KofTwentyTwo commented 2026-10-14 00:48:26 +00:00 (Migrated from github.com)

Summary

Closes #20 (architecture review QRun-IO/qqq#1150, finding F2). sql-workbench was the largest blocker for the strict raw-route flip (G2, QRun-IO/qqq#1159).

  • Deletes SqlWorkbenchRouteProvider and its 21 raw /qqq/v1/sql-workbench/* routes.
  • Adds one MiddlewareSpecExtension named sql-workbench, with the established prefix /sql-workbench (so the full paths are unchanged), and 21 endpoint specs. JSON operations extend AbstractJsonEndpointSpec; the export stream extends AbstractEndpointSpec.
  • Security unchanged. The permission checks, read-only/role gates, rate and row limits and audit run in the specs exactly as before; tests cover the denied cases.
  • Fragment src/main/resources/openapi/qqq-v1/sql-workbench.yaml, checked by SqlWorkbenchApiContractTest (the qbit-collaboration#8 pattern).
  • Server tests run with withStrictUiApiRoutes(true).
  • Docs: docs/UI-API.md, README, CHANGELOG.
Method Path (under /qqq/v1/sql-workbench) operationId
GET /capabilities sqlWorkbenchGetCapabilities
GET /schema/{backendName} sqlWorkbenchGetSchema
POST /execute sqlWorkbenchExecute
POST /explain sqlWorkbenchExplain
GET /executions/{uuid}/rows sqlWorkbenchGetRows
GET /executions/{uuid}/export sqlWorkbenchExportResult
POST /executions/{uuid}/cancel sqlWorkbenchCancelExecution
GET /history sqlWorkbenchGetHistory
GET, POST /notebooks sqlWorkbenchListNotebooks, sqlWorkbenchCreateNotebook
GET, PUT, DELETE /notebooks/{id} sqlWorkbenchGetNotebook, ...UpdateNotebook, ...DeleteNotebook
POST /notebooks/{id}/publish, /duplicate sqlWorkbenchPublishNotebook, sqlWorkbenchDuplicateNotebook
GET /notebooks/{id}/versions, /versions/{n} sqlWorkbenchListVersions, sqlWorkbenchGetVersion
POST /notebooks/{id}/versions/{n}/restore sqlWorkbenchRestoreVersion
GET, POST /notebooks/{id}/snapshots sqlWorkbenchListSnapshots, sqlWorkbenchCreateSnapshot
DELETE /notebooks/{id}/snapshots/{snapshotId} sqlWorkbenchDeleteSnapshot

Wire changes: none. Next keeps working unchanged. Next can then vendor sql-workbench.yaml and drop these 21 calls from its off-spec list.

Draft until QQQ 4.1.0-RC.6 is released

The pom targets RC.6, which has the extension point (#1128). It was verified locally against core develop as -Dqqq.snapshot.version=4.1.0-ARCHRC6-SNAPSHOT:

  • mvn verify: 133 unit tests and 8 Postgres integration tests, 0 failures;
  • coverage and checkstyle gates pass.

CI goes green once RC.6 is on Central.

🤖 Generated with Claude Code

## Summary Closes #20 (architecture review QRun-IO/qqq#1150, finding F2). sql-workbench was the largest blocker for the strict raw-route flip (G2, QRun-IO/qqq#1159). - Deletes `SqlWorkbenchRouteProvider` and its 21 raw `/qqq/v1/sql-workbench/*` routes. - Adds one `MiddlewareSpecExtension` named `sql-workbench`, with the established prefix `/sql-workbench` (so the full paths are unchanged), and 21 endpoint specs. JSON operations extend `AbstractJsonEndpointSpec`; the export stream extends `AbstractEndpointSpec`. - **Security unchanged.** The permission checks, read-only/role gates, rate and row limits and audit run in the specs exactly as before; tests cover the denied cases. - Fragment `src/main/resources/openapi/qqq-v1/sql-workbench.yaml`, checked by `SqlWorkbenchApiContractTest` (the qbit-collaboration#8 pattern). - Server tests run with `withStrictUiApiRoutes(true)`. - Docs: `docs/UI-API.md`, README, CHANGELOG. | Method | Path (under `/qqq/v1/sql-workbench`) | operationId | |---|---|---| | GET | `/capabilities` | `sqlWorkbenchGetCapabilities` | | GET | `/schema/{backendName}` | `sqlWorkbenchGetSchema` | | POST | `/execute` | `sqlWorkbenchExecute` | | POST | `/explain` | `sqlWorkbenchExplain` | | GET | `/executions/{uuid}/rows` | `sqlWorkbenchGetRows` | | GET | `/executions/{uuid}/export` | `sqlWorkbenchExportResult` | | POST | `/executions/{uuid}/cancel` | `sqlWorkbenchCancelExecution` | | GET | `/history` | `sqlWorkbenchGetHistory` | | GET, POST | `/notebooks` | `sqlWorkbenchListNotebooks`, `sqlWorkbenchCreateNotebook` | | GET, PUT, DELETE | `/notebooks/{id}` | `sqlWorkbenchGetNotebook`, `...UpdateNotebook`, `...DeleteNotebook` | | POST | `/notebooks/{id}/publish`, `/duplicate` | `sqlWorkbenchPublishNotebook`, `sqlWorkbenchDuplicateNotebook` | | GET | `/notebooks/{id}/versions`, `/versions/{n}` | `sqlWorkbenchListVersions`, `sqlWorkbenchGetVersion` | | POST | `/notebooks/{id}/versions/{n}/restore` | `sqlWorkbenchRestoreVersion` | | GET, POST | `/notebooks/{id}/snapshots` | `sqlWorkbenchListSnapshots`, `sqlWorkbenchCreateSnapshot` | | DELETE | `/notebooks/{id}/snapshots/{snapshotId}` | `sqlWorkbenchDeleteSnapshot` | **Wire changes: none.** Next keeps working unchanged. Next can then vendor `sql-workbench.yaml` and drop these 21 calls from its off-spec list. ## Draft until QQQ 4.1.0-RC.6 is released The pom targets RC.6, which has the extension point (#1128). It was verified locally against core develop as `-Dqqq.snapshot.version=4.1.0-ARCHRC6-SNAPSHOT`: - `mvn verify`: 133 unit tests and 8 Postgres integration tests, 0 failures; - coverage and checkstyle gates pass. CI goes green once RC.6 is on Central. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
KofTwentyTwo commented 2026-10-14 12:15:22 +00:00 (Migrated from github.com)

QQQ 4.1.0-RC.6 is released. Verified locally against it with ./mvnw -B verify. This PR also adopts qbit-build-parent 2.1.0 with guardrails enforced (qbit.guardrails.enforce=true) and strict raw-route mode; every guardrail passes. Marked ready for review.

QQQ 4.1.0-RC.6 is released. Verified locally against it with `./mvnw -B verify`. This PR also adopts `qbit-build-parent` 2.1.0 with guardrails enforced (`qbit.guardrails.enforce=true`) and strict raw-route mode; every guardrail passes. Marked ready for review.
Sign in to join this conversation.