Skip to content

Add generated TUS protocol contract canary#167

Draft
kvz wants to merge 63 commits into
mainfrom
tus-gen
Draft

Add generated TUS protocol contract canary#167
kvz wants to merge 63 commits into
mainfrom
tus-gen

Conversation

@kvz

@kvz kvz commented May 26, 2026

Copy link
Copy Markdown
Member

Why: this is the Android companion canary for the contract-generated TUS effort. tus-android-client delegates wire-level behavior to tus-java-client, so this PR keeps protocol truth generated from the shared contract while proving Android-specific content URI, storage, callback, and request-observation paths still work.

Experimental Status

Experimental work: this PR is part of an exploratory contract/generated docs and SDK effort, and is intentionally kept as a Draft while the approach is validated.

What Changed

  • add a generated test-side TUS protocol/feature fixture from API2 contracts
  • add a Robolectric test that consumes the generated singleUploadLifecycle feature and verifies TusPreferencesURLStore satisfies the generated store-resume-url primitive
  • add checked-in Robolectric proofs for upload callbacks, upload body headers, custom request headers, request-ID headers, terminate upload, creation-with-upload, deferred-length upload, request lifecycle hooks, and retry-offset recovery
  • have those proofs read contract-owned scenario facts from scenario JSON instead of repeating protocol/API facts locally
  • extend the shared Android devdock scenario helper with contract-document readers for custom headers, request-ID toggles, request-ID header names, terminate-upload facts, request lifecycle expectations, and retry-offset recovery expectations
  • allow sibling and CI-nested tus-java-client Gradle composite builds so Android QA can use the companion Java branch before the new hooks/deferred-length APIs are released to Maven
  • tidy the CI trigger block by removing a misplaced runs-on, adding ready_for_review, and enabling manual workflow_dispatch

Validation

  • ANDROID_HOME=/Users/kvz/.cache/devdock/android-sdk ANDROID_SDK_ROOT=/Users/kvz/.cache/devdock/android-sdk ./gradlew check
  • api2/bin/cli.ts contracts sdks --no-motd --target tus --platform android --sdk-root ../tus-android-client --compare-existing
  • api2/bin/cli.ts contracts sdks qa --no-motd --target tus --platform android --dry-run
  • core/bin/devdock.ts exec tstrun cmds/ContractsCommand.vitest.ts -vv --max-time-per-test 420 from the API2 companion checkout
  • core/bin/devdock.ts exec tstrun system/sdk_examples/android-tus-transloadit-assembly-upload.test.ts -vv --max-time-per-test 900 from the API2 companion checkout
  • GitHub Actions on this PR: android (17) and android (21) passed on commit 21b3cdf

Companion PRs (tus org only)

Notes

Standalone CI checks out tus-java-client@tus-gen into the Android checkout and settings.gradle accepts both sibling and nested composite builds. That keeps this Draft consumable before the Java lifecycle hooks and deferred-length API are released to Maven.

Latest: Android now proves deferred-length uploads, request lifecycle hooks, and retry-offset recovery. The latest retry proof simulates one post-PATCH IO failure from scenario data, observes the recovery HEAD, and finishes with the final PATCH against real API2/tusd.

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