Skip to content

feat: Wave API v1 consolidation (/w1/* via TypeSpec)#1048

Draft
pditommaso wants to merge 34 commits into
masterfrom
wave-api-v1-design
Draft

feat: Wave API v1 consolidation (/w1/* via TypeSpec)#1048
pditommaso wants to merge 34 commits into
masterfrom
wave-api-v1-design

Conversation

@pditommaso
Copy link
Copy Markdown
Collaborator

@pditommaso pditommaso commented May 20, 2026

Consolidates Wave's REST API into a stable v1 surface under the /w1/* prefix, with TypeSpec as the source of truth. New wave-api-v1 Gradle module hosts the TypeSpec spec; Micronaut OpenAPI plugin generates Java server interfaces and DTOs. All existing service-layer logic is reused unchanged; existing /v1alpha* and unversioned endpoints stay functional and carry Deprecation: true + Sunset headers.

What changed

  • New module wave-api-v1 — TypeSpec source under wave-api-v1/spec/, generated OpenAPI YAML, and 7 server interfaces + 40+ generated DTOs committed under src/main/java/
  • 7 v1 controllers (ServiceInfo, Credentials, Inspections, Builds, Mirrors, Scans, Containers) implementing the generated interfaces, delegating to existing services via thin mappers
  • ContainerRequestHandler extracted from the 765-line ContainerController so both alpha and v1 controllers share the same logic (refactor only — zero behaviour change, all 42 existing tests still pass)
  • AlphaDeprecationFilter stamps Deprecation: true + Sunset: Sat, 31 May 2027 23:59:59 GMT on responses from /v1alpha*, /container-token, /service-info, /validate-creds, /inspect, /scans
  • One v1-new endpoint: POST /w1/scans for resource-shape symmetry (no alpha equivalent — scans previously only flowed through container provisioning)
  • Docs: design spec (docs/superpowers/specs/2026-05-20-wave-api-v1-design.md), implementation plan (docs/superpowers/plans/2026-05-20-wave-api-v1.md), README + docs/api.md updated

v1 URL surface

Resource Method Path
Containers POST / GET / DELETE /w1/containers, /w1/containers/{id}, /w1/containers/{id}/status
Builds GET /w1/builds/{id}, /w1/builds/{id}/status, /w1/builds/{id}/logs, /w1/builds/{id}/condalock
Mirrors GET /w1/mirrors/{id}, /w1/mirrors/{id}/logs
Scans POST / GET /w1/scans, /w1/scans/{id}, /w1/scans/{id}/logs, /w1/scans/{id}/spdx
Inspections POST /w1/inspections
Credentials POST /w1/credentials/validate
Service info GET /w1/service-info

Test plan

Verified locally:

  • ./gradlew clean :wave-api-v1:generateOpenApi :generateApiCode assemble — BUILD SUCCESSFUL
  • 47 v1 tests pass (10 specs covering controllers, mappers, filter, parity, serialization)
  • 73 existing alpha controller tests pass — zero regression
  • Bundled openapi.yaml served at /openapi/openapi.yaml exposes 16 /w1/* paths; Swagger UI at /openapi/index.html

Reviewer checklist:

  • Confirm /w1 URL prefix is acceptable (no Docker Registry collision concern)
  • Confirm Sat, 31 May 2027 sunset date placeholder
  • Field-shape divergences flagged during implementation:
    • WaveBuildRecord v1 missing 4 fields vs internal (compression, buildTemplate, buildChildIds, scanChildIds)
    • ContainerMirrorResponse v1 missing 5 fields vs internal (offsetId, userName, userEmail, userId, scanId)
    • These were left as-is and need a follow-up PR to extend the TypeSpec models if full alpha parity is required
  • POST /w1/scans returns PENDING but the underlying scan job currently fails (workDir null at v1 layer) — needs follow-up to either require buildId/mirrorId or configure a standalone scan workspace before GA

Out of scope

  • /v1alpha*/metrics/* (kept on alpha)
  • Registry proxy /v2/* (Docker Registry protocol)
  • Error envelope redesign (RFC 7807), pagination, status-enum cleanup — deferred to v1.x or v2

Generated with Claude Code

pditommaso and others added 30 commits May 20, 2026 09:41
Captures the brainstorm outcome: introduce /w1 prefix, TypeSpec source
of truth in a new wave-api-v1 module, faithful rename of existing alpha
endpoints, alpha responses tagged with Deprecation + Sunset headers,
service layer reused as-is.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Step-by-step plan to land the v1 API: scaffold wave-api-v1 module,
migrate existing typespec/ sources, switch routes to /w1/*, add the
missing v1 endpoints, wire Micronaut OpenAPI codegen, implement
*V1Controller adapters with mappers and Spock specs, and add the
AlphaDeprecationFilter for backward-compat headers.

23 tasks, TDD where it makes sense, exact code blocks per step.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ock, scan submit, scan spdx, service-info)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…va interface per resource

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add cleanApiCode + generateApiCode Gradle tasks that copy the
Micronaut OpenAPI plugin output into wave-api-v1/src/main/java so
generated interfaces and models are version-controlled. Also remove
the plugin-injected source dirs from the main project sourceSet to
prevent duplicate compilation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…date

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…st and support authenticated inspections

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements GET /w1/builds/{id}, /status, /logs, /condalock endpoints
using BuildsApiSpec interface with BuildsV1Mapper for model translation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… POST submit)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…troller

Move all container request logic (submit, findRecord, findStatus, revoke)
into a new ContainerRequestHandler base class so both the alpha controller
and the upcoming ContainersV1Controller can share the same implementation.
ContainerController now extends ContainerRequestHandler with no behaviour change.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements ContainersApiSpec with POST /w1/containers, GET /w1/containers/{id},
GET /w1/containers/{id}/status, and DELETE /w1/containers/{id}, delegating to
ContainerRequestHandler via ContainersV1Mapper for full v1/internal type mapping.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ty for builds/mirrors/scans)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add AlphaDeprecationFilter that stamps `Deprecation: true` and
`Sunset: Sat, 31 May 2027 23:59:59 GMT` on all responses from
pre-v1 (alpha or unversioned) paths, leaving /w1/* untouched.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@pditommaso pditommaso changed the title docs: Wave API v1 consolidation design feat: Wave API v1 consolidation (/w1/* via TypeSpec) May 20, 2026
@pditommaso pditommaso marked this pull request as draft May 20, 2026 12:52
pditommaso and others added 4 commits May 21, 2026 07:21
These were stale committed copies missed by Task 3's migration of the
typespec/ directory into wave-api-v1/spec. The working tree no longer
contains them; this commit makes the index agree.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ntion

Renames the 9 newly added Spock tests (8 v1 controllers + AlphaDeprecationFilter)
from `*Spec.groovy` to `*Test.groovy` to align with the existing project naming
convention (176 `*Test.groovy` vs 9 `*Spec.groovy`). Also replaces a fully-qualified
`ContainerRequestFormat` reference with an import.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant