Repository navigation
Sdbv rbac changes - #442
Conversation
set tenant type
Kafka Fix
…e into user-service
Added default Tenant Id in header for Search user
…e into user-service
Optimzation of Field Value Queries
|
Caution Review failedThe pull request is closed. WalkthroughAdds an optimized custom-field filtering method to PostgresFieldsService and switches user searches to use it. Introduces optional tenant-scoped filtering in user listings, propagating tenantId through search flow and surfacing tenantType in results. Minor reference added in cohort adapter to the optimized path. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Client
participant UserAdapter as UserAdapter
participant FieldsSvc as PostgresFieldsService
participant DB as Postgres
Client->>UserAdapter: searchUser(criteria, tenantId?)
UserAdapter->>FieldsSvc: filterUserUsingCustomFieldsOptimized(context="USERS", customFields)
FieldsSvc->>DB: EXISTS-based SQL (USERS) with params
DB-->>FieldsSvc: matching userIds
alt tenantId provided
UserAdapter->>DB: Query users WITH tenant filter (UTM."tenantId" = tenantId)
else no tenantId
UserAdapter->>DB: Query users WITHOUT tenant filter
end
UserAdapter->>DB: Join user-tenant-role data SELECT ... , T."type"
DB-->>UserAdapter: rows
UserAdapter-->>Client: users with tenantType and pagination
sequenceDiagram
autonumber
participant Caller
participant FieldsSvc as PostgresFieldsService
participant DB as Postgres
Caller->>FieldsSvc: filterUserUsingCustomFieldsOptimized(context, fields[])
alt context == "COHORT"
FieldsSvc->>DB: SELECT DISTINCT cohortId WHERE EXISTS (custom_fields match)
else context == "USERS"
FieldsSvc->>DB: SELECT DISTINCT userId WHERE EXISTS (custom_fields match)
else unknown context
FieldsSvc->>FieldsSvc: fallback to filterUserUsingCustomFields
end
DB-->>FieldsSvc: id list
FieldsSvc-->>Caller: ids or null
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Cache: Disabled due to data retention organization setting Knowledge Base: Disabled due to data retention organization setting 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (3)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
|



Summary by CodeRabbit
New Features
Improvements
Documentation