feat: support android in SDK generation and validation - #85
Open
ajay-k wants to merge 2 commits into
Open
Conversation
`android` was missing from the cased-namespace branch, so
`sdk-generate.sh --lang android` defaulted to `workos` and generated
`WorkosClient` accessors that do not match the hand-maintained
`WorkOSClient` — the SDK does not compile.
Separately, `"${EXTRA_ARGS[@]}"` is an unbound-variable error under `set -u`
in bash 3.2, which macOS still ships as /bin/bash. Only the node branch
appends to that array, so the script failed locally for every other
language while Linux CI's bash 5 was unaffected.
Two additions so that adding android to sdk-matrix.json later is a one-line
change rather than a broken build. Both are inert until that entry exists,
because no current matrix entry has language == 'android'.
setup-sdk-runtime gains an android case. It cannot reuse the kotlin branch:
that greps JavaVersion.VERSION_, which workos-android's build.gradle.kts never
mentions -- it sets the JVM target with jvmToolchain(17) -- so the kotlin
pattern yields an empty java-version. The Java and Gradle steps are widened to
android, which needs no Android SDK because the library targets the JVM
(kotlin("jvm")) and so builds on ubuntu with the same JDK + Gradle pair kotlin
uses.
validate-sdks skips the three compatibility steps for android. No extractor is
registered for it, so sdk:compat-extract exits 1 and would fail the whole
matrix; and android is unreleased, so there is no published surface for a
baseline to protect. Downstream aggregation already tolerates the absence: the
PR-comment script has an explicit "compat-report.json missing" branch,
build-sdk-diff-report needs only sdk-code.diff, and both jq passes skip absent
files. Compat summary is already guarded on the diff step's outcome being
'skipped'. Remove the conditions once an android extractor exists.
Greptile SummaryPrepares Android SDK generation and validation without activating it in the SDK matrix.
Confidence Score: 5/5The PR appears safe to merge, with Android remaining inactive until a future SDK matrix entry is added. The Android-specific branches are isolated from existing matrix languages, and the validation workflow’s downstream consumers already handle skipped compatibility steps and absent compatibility reports. Important Files Changed
Reviews (1): Last reviewed commit: "ci: prepare the SDK matrix jobs for andr..." | Re-trigger Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Prepares this repo to generate and validate the new
androidSDK(
workos/workos-android, emitter inoagen-emitters#206). Three files,+31/-6. Inert for the eight existing languages — see the test plan.
scripts/sdk-generate.sh— two fixes, both required for--lang androidto work at all:
androidadded to the cased-namespace branch. The namespace becomes theKotlin client type prefix, so defaulting to
workosgeneratedWorkosClient.*accessors that do not match the hand-maintainedWorkOSClient— the SDK did not compile.${EXTRA_ARGS[@]+"${EXTRA_ARGS[@]}"}instead of a bare"${EXTRA_ARGS[@]}". Underset -u, bash 3.2 — still what macOS ships as/bin/bash— treats expanding an empty array as an unbound variable. Onlythe
nodebranch populates that array, so every other language failedlocally on macOS while Linux CI's bash 5 masked it. Pre-existing and
unrelated to android, but it blocks the android path, so it is fixed here.
.github/actions/setup-sdk-runtime/action.yml— anandroidcase plus JDKand Gradle. It cannot reuse the
kotlinbranch: that grepsJavaVersion.VERSION_, whichworkos-android'sbuild.gradle.ktsnevermentions — it sets the JVM target with
jvmToolchain(17)— so the kotlinpattern yields an empty
java-version. android needs no Android SDK: thelibrary targets the JVM (
kotlin("jvm")), so it builds onubuntu-latestwiththe same JDK + Gradle pair kotlin uses.
.github/workflows/validate-sdks.yml— skips the three compatibility stepsfor android. No extractor is registered, so
sdk:compat-extract --lang androidexits 1 and would fail the whole matrix; and android is unreleased, so there is
no published surface for a baseline to protect.
Deliberately not included
The
.github/sdk-matrix.jsonentry. That is the activation switch, and it mustnot merge until
workos/workos-androidis public — the SDK checkout step uses aplain
actions/checkoutthat cannot read a private repo, and one failing matrixcolumn fails the whole
sdk-validationcheck viaif [[ "${{ needs.sdk_build.result }}" != "success" ]]. Once the repo ispublic, activation is one line:
{ "language": "android", "sdk_repo": "workos/workos-android" }No
runnerkey —ubuntu-latestis correct.Test plan
Inertness for existing languages, traced from the real script:
--langworkosworkosWorkOSWorkOSworkosworkosworkos(broken)WorkOSAdding a term to an
ORchain can only change theandroidoutcome; thecaseaddition cannot reach other branches; andmatrix.language != 'android'is always true for the other eight, so those steps run unchanged. Argv is
identical where the old array expansion worked — verified including a path
containing a space — and works where it previously errored.
Correctness of the android additions:
jvmToolchain\(\K\d+againstworkos-android/build.gradle.kts→17,matched once. Negative control: kotlin's
JavaVersion.VERSION_pattern findsnothing there.
Extract baseline snapshot,Extract candidate snapshotandCompat diffcarry the guard — and that
Compat summarycorrectly does not, since italready guards on
steps.compat-diff.outcome != 'skipped'.buildLanguageDatahas an explicitcompat-report.json missingbranch,build-sdk-diff-report.mjsneeds onlysdk-code.diff, and bothjqaggregations skip absent files vianullglobor an empty-changes fallback.
sdk:compat-extract --lang androidconfirmed to exit 1(
No extractor registered for language: android) — measured, not assumed.End to end:
npm run sdk:generate -- --lang androidexits 0, twoconsecutive runs are byte-identical (800 files), all 30
@oagen-ignore-filefiles survive, and the SDK's
script/cipasses with 590 tests.Not verified: I cannot run GitHub Actions locally, so no green
sdk_build (android)job has been observed. The first CI run after the matrixentry lands is the test of record.
🤖 Generated with Claude Code