Migrate CompletableResponse to generated Response#6543
Conversation
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
SDK Size Comparison 📏
|
140861e to
81a52cf
Compare
|
WalkthroughThe internal ChangesCompletableResponse to Response migration
Estimated code review effort: 2 (Simple) | ~15 minutes Possibly related PRs
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
stream-chat-android-client/src/main/java/io/getstream/chat/android/network/models/Response.kt (1)
17-22: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueUndocumented
@file:Suppressblock.As per coding guidelines,
**/*.ktshould "avoid suppressions unless documented." This blanket suppression has no comment explaining why each rule is disabled. Since this is generated model code (first of many in the migration stack), consider adding a brief comment noting it's codegen output to preempt future guideline flags on subsequent generated files.🤖 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 `@stream-chat-android-client/src/main/java/io/getstream/chat/android/network/models/Response.kt` around lines 17 - 22, The `@file`:Suppress block in Response.kt is undocumented and should be explained to satisfy the “avoid suppressions unless documented” guideline. Add a brief comment near the file-level suppression in Response to note that this is generated model code from the migration stack, so the suppressions are intentional and expected for codegen output.Source: Coding guidelines
🤖 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.
Nitpick comments:
In
`@stream-chat-android-client/src/main/java/io/getstream/chat/android/network/models/Response.kt`:
- Around line 17-22: The `@file`:Suppress block in Response.kt is undocumented and
should be explained to satisfy the “avoid suppressions unless documented”
guideline. Add a brief comment near the file-level suppression in Response to
note that this is generated model code from the migration stack, so the
suppressions are intentional and expected for codegen output.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 8da47426-1b35-4ab2-b432-37eb0eb651bb
📒 Files selected for processing (14)
stream-chat-android-client/src/main/baseline-prof.txtstream-chat-android-client/src/main/java/io/getstream/chat/android/client/api/RetrofitCdnApi.ktstream-chat-android-client/src/main/java/io/getstream/chat/android/client/api/models/CompletableResponse.ktstream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/endpoint/ChannelApi.ktstream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/endpoint/DeviceApi.ktstream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/endpoint/MessageApi.ktstream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/endpoint/ModerationApi.ktstream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/endpoint/PollsApi.ktstream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/endpoint/RemindersApi.ktstream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/endpoint/UserGroupApi.ktstream-chat-android-client/src/main/java/io/getstream/chat/android/network/models/Response.ktstream-chat-android-client/src/test/java/io/getstream/chat/android/client/api2/MoshiChatApiTest.ktstream-chat-android-client/src/test/java/io/getstream/chat/android/client/api2/MoshiChatApiTestArguments.ktstream-chat-android-client/src/test/java/io/getstream/chat/android/client/uploader/StreamFileUploaderTest.kt
💤 Files with no reviewable changes (2)
- stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api/models/CompletableResponse.kt
- stream-chat-android-client/src/main/baseline-prof.txt



Goal
Replace the hand-written
CompletableResponseDTO with the generatedResponsemodel. First slice of the incremental OpenAPI model migration: generated models keep their generated packageio.getstream.chat.android.network.modelsasinternalclasses inside the client module (no separate module, mirroring the generator output so a future regen is drag-and-drop), one endpoint/model at a time.Part of AND-1291
Implementation
Responseunderio.getstream.chat.android.network.models(internal).CompletableResponseusage toResponseacross the api2 endpoint interfaces andRetrofitCdnApi, and delete the two hand-writtenCompletableResponseclasses.CompletableResponsebaseline-profile entries.Testing
spotlessApply,apiDump(no API drift),lint,detekt, andtestDebugUnitTestall pass.markAllRead(backed byRetrofitCall<Response>) parses the real wire response and completes successfully.