Skip to content

Feat/display user name in partition - #757

Closed
Baboulinet-33 wants to merge 8 commits into
linagora:developfrom
Baboulinet-33:feat/display_user_name_in_partition
Closed

Feat/display user name in partition#757
Baboulinet-33 wants to merge 8 commits into
linagora:developfrom
Baboulinet-33:feat/display_user_name_in_partition

Conversation

@Baboulinet-33

@Baboulinet-33 Baboulinet-33 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

In the user table for a partition, display name instead of ID

Summary by CodeRabbit

  • Enhancements
    • Partition member lists now show users’ display names when available.
    • User IDs are used as a fallback when no display name exists.
    • Removal confirmations now identify users by display name or ID.
  • Bug Fixes
    • Missing users are handled gracefully without breaking partition member listings.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Partition membership responses now include user display names when available. Backend tests cover resolved and missing users, while frontend types and partition administration views display names with user ID fallbacks.

Changes

Partition member display names

Layer / File(s) Summary
Backend member enrichment
openrag/services/orchestrators/partition_service.py, tests/unit/services/orchestrators/test_partition_service.py
list_members concurrently resolves users, adds nullable display_name values, and tests both available and missing users.
Frontend member display rendering
ui/src/lib/api/partitions.ts, ui/src/pages/admin/partitions/detail.tsx
The API contract includes display_name, and the users table and removal confirmation display it with user_id fallback behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: andyne13

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately summarizes the main change: showing user names in partitions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 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.

Inline comments:
In `@openrag/services/orchestrators/partition_service.py`:
- Around line 677-680: Bound the concurrent user lookups in the partition
membership enrichment flow around _membership_repo.list_partition_members and
_user_repo.get_user. Fetch member users in bounded chunks, preserving the
existing member order and display_name assignment while avoiding one unbounded
asyncio.gather call for large partitions.

In `@ui/src/pages/admin/partitions/detail.tsx`:
- Around line 479-483: The member rows currently hide user_id when display_name
exists, making accounts ambiguous. Update the rendering near the user
display-name cells, including both affected occurrences, to always keep user_id
visible as secondary text, a tooltip, or in the removal confirmation while
preserving the existing display-name presentation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 75463cd4-82e1-40b0-b2f3-e85f7a867969

📥 Commits

Reviewing files that changed from the base of the PR and between 5ee31dc and 02e6e40.

📒 Files selected for processing (4)
  • openrag/services/orchestrators/partition_service.py
  • tests/unit/services/orchestrators/test_partition_service.py
  • ui/src/lib/api/partitions.ts
  • ui/src/pages/admin/partitions/detail.tsx

Comment on lines +677 to +680
members = await self._membership_repo.list_partition_members(partition)
users = await asyncio.gather(*(self._user_repo.get_user(m["user_id"]) for m in members))
for member, user in zip(members, users, strict=True):
member["display_name"] = user.display_name if user else None

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 Performance & Scalability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

ast-grep outline openrag/services/orchestrators/partition_service.py --view expanded

Repository: linagora/openrag

Length of output: 3527


🏁 Script executed:

sed -n '665,685p' openrag/services/orchestrators/partition_service.py
printf '\n---\n'
rg -n "def get_user|class .*User|get_user\\(" openrag -g '*.py'

Repository: linagora/openrag

Length of output: 4635


🏁 Script executed:

sed -n '90,125p' openrag/services/persistence/user_repo.py
printf '\n---\n'
sed -n '1,120p' openrag/core/ports/user_repo.py
printf '\n---\n'
rg -n "get_users|list_users_by|batch.*user|user_ids" openrag/services openrag/core -g '*.py'

Repository: linagora/openrag

Length of output: 3415


Bound the membership user lookups. asyncio.gather(...) launches one DB call per member, and UserRepository has no batch fetch here. Large partitions can overwhelm the pool; chunk these lookups or add a bulk user query.

🤖 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 `@openrag/services/orchestrators/partition_service.py` around lines 677 - 680,
Bound the concurrent user lookups in the partition membership enrichment flow
around _membership_repo.list_partition_members and _user_repo.get_user. Fetch
member users in bounded chunks, preserving the existing member order and
display_name assignment while avoiding one unbounded asyncio.gather call for
large partitions.

Comment on lines +479 to 483
<TableCell className="text-sm">
{user.display_name || (
<span className="font-mono text-muted-foreground">{user.user_id}</span>
)}
</TableCell>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Keep a stable identifier visible with display names.

Lines 480-482 and 513 show only the display name when available. Display names are not guaranteed to be unique, so administrators may be unable to distinguish members or confirm which account will be removed. Keep user_id as secondary text, a tooltip, or include it in the confirmation.

Also applies to: 511-514

🤖 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 `@ui/src/pages/admin/partitions/detail.tsx` around lines 479 - 483, The member
rows currently hide user_id when display_name exists, making accounts ambiguous.
Update the rendering near the user display-name cells, including both affected
occurrences, to always keep user_id visible as secondary text, a tooltip, or in
the removal confirmation while preserving the existing display-name
presentation.

@hedhoud

hedhoud commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Thanks for this work!
We’ve integrated your initial commit into PR #809 and extended it there. Since the changes will now be delivered through #809, we can close this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants