Skip to content

feat(ci): Add kotlin to SDK generation workflows#21

Merged
gjtorikian merged 4 commits intomainfrom
support-kotlin
May 6, 2026
Merged

feat(ci): Add kotlin to SDK generation workflows#21
gjtorikian merged 4 commits intomainfrom
support-kotlin

Conversation

@gjtorikian
Copy link
Copy Markdown
Collaborator

Summary

  • Add kotlin to .github/sdk-matrix.json so generate-prs and validate-sdks
    pick it up alongside the other backend SDKs.
  • Wire kotlin into the generate-prs workflow_dispatch language choice
    list so it can be triggered as a single-language run.
  • Teach the setup-sdk-runtime composite action to detect the JVM
    version from build.gradle.kts and install temurin + the gradle
    wrapper cache. The kotlin emitter shells out to ./gradlew ktlintFormat
    after generation, so a JDK has to be on the runner.
  • Classify kotlin tests (src/test/**, *Test.kt, *Tests.kt) in
    build-sdk-diff-report so they don't get miscounted as code changes
    in the PR diff report.

Test plan

  • Manually trigger generate-prs.yml with languages=kotlin and
    confirm the kotlin job reaches the Generate SDK step and that
    ./gradlew ktlintFormat runs without a missing-Java failure.
  • Open a no-op spec PR and confirm validate-sdks runs the kotlin
    matrix leg, including script/ci and the compat snapshot.
  • Inspect the SDK code-diff report artifact for the kotlin job and
    confirm files under src/test/ show up in the test bucket
    rather than the code bucket.

gjtorikian and others added 4 commits May 6, 2026 12:30
Extract the current API surface from a clean HEAD worktree and pass it via
--api-surface so generation stays aware of the existing public surface.
Recover tracked manifest files missing from the working tree before
extraction so a partially-deleted SDK still produces a faithful surface.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
workos/workos-go#545 surfaced two failure modes in the regen PR
builder. (1) The spec dropped `default: desc` from 31 list
endpoints' `order` query parameter, but the PR body had no entry
for the silent server-default flip and release-please picked a
minor bump. (2) Two `feat(…)!: Change email field type in multiple
models` headlines were hallucinated by Claude Haiku from struct-tag
diffs (`url:"-"` added to existing fields whose Go types did not
change), then duplicated across services for the same shared field
set.

Both root-cause to the classify_changes step over-trusting the raw
`git diff` text and ignoring the structured oagen diff. Two fixes
in this workflow:

Pre-render `diff-report.json` `behaviorChanges` deterministically
into a single `feat!: change default for <param> in list operations`
override line and a `## BREAKING: Behavior changes` section in the
PR body. Force the rollup to feat! whenever any behavior change
exists so release-please bumps the major — independent of whether
Claude returns soft entries.

Tighten the classify_changes tool: type-change verdicts must ground
in the structured diff (a Go field gaining `url:"-"` is not a type
change), add a `chore` prefix for cosmetic diffs that should not
bump the version, and add an explicit dedup rule for cross-service
identical change-sets.
The matrix entry alone is not enough to land kotlin in the
generation mix: the workflow_dispatch choice list, the runtime
setup action, and the diff-report test classifier each branch
per-language and would silently drop kotlin otherwise.

- generate-prs.yml: kotlin is selectable when manually triggering
  a single-language run.
- setup-sdk-runtime: detect the JVM version from build.gradle.kts
  and install temurin + the gradle wrapper cache so the kotlin
  emitter's post-generate `./gradlew ktlintFormat` succeeds.
- build-sdk-diff-report: classify src/test/**, *Test.kt, *Tests.kt
  as tests so they are not miscounted as code changes.
@gjtorikian gjtorikian merged commit 567ed94 into main May 6, 2026
5 checks passed
@gjtorikian gjtorikian deleted the support-kotlin branch May 6, 2026 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant