ci: add Spotless/detekt, run native tests, fix bump-version base branch - #121
Conversation
Close three standardization gaps in the Kotlin KMP artifact and CI. - §7.1/§7.2 Spotless + detekt: add Spotless 8.8.0 (ktlint 1.8.0) over src/**/*.kt + the Gradle scripts, and detekt 1.23.8 (buildUponDefaultConfig=true) with a small config/detekt/detekt.yml. Line-length is left to Spotless; pre-existing findings in the hand-written CoT parser/builder/serializer are grandfathered in config/detekt/baseline.xml so the full ruleset is enforced on new code. Ran spotlessApply (formatting churn across the source tree) and expanded five wildcard JUnit imports; spotlessCheck + detekt pass locally. Wired `spotlessCheck detekt` into the ubuntu Kotlin CI job. - §4.2/§5.1 native/Apple test execution: the CI job only ran jvmTest, so 12/13 targets never executed their (already-present) common suites. The ubuntu Kotlin job now runs jvmTest + jsTest + wasmJsTest + linuxX64Test, and a new `Kotlin (Apple/native)` macOS job runs macosArm64Test + iosSimulatorArm64Test (with ~/.konan cached). The existing required-check job name (`Kotlin`) is unchanged; the native job is added alongside and gates publish-snapshot. - §8.1 bump-version base branch: bump-version.yml opened PRs with `gh pr create --base master`, but master is gone and main is the default branch, so the workflow was broken. Changed --base master -> --base main.
|
Warning Review limit reached
Next review available in: 50 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (32)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Closes three standardization gaps in one PR. Only the Kotlin binding (
kotlin/) is the KMP artifact; changes are scoped there plus CI.1. §7.1/§7.2 — Spotless + detekt
8.8.0(ktlint1.8.0) oversrc/**/*.kt+ the Gradle scripts; detekt1.23.8withbuildUponDefaultConfig=trueand a smallkotlin/config/detekt/detekt.yml.spotlessApplyfirst and committed the reformatting (whitespace/import ordering across the source tree) before wiring the check, plus expanded five wildcardorg.junit.jupiter.api.Assertions.*imports and merged a few EOL-comment-before-KDoc blocks that ktlint'sno-consecutive-commentsrule rejects.MaxLineLengthis off (no double-reporting). Pre-existing findings in the hand-written CoT parser/builder/serializer (long state-machine methods, deliberate broad catches, wire-constant magic numbers) are grandfathered inkotlin/config/detekt/baseline.xml, so detekt enforces the full default ruleset on all new code without a legacy refactor blocking this PR.spotlessCheck detektpasses locally (JDK 21);jvmTeststill green after the reformat../gradlew spotlessCheck detektinto the ubuntu Kotlin job.2. §4.2/§5.1 — native/Apple test execution
The Kotlin job previously ran only
jvmTest, so 12/13 targets never executed their already-present common suites (RoundTrip/Resilience/Decode viaInlinedFixtures).Kotlinjob (unchanged name — still the required check): now runsjvmTest jsTest wasmJsTest linuxX64Test.Kotlin (Apple/native)macOS job: runsmacosArm64Test iosSimulatorArm64Test, with~/.konancached.publish-snapshotneedsso a snapshot never publishes with failing native tests.New CI job / leg names
Kotlin(existing required check — expanded, name unchanged)Kotlin (Apple/native)(new — should be added as a required check)3. §8.1 — bump-version base branch bug
bump-version.ymlopened PRs withgh pr create --base master, butmasteris gone andmainis the default branch, so the workflow was broken. Changed--base master→--base main(the onlymasteroccurrence; the checkout uses the default branch, no ref to fix).Verification
cd kotlin && ./gradlew spotlessCheck detekt→ passes (JDK 21)grep -rn master .github/workflows/bump-version.yml→ nonegrep -nE 'uses: [a-zA-Z].*@v[0-9]' .github/workflows/ci.yml .github/workflows/bump-version.yml→ none (all actions SHA-pinned, reusing existing refs)