Migrate roles search to generated models#6563
Conversation
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
SDK Size Comparison 📏
|
|
WalkthroughMigrates the ChangesRole DTO migration
Estimated code review effort: 2 (Simple) | ~15 minutes Possibly related PRs
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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/Role.kt (1)
17-22: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueUndocumented
@file:Suppress.The suppression list has no comment explaining why each rule is disabled. As per coding guidelines,
**/*.kt: "avoid suppressions unless documented". Given this is generated boilerplate, low priority, but worth a brief comment for future maintainers.🤖 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/Role.kt` around lines 17 - 22, The file-level suppression in Role.kt is undocumented, so add a brief comment near the `@file`:Suppress declaration explaining that these rules are intentionally disabled for generated boilerplate. Keep the note short and explicit for each suppressed rule group, so future maintainers understand why ArrayInDataClass, EnumEntryName, RemoveRedundantQualifierName, and UnusedImport are being suppressed in this file.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/Role.kt`:
- Around line 17-22: The file-level suppression in Role.kt is undocumented, so
add a brief comment near the `@file`:Suppress declaration explaining that these
rules are intentionally disabled for generated boilerplate. Keep the note short
and explicit for each suppressed rule group, so future maintainers understand
why ArrayInDataClass, EnumEntryName, RemoveRedundantQualifierName, and
UnusedImport are being suppressed in this file.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 24dab071-e129-44c9-a74c-f9738f68b487
📒 Files selected for processing (9)
stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/endpoint/RoleApi.ktstream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/mapping/DomainMapping.ktstream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/model/dto/DownstreamRoleDto.ktstream-chat-android-client/src/main/java/io/getstream/chat/android/network/models/Role.ktstream-chat-android-client/src/main/java/io/getstream/chat/android/network/models/SearchRolesResponse.ktstream-chat-android-client/src/test/java/io/getstream/chat/android/client/Mother.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/api2/mapping/DomainMappingTest.kt
💤 Files with no reviewable changes (1)
- stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/model/dto/DownstreamRoleDto.kt
|
🚀 Available in v7.6.0 |



Goal
Migrate the
/roles/searchendpoint to generated models. Part of the incremental OpenAPI model migration.Part of AND-1291
Implementation
RoleandSearchRolesResponse; delete the hand-writtenDownstreamRoleDtoandSearchRolesResponse.Rolecollides with the domainio.getstream.chat.android.models.Role, so it is imported aliased asRoleDtoin the mapper and tests (the necessary name-collision case, not an alias to avoid renames).RoleApi/mapper/tests at the generated types; the mapper now reads the generated camelCasecreatedAt/updatedAt.Role'sDatefields are handled by the existing date adapter, so this slice is independent of the Serializer foundation.Testing
spotlessApply,apiDump(no API drift),lint,detekt, andtestDebugUnitTestall pass.searchRolesparses a realSearchRolesResponse+Role(count=1, name and requiredcreatedAtpopulated).Summary by CodeRabbit
Bug Fixes
Tests