Skip to content

ci: add Spotless/detekt, run native tests, fix bump-version base branch - #121

Merged
jamesarich merged 1 commit into
mainfrom
ci/spotless-native-tests
Jul 23, 2026
Merged

ci: add Spotless/detekt, run native tests, fix bump-version base branch#121
jamesarich merged 1 commit into
mainfrom
ci/spotless-native-tests

Conversation

@jamesarich

Copy link
Copy Markdown
Collaborator

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

  • Spotless 8.8.0 (ktlint 1.8.0) over src/**/*.kt + the Gradle scripts; detekt 1.23.8 with buildUponDefaultConfig=true and a small kotlin/config/detekt/detekt.yml.
  • Ran spotlessApply first and committed the reformatting (whitespace/import ordering across the source tree) before wiring the check, plus expanded five wildcard org.junit.jupiter.api.Assertions.* imports and merged a few EOL-comment-before-KDoc blocks that ktlint's no-consecutive-comments rule rejects.
  • Line-length is owned by Spotless, so detekt's MaxLineLength is 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 in kotlin/config/detekt/baseline.xml, so detekt enforces the full default ruleset on all new code without a legacy refactor blocking this PR.
  • spotlessCheck detekt passes locally (JDK 21); jvmTest still green after the reformat.
  • Wired ./gradlew spotlessCheck detekt into 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 via InlinedFixtures).

  • Ubuntu Kotlin job (unchanged name — still the required check): now runs jvmTest jsTest wasmJsTest linuxX64Test.
  • New Kotlin (Apple/native) macOS job: runs macosArm64Test iosSimulatorArm64Test, with ~/.konan cached.
  • New job added to publish-snapshot needs so 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.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 (the only master occurrence; 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 → none
  • grep -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)

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.
@jamesarich
jamesarich enabled auto-merge July 23, 2026 02:20
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@jamesarich, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 50 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7072bb5c-3078-42ed-b6b2-9858f2f954f9

📥 Commits

Reviewing files that changed from the base of the PR and between b34f6af and c2594f8.

📒 Files selected for processing (32)
  • .github/workflows/bump-version.yml
  • .github/workflows/ci.yml
  • kotlin/build.gradle.kts
  • kotlin/config/detekt/baseline.xml
  • kotlin/config/detekt/detekt.yml
  • kotlin/gradle/libs.versions.toml
  • kotlin/src/commonMain/kotlin/org/meshtastic/tak/AtakPalette.kt
  • kotlin/src/commonMain/kotlin/org/meshtastic/tak/CotMeshSanitizer.kt
  • kotlin/src/commonMain/kotlin/org/meshtastic/tak/CotTypeMapper.kt
  • kotlin/src/commonMain/kotlin/org/meshtastic/tak/CotXmlBuilder.kt
  • kotlin/src/commonMain/kotlin/org/meshtastic/tak/CotXmlParser.kt
  • kotlin/src/commonMain/kotlin/org/meshtastic/tak/DictionaryLoader.kt
  • kotlin/src/commonMain/kotlin/org/meshtastic/tak/DictionaryProvider.kt
  • kotlin/src/commonMain/kotlin/org/meshtastic/tak/TakCompressor.kt
  • kotlin/src/commonMain/kotlin/org/meshtastic/tak/TakPacketV2Data.kt
  • kotlin/src/commonMain/kotlin/org/meshtastic/tak/TakPacketV2Serializer.kt
  • kotlin/src/commonMain/kotlin/org/meshtastic/tak/ZstdCodec.kt
  • kotlin/src/commonMain/kotlin/org/meshtastic/tak/ZstdException.kt
  • kotlin/src/commonTest/kotlin/org/meshtastic/tak/GoldenDecodeCommonTest.kt
  • kotlin/src/commonTest/kotlin/org/meshtastic/tak/LoggerCommonTest.kt
  • kotlin/src/commonTest/kotlin/org/meshtastic/tak/ResilienceCommonTest.kt
  • kotlin/src/commonTest/kotlin/org/meshtastic/tak/RoundTripCommonTest.kt
  • kotlin/src/jvmTest/kotlin/org/meshtastic/tak/CompatibilityTest.kt
  • kotlin/src/jvmTest/kotlin/org/meshtastic/tak/CompressionTest.kt
  • kotlin/src/jvmTest/kotlin/org/meshtastic/tak/CotMeshSanitizerTest.kt
  • kotlin/src/jvmTest/kotlin/org/meshtastic/tak/CotTypeMapperTest.kt
  • kotlin/src/jvmTest/kotlin/org/meshtastic/tak/DictionaryTrainingTest.kt
  • kotlin/src/jvmTest/kotlin/org/meshtastic/tak/MalformedInputTest.kt
  • kotlin/src/jvmTest/kotlin/org/meshtastic/tak/ResilienceTest.kt
  • kotlin/src/jvmTest/kotlin/org/meshtastic/tak/RoundTripTest.kt
  • kotlin/src/jvmTest/kotlin/org/meshtastic/tak/TestFixtures.kt
  • kotlin/src/wasmWasiTest/kotlin/org/meshtastic/tak/WasmWasiCodecTest.kt

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jamesarich
jamesarich added this pull request to the merge queue Jul 23, 2026
Merged via the queue into main with commit 247bc52 Jul 23, 2026
12 checks passed
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