build: upgrade Kotlin 2.1.21, KSP 2.1.21-2.0.2, Room 2.7.2#8
Conversation
Coordinated lockstep upgrade (deferred from the build-stack PR, where these could not move because Room 2.6.1's generated DAO is incompatible with KSP2): - Kotlin 2.0.21 -> 2.1.21 - KSP 2.0.21-1.0.27 -> 2.1.21-2.0.2 (KSP2; matched to Kotlin) - Room 2.6.1 -> 2.7.2 (fixes the KSP2 suspend-DAO Continuation codegen) Roomigrant 0.3.4 remains compatible; generated migrations still build. Room exports identical schema JSON (app/schemas unchanged), so there is no database version change or migration impact (DB stays at version 8).
📝 WalkthroughSummary by CodeRabbitChores
WalkthroughThree Gradle build files receive version-only updates: the Kotlin Gradle plugin is bumped from ChangesKotlin, KSP, and Room dependency upgrades
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
Comment |
|
@coderabbitai full review Please focus on the Kotlin/KSP/Room lockstep correctness and Room schema/migration safety. Two notes pre-empting common findings:
|
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Fetch the PR diff
gh pr view 8 --repo hawkff/NekoBoxForAndroid --json title,body,files,additions,deletions
echo "---FILES---"
gh pr diff 8 --repo hawkff/NekoBoxForAndroidLength of output: 4526 🏁 Script executed: #!/bin/bash
echo "=== app/build.gradle.kts ==="
cat app/build.gradle.kts
echo "=== build.gradle.kts ==="
cat build.gradle.kts
echo "=== buildSrc/build.gradle.kts ==="
cat buildSrc/build.gradle.kts
echo "=== app/schemas/ listing ==="
ls -la app/schemas/ 2>/dev/null || echo "No schemas dir"
ls -la app/schemas/io.nekohasekai.sagernet.database.SagerDatabase/ 2>/dev/null || true
echo "=== Any other Room/Kotlin/KSP references in gradle files ==="
rg -n "room|kotlin|ksp" --type=kotlin --iglob "*.kts" -i | grep -v "Binary" | head -80
echo "=== Check for any version catalog or versions.gradle ==="
fd "versions" --extension=toml --extension=gradle --extension=kts | head -20
cat gradle/libs.versions.toml 2>/dev/null || echo "No libs.versions.toml"
echo "=== Roomigrant references ==="
rg -rn "Roomigrant" --type=kotlin .
rg -rn "Roomigrant" . --glob="*.kts"Length of output: 7161
Lockstep Correctness ✅
The KSP2 default in 2.1.x + Room 2.7.2's switch to Kotlin codegen is the correct mechanism for resolving the Room Schema / Migration Safety ✅
Non-Blocking Observation (pre-existing, not introduced by this PR)The project uses inline version strings for Room's three artifacts rather than a version catalog ( SummaryThe upgrade is minimal (5 additions, 5 deletions across 3 files), internally consistent, and correctly scoped. Lockstep invariant is maintained. Room schema is clean. No concerns with the changes as written. [approve] |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
build.gradle.kts (1)
6-7:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winReplace deprecated
buildDiraccess in clean task.Line 7 uses a deprecated API (
rootProject.buildDir), which is already warning in CI. Switch to the layout API to avoid future Gradle breakage.Proposed fix
tasks.register<Delete>("clean") { - delete(rootProject.buildDir) + delete(rootProject.layout.buildDirectory) }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@build.gradle.kts` around lines 6 - 7, The clean task uses the deprecated buildDir property which will cause breakage in future Gradle versions. In the tasks.register<Delete>("clean") block, replace the rootProject.buildDir reference with the layout API by using rootProject.layout.buildDirectory.asFile.get() to get the build directory path in a non-deprecated way.Source: Pipeline failures
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@build.gradle.kts`:
- Around line 6-7: The clean task uses the deprecated buildDir property which
will cause breakage in future Gradle versions. In the
tasks.register<Delete>("clean") block, replace the rootProject.buildDir
reference with the layout API by using
rootProject.layout.buildDirectory.asFile.get() to get the build directory path
in a non-deprecated way.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 7d0b6582-85b0-4517-9310-df5920fb75e5
📒 Files selected for processing (3)
app/build.gradle.ktsbuild.gradle.ktsbuildSrc/build.gradle.kts
Summary
Coordinated Kotlin/KSP/Room lockstep upgrade — the work deferred from the build-stack
PR (#7), where these could not move because Room 2.6.1's generated DAO is incompatible
with KSP2.
Why these move together
KSP 2.1.x defaults to KSP2. Room 2.6.1 under KSP2 generates a broken suspend DAO
(
Continuation<List<…>>vsContinuation<? super List<…>>erasure clash). Room 2.7.2fixes that codegen. So Kotlin, KSP, and Room must move in one step.
On the KSP version scheme (pre-empting a likely review note)
KSP versions are
{kotlin-version}-{ksp-release}.2.1.21-2.0.2= KSP for Kotlin2.1.21, KSP release 2.0.2. The trailing
2.0.2is KSP's own release number, not aKotlin version. Verified:
google/ksp@2.1.21-2.0.2, published 2025-06-09.symbol-processing-api/2.1.21-2.0.2, HTTP 200).Roomigrant compatibility (verified, not assumed)
com.github.MatrixDev.Roomigrant:0.3.4is an older third-party migration generator.I verified empirically that it still works with Room 2.7.2 + KSP2: the build generates
migrations and compiles cleanly. No Roomigrant change was needed.
Database impact: none
Room 2.7.2 exports identical schema JSON —
app/schemas/is unchanged after the build.DB stays at version 8; no migration or user-data impact.
Verification (AWS Linux builder)
./gradlew app:assembleOssDebug— BUILD SUCCESSFUL../gradlew app:assembleOssRelease— BUILD SUCCESSFUL (R8 minify, lintVital withwarningsAsErrors=true, desugaring all pass; only pre-existing deprecation warnings).git status app/schemas— clean (no schema drift).Scope
build.gradle.kts(KSP),buildSrc/build.gradle.kts(Kotlin),app/build.gradle.kts(Room).Runtime testing note
Build-verified only; no emulator runtime test (account EC2 vCPU quota blocks bare-metal/
KVM emulator hosts — quota increase pending). Room schema is unchanged and the upgrade is
codegen-level, so runtime risk is low. Batched runtime QA planned once emulator capacity exists.