Build Android against the published protocol by default - #836
Conversation
Size budgetsMeasured head:
Repository writers, including the PR author, can accept current soft-budget breaches with a reason: Use one command per platform; several lines can share a comment. Post after this report is ready for the current head. Commands in edited comments are not accepted. Acceptance applies to each currently exceeded metric up to its recorded size. Further growth or a newly exceeded metric needs fresh acceptance. Hard-budget increases require a reviewed change to Bundle and package sizeWeb bundle sizes cover shipped runtime JavaScript. Package sizes cover the full published archive, including any source maps, declarations, and documentation it contains.
React Native package files (uncompressed)These are uncompressed file sizes; they do not sum to the compressed package size above.
Android package files (uncompressed)These are uncompressed file sizes; they do not sum to the compressed package size above.
Measured from the PR base SHA and PR head SHA. Web bundle rows sum shipped |
Install this buildOpen Tophat, select your target device, then click Install. Links open on the Mac running Tophat.
Checkout Kit E2E results
|
|
|
||
| VERSION=$(version_catalog_value "$ANDROID_VERSION_FILE" "checkoutKitAndroid") | ||
| ANDROID_PROTOCOL_VERSION=$(version_catalog_value "$ANDROID_VERSION_FILE" "embeddedCheckoutProtocolAndroid") | ||
| ANDROID_PROTOCOL_VERSION=$(version_catalog_value "$ANDROID_VERSION_FILE" "embeddedCheckoutProtocolAndroidDependency") |
There was a problem hiding this comment.
Do we need the "dependency" suffix?
There was a problem hiding this comment.
I've tweaked the naming in the last commit
d7323f1 to
91cb2ef
Compare
What changes are you making?
Android previously compiled the protocol from local source while its published POM pointed consumers at a separate Maven artifact. That allowed Kit to ship references to classes missing from its declared dependency.
The SDK and Android sample now compile against the pinned Maven Central protocol artifact in normal builds, CI, and releases. Joint development opts into source with
dev android <command> --local(for example,dev android test --localordev android api check --local), or-PuseLocalProtocol=truewhen invoking Gradle directly. The flag is supported by Android build, sample build, start, test, lint, format, check, and API commands. Remote Kit publication rejects local mode. React Native'sdev rn android --localanddev rn test android --localflows automatically enable local protocol mode when publishing Kit and ECP to Maven Local.The protocol release version and Kit's dependency pin are separate so a protocol release PR can merge before Kit adopts the new artifact. Protocol tests and lint run independently in CI, and Kit publication runs unit tests and API checks before uploading. Repository-wide
dev test,dev lint, anddev formatretain Kotlin protocol source coverage through standalone protocol commands, while Android continues resolving published ECP by default.A small
:lib:verifyPublishedProtocoltask also requires release and unit-test classpaths to resolve the declared ECP module at exactly the catalog-pinned version. It catches project substitution and version drift introduced by dependency resolution, runs automatically with SDK unit tests and remote publication, and skips explicit local mode. This retains the useful safeguard from #832 without adding a fixture framework or another build-mode toggle.Release process
For a feature spanning all three packages, the order is ECP → Android Kit → React Native:
embeddedCheckoutProtocolAndroidReleasewith the protocol changes and API baseline. Keep Kit'sembeddedCheckoutProtocolAndroidat the existing published version while this PR passes CI, merges, and releases.checkoutKitAndroid. Run normal SDK/sample CI and API checks against that published ECP version, then merge and publish Kit to Maven Central.checkoutKit.nativeSdkVersions.androidand the RN package's ownversion. Run normal RN Android tests and the sample build against the published Kit and its transitive ECP dependency, plus the other required RN checks. Merge and publish RN to npm. RN does not need its own ECP pin.At each stage, use the Release package workflow's dry run and draft release flow. Wait for actual registry availability before verifying the next package; a GitHub release/tag alone is insufficient. The workflows do not automatically sequence the stages. The RN npm publish job builds/packs JavaScript and does not rerun Android compilation, so RN Android CI must pass before release.
Only changed dependencies need new releases: Android-only changes can keep the ECP pin, and RN-only changes can keep both native pins. Update RN's iOS pin only when needed, after its required Swift release is available on CocoaPods. Package versions remain independent.
This waterfall makes each package a consumer of the published dependency it declares. It catches missing API during compilation, gives each layer an explicit version boundary, and preserves ECP as a shared transitive dependency rather than embedding duplicate protocol classes. The cost is upstream publication time and a downstream CI run at each adoption. Local overrides support development across stacked branches, but normal CI must pass against published artifacts before those downstream PRs merge.
The coordinated release guide, RN release guide, Android README, and PR release checklists now document this process.
How to test
Verified locally after rebasing onto
main(0d8f23739):dev android test: 508 SDK tests and 99 sample tests passed against the published protocol, including the resolved-dependency guard.dev protocol test kotlin: 50 protocol tests passed.dev android api check: Android Kit and protocol API baselines passed.env -u NO_COLOR ruby scripts/test_ruby: 332 tests / 921 assertions passed, including the regression test for independent protocol release and dependency versions.git diff --checkpassed.Before you merge