Go: fix bugs - #16911
Conversation
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
📝 WalkthroughWalkthroughAdmin user-listing responses now terminate correctly by edition, message queue health checks handle an uninitialized engine, and CLI errors include response bodies. Three RESTful API tests are reclassified from p2 to p3. ChangesAdmin flow and diagnostics
Test priority markers
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
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.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
internal/admin/handler.go (1)
221-230: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winRestore the enterprise success response.
After
ListUsersEEsucceeds, the handler exits theswitchwithout callingcommon.SuccessWithData, leaving enterprise requests with an empty response. The CLI ininternal/cli/admin_command.gothen fails to unmarshal the response. Add the success response and an explicitreturnto the enterprise branch.Suggested fix
case common.EnterpriseEdition: users, err = h.service.ListUsersEE(pageInt, pageSizeInt, name, status, role, sort, orderBy, plan, topInt, daysInt, quotaInt) if err != nil { common.ErrorWithCode(c, common.CodeServerError, err.Error()) return } + common.SuccessWithData(c, users, "List users") + return default:🤖 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 `@internal/admin/handler.go` around lines 221 - 230, Update the common.EnterpriseEdition branch in the handler after a successful ListUsersEE call to send the users through common.SuccessWithData and then explicitly return. Preserve the existing error response and default invalid-type handling.
🤖 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.
Outside diff comments:
In `@internal/admin/handler.go`:
- Around line 221-230: Update the common.EnterpriseEdition branch in the handler
after a successful ListUsersEE call to send the users through
common.SuccessWithData and then explicitly return. Preserve the existing error
response and default invalid-type handling.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 87e17b35-c148-413c-ab05-675ca7a5973b
📒 Files selected for processing (6)
internal/admin/handler.gointernal/admin/service.gointernal/cli/admin_command.gotest/testcases/restful_api/test_dify_retrieval_routes_unit.pytest/testcases/restful_api/test_openai_compatible.pytest/testcases/test_http_api/test_dataset_management/test_dify_retrieval_routes_unit.py
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #16911 +/- ##
=======================================
Coverage 93.16% 93.16%
=======================================
Files 10 10
Lines 717 717
Branches 118 118
=======================================
Hits 668 668
Misses 29 29
Partials 20 20 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary