Conversation
Co-authored-by: alex-amenos <11457623+alex-amenos@users.noreply.github.com>
…kover version Co-authored-by: alex-amenos <11457623+alex-amenos@users.noreply.github.com>
…nd dependencies for AGP 9.0 migration
…ponents.onVariants Co-authored-by: alex-amenos <11457623+alex-amenos@users.noreply.github.com>
…to mock empty posts response
…iants usage for APK naming convention
… for ben-manes-versions and google-ksp
…HtmlReportDebug for unit tests
[REFACTOR] AGP 9.0 migration
…patibility improvements
There was a problem hiding this comment.
Pull request overview
This PR updates the project’s Android/Gradle build setup (Gradle/AGP/Kotlin + plugin catalog), migrates coverage aggregation to Kover 0.9.x, and removes deprecated annotation-processing/parcelling pieces to align with the newer toolchain.
Changes:
- Upgrade build tooling (Gradle 9.1.0, AGP 9.0.1) and refresh plugin/version catalog entries.
- Migrate Kover configuration to 0.9.x multi-module aggregation and update CI to run a Kover report task.
- Remove Lifecycle kapt compiler usage and drop
Parcelable/@ParcelizefromPost.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| shared/core/build.gradle | Removes lifecycle compiler kapt dependency from shared core. |
| gradle/wrapper/gradle-wrapper.properties | Bumps Gradle wrapper to 9.1.0. |
| gradle/libs.versions.toml | Updates AGP/JUnit/Kover/etc versions; modernizes plugin declarations; removes lifecycle-compiler and old kover library entry. |
| gradle.properties | Adds AGP property related to KSP/Kotlin source sets warning. |
| feature/posts/src/test/.../PostsViewModelBehaviorSpec.kt | Adjusts test setup around dismissing errors and repository stubbing. |
| feature/posts/src/main/.../Post.kt | Removes Parcelable implementation and Parcelize annotations. |
| buildSystem/gradle/kover-merge.gradle | Replaces old merged config with Kover 0.9.x aggregation and filtering. |
| buildSystem/gradle/common-app-base.gradle | Updates AGP DSL + lint/packaging config; updates APK naming via androidComponents. |
| buildSystem/gradle/common-android-feature.gradle | Removes lifecycle compiler kapt dependency from feature base. |
| buildSystem/gradle/common-android-base.gradle | Updates AGP DSL + lint/packaging config; changes junit/kover plugin application. |
| buildSrc/src/main/java/AppConfig.kt | Removes build tools version constant. |
| build.gradle | Removes kover classpath usage; comments out android-reporting; applies kover merge script. |
| .github/workflows/android_ci.yml | Switches CI “Debug Unit tests” task from Roborazzi verify to Kover HTML report. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
...posts/src/test/kotlin/com/alxnophis/jetpack/posts/ui/viewmodel/PostsViewModelBehaviorSpec.kt
Outdated
Show resolved
Hide resolved
| @@ -1,15 +1,12 @@ | |||
| apply plugin: 'com.android.application' | |||
There was a problem hiding this comment.
common-app-base.gradle no longer applies the Kotlin Android plugin. Since app/build.gradle only applies this shared script and the app module contains Kotlin sources (e.g., app/src/main/.../JetpackApp.kt), the module will fail to compile unless the Kotlin plugin is applied elsewhere. Re-add applying org.jetbrains.kotlin.android here (or migrate modules to the plugins {} DSL consistently).
| apply plugin: 'com.android.application' | |
| apply plugin: 'com.android.application' | |
| apply plugin: 'org.jetbrains.kotlin.android' |
…e version catalog entries
…unTest for coroutine handling
…ns for cleaner navigation
…ement BackHandler in AuthorizedScreen
[FEAUTE] Update AGP
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 21 out of 22 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (3)
feature/posts/src/test/kotlin/com/alxnophis/jetpack/posts/ui/viewmodel/PostsViewModelBehaviorSpec.kt:44
- The Kotest
BehaviorSpecDSL blocks (Given/When/Then) are being declared insiderunTest { ... }.runTestexecutes immediately during spec construction, so theseThenblocks may never be registered as tests (or tests may run during init). MoverunTestinside theThen { ... }body (or make the Kotest test itselfsuspend) and keep the DSL declarations at spec-definition time.
runTest {
viewModel.handleEvent(PostsEvent.OnUpdatePostsRequested)
Then("uiState should reflect success with loaded posts") {
viewModel.uiState.test {
awaitItem() shouldBe PostsUiState.initialState.copy(status = PostsStatus.Success, posts = postList.toImmutableList())
expectNoEvents()
}
}
}
feature/posts/src/test/kotlin/com/alxnophis/jetpack/posts/ui/viewmodel/PostsViewModelBehaviorSpec.kt:86
- Same issue here: wrapping the
Then { ... }declaration inrunTest { ... }means the Kotest DSL is executed at runtime instead of during spec construction, so the test may not be registered/executed correctly. Define theThenblock directly underWhen, and callrunTest(or other coroutine test helpers) inside theThenbody.
runTest {
viewModel.handleEvent(PostsEvent.OnUpdatePostsRequested)
Then("uiState should reflect error with appropriate error type") {
viewModel.uiState.test {
awaitItem() shouldBe
PostsUiState.initialState.copy(
status = PostsStatus.Error,
error = testCase.uiError,
)
expectNoEvents()
}
}
}
feature/posts/src/test/kotlin/com/alxnophis/jetpack/posts/ui/viewmodel/PostsViewModelBehaviorSpec.kt:112
- Same DSL/timing problem: this
Then { ... }is declared insiderunTest, so it may not be registered as a Kotest test. Keep theThendeclaration at the BehaviorSpec level and userunTestinside theThenblock to drive the coroutine scheduling.
runTest {
viewModel.handleEvent(PostsEvent.DismissErrorRequested)
Then("uiState should clear the error and return to success state") {
viewModel.uiState.test {
awaitItem() shouldBe
initialStateWithError.copy(
status = PostsStatus.Success,
error = null,
)
expectNoEvents()
}
}
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
…o use runTest for coroutine handling
… build configuration
…p-9-0 # Conflicts: # feature/posts/src/test/kotlin/com/alxnophis/jetpack/posts/ui/viewmodel/PostsViewModelBehaviorSpec.kt
…idelines and naming conventions
…sViewModelBehaviorSpec
…sViewModelBehaviorSpec
…ProGuard rules file
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
[REFACTOR] AGP 9
…e flow state management
… and Home features
… improve test coverage
[REFACTOR] Gradle 9
…9.0 migration and remove deprecated settings
….versions.toml and remove unused line in gradle.properties
⚡️ Proposed Changes
ℹ️ Additional Info
🔗 Related Links
✅ Checklist
📷 Screenshots