Skip to content

feat(listReservations): lock in from/to ISO-8601 window passthrough (0.2.3)#78

Merged
amavashev merged 1 commit into
mainfrom
feat/list-reservations-from-to
May 21, 2026
Merged

feat(listReservations): lock in from/to ISO-8601 window passthrough (0.2.3)#78
amavashev merged 1 commit into
mainfrom
feat/list-reservations-from-to

Conversation

@amavashev
Copy link
Copy Markdown
Collaborator

Summary

Client-side companion to cycles-protocol-v0.yaml revision 2026-05-21 and cycles-server#160 (which together added from / to ISO-8601 window-filter query params to GET /v1/reservations). Matches the same shape we landed in runcycles/cycles-client-python#66, runcycles/cycles-client-typescript#103, and runcycles/cycles-client-rust#39.

What this PR does

DefaultCyclesClient.listReservations(Map<String, String>) is already permissive — it forwards arbitrary keys to the URL query string. So from / to work over the wire today, no code change. This PR:

  • Adds a regression test on DefaultCyclesClient.listReservations (cycles-client-java-spring/src/test/java/.../DefaultCyclesClientTest.java) confirming the new ISO-8601 params land in the GET path. Pins the contract so future tightening of the Map signature cannot silently drop the new keys.
  • Bumps revision from 0.2.2 → 0.2.3 via the single .mvn/maven.config source of truth (propagates to both cycles-client-java-spring and cycles-demo-client-java-spring poms — the drift-protection invariant from the CI-friendly-versions refactor in [Unreleased]).
  • Updates AUDIT.md and CHANGELOG.md.

Wire-format note

Spring's WebClient leaves colons unencoded in the query component (RFC 3986 §3.4 permits this), so the emitted path is:

/v1/reservations?from=2026-05-21T00:00:00Z&to=2026-05-22T00:00:00Z&tenant=acme

— not the percent-escaped form. cycles-server accepts both shapes; the test asserts the literal WebClient output.

Call-site syntax

client.listReservations(Map.of(
    "tenant", "acme",
    "from",   "2026-05-21T00:00:00Z",
    "to",     "2026-05-22T00:00:00Z"
));

No reserved-keyword issue (unlike Python where from requires a dict-unpack workaround).

Verification

  • mvn -B verify --file cycles-client-java-spring/pom.xml: 433 tests pass.
  • JaCoCo coverage gate met ([INFO] All coverage checks have been met.) per the project's ≥95% rule.

Test plan

  • CI green
  • (After merge) optional smoke against a v0.1.25.20 cycles-server with a windowed listReservations call

Out of scope

  • The client's permissive Map<String, String> signature is left as-is; a typed ListReservationsParams would be a separate ergonomic discussion (parallel to the Rust client's existing strongly-typed pattern).

Closes the Spring Boot starter side of the issue cluster for runcycles/cycles-server#159.

…0.2.3)

Client-side companion to cycles-protocol-v0.yaml revision 2026-05-21
(runcycles/cycles-protocol#97) and runcycles/cycles-server#160. Closes
the Spring Boot starter side of issue #159.

The existing `DefaultCyclesClient.listReservations(Map<String, String>)`
signature already forwards arbitrary keys to the URL query string, so
the new `from` and `to` ISO-8601 date-time params work over the wire
today without a code change. This commit adds a regression test that
pins the contract — future tightening of the Map signature cannot
silently drop the new params.

Wire-format note caught by the test: Spring's WebClient leaves colons
unencoded in the query component (RFC 3986 §3.4 permits this in the
query production), so the emitted form is

    /v1/reservations?from=2026-05-21T00:00:00Z&to=2026-05-22T00:00:00Z&tenant=acme

— not the percent-escaped variant. cycles-server accepts both shapes;
the assertion now matches the literal WebClient output.

No protocol or wire-format change; servers older than v0.1.25.20
silently ignore the new params per the additive-parameter guarantee
in cycles-protocol-v0.yaml. 433 tests pass; JaCoCo coverage gate met.

Bumped to 0.2.3 via the single .mvn/maven.config source of truth
(propagates to both cycles-client-java-spring/pom.xml and
cycles-demo-client-java-spring/pom.xml, keeping starter + demo in
lockstep — the drift-protection invariant from the CI-friendly
versions refactor in [Unreleased]). Updated AUDIT.md and CHANGELOG.md.
@amavashev amavashev merged commit 8422e4b into main May 21, 2026
6 checks passed
@amavashev amavashev deleted the feat/list-reservations-from-to branch May 21, 2026 17:04
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