Skip to content

fix(admin): return pagination totals for user lists - #21540

Merged
wangq8 merged 3 commits into
infiniflow:mainfrom
QAQadws:codex/admin-users-pagination-total
Oct 27, 2026
Merged

wangq8 merged 3 commits into
infiniflow:mainfrom
QAQadws:codex/admin-users-pagination-total

Conversation

@QAQadws

@QAQadws QAQadws commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

GET /api/v1/admin/users paginates results on the backend but omits the total count, preventing the frontend from calculating the number of pages.

Pass the existing DAO count through the service to the handler and expose it as a top-level total, preserving the data array. Update the shared handler and EE stub signature to support an pagination total from EE user lists.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 082e4d8f-53a5-4dda-be39-851d1f88c1bb
Commits

Reviewing files that changed from the base of the PR and between 47fa719 and 864a163.

Files selected for processing: 2
  • internal/admin/handler.go
  • internal/admin/service_ee.go

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Walkthrough

The admin user-list service now returns a total count with paginated results. The handler includes the count in its response. Tests check totals across pages and for an empty list.

Changes: Admin user-list totals

Layer / File(s) Summary
Return and test user totals
internal/admin/service.go, internal/admin/service_ee.go, internal/admin/handler.go, internal/admin/user_detail_test.go
The open-source service returns the total from userDAO.List. The Enterprise Edition service returns a count of zero. The handler returns the count with the user results. Tests check page counts and an empty-list total.

Priority: Normal

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

Change: Bug fix

Suggested labels: testing, go

Suggested reviewers: buua436

Merge Risk: Minimal · up to 864a1

User-list responses include pagination totals; no merge-blocking issue was found in the current request path.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within survi… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: returning pagination totals for admin user lists.
Description check Passed The description clearly explains the problem, solution, affected API, and EE signature update. It omits the required "### Summary" heading, but the required summary content is present.
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 4 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

A rabbit counts each page with care
Ten hop in, then two are there
The empty list reports a zero
Totals travel where results go
The rabbit checks, then bounds away

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

@QAQadws QAQadws added the ci Continue Integration label Oct 27, 2026
@QAQadws
QAQadws requested a review from Lynn-Inf October 27, 2026 07:06

@Lynn-Inf Lynn-Inf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

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

Labels

ci Continue Integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants