Skip to content

build: add a runnable sdk-example module as an end-to-end smoke test#102

Merged
OmarAlJarrah merged 3 commits into
mainfrom
build/example-module
Jun 16, 2026
Merged

build: add a runnable sdk-example module as an end-to-end smoke test#102
OmarAlJarrah merged 3 commits into
mainfrom
build/example-module

Conversation

@OmarAlJarrah

Copy link
Copy Markdown
Member

Summary

Adds an sdk-example application module that exercises the assembled SDK end-to-end, as a usability smoke test. It wires all four pluggable seams — OkioIoProvider (I/O), OkHttpTransport (transport), an HttpPipeline with one step per user-installable pillar, and JacksonSerde — and performs a typed request/response round-trip against an embedded HTTPS MockWebServer (deterministic, no network access required). A JUnit smoke test drives the same wiring under build.

Gate handling (all satisfied, none weakened):

  • excluded from the Kover aggregate (application code, mirroring the existing fixture exclusion) so it can't drag the 80% floor;
  • excluded from apiValidation (no stable ABI for an app);
  • explicit-API strict mode, ktlint, detekt, and the Java-8 toolchain are all satisfied.

Full ./gradlew build is green with the module included, and ./gradlew :sdk-example:run prints the typed round-trip.

The issue also lists a CI smoke job, which is blocked on CI existing (#70 / #85); this delivers the runnable module and its in-build smoke test now, structured so a CI job can invoke it once CI lands.

Closes #73

Until now nothing exercised the assembled toolkit as a whole, and there
was no executable reference showing how the pluggable seams fit together.

Add `sdk-example`, an `application`-plugin module that wires the four
pluggable pieces and issues a real HTTP exchange through the public API:

  - OkioIoProvider installed into the Io seam,
  - the OkHttp transport as the terminal HttpClient,
  - an HttpPipeline carrying one step per user-installable pillar
    (REDIRECT, RETRY, AUTH, LOGGING),
  - JacksonSerde for typed request/response bodies.

The request runs against an embedded mockwebserver3 driven from `main()`,
so the sample is deterministic and needs no network: `:sdk-example:run`
serializes a typed request, POSTs it, and deserializes the typed response.
The AUTH pillar refuses to stamp credentials over plaintext, so the
embedded server speaks HTTPS with a self-signed certificate (okhttp-tls)
and the transport is configured to trust it — the same shape a production
caller would use. A smoke test drives the identical wiring under `build`.

The module is intentionally not a published library, so it opts out of
the gates that only make sense for the public ABI:

  - no `maven-publish`/`signing` — it is a sample, never released;
  - excluded from binary-compatibility checks via
    `apiValidation.ignoredProjects`, since application code has no stable
    ABI to snapshot;
  - left out of the Kover aggregate (it does not apply the plugin), so
    `main()`-centric sample code does not drag the 80% line-coverage floor
    down. Its smoke test still runs and proves the sample works.

It keeps explicit-API strict mode, ktlint, detekt, and allWarningsAsErrors
(inherited from the root build) and stays on the Java 8 toolchain.
Depend on the non-junit5 `mockwebserver3` in the sample: it manages the
embedded server's lifecycle by hand from main() and the smoke test, so the
JUnit 5 extension — and the JUnit it would otherwise drag onto the runtime
classpath — is not needed.

Also document the retry pillar's idempotency behavior in the sample (the
POST is retried because its in-memory body is replayable, so point readers
at IdempotencyKeyStep for non-idempotent writes) and update the module count
in CLAUDE.md to eleven, noting sdk-example as an unpublished usage sample.
@OmarAlJarrah OmarAlJarrah force-pushed the build/example-module branch from 0650744 to 987c36a Compare June 16, 2026 22:06
@OmarAlJarrah OmarAlJarrah merged commit de34bd2 into main Jun 16, 2026
1 check passed
@OmarAlJarrah OmarAlJarrah deleted the build/example-module branch June 16, 2026 22:15
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.

Add a runnable example module as an end-to-end usability smoke test

1 participant