Repository navigation
fix: align chat permission tests across editions - #21589
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Error assertion updates internal/service/test_helpers_test.go, internal/service/chat_pipeline_test.go, internal/service/chat_rest_update_test.go |
A shared helper recognizes permission-denied and resource-not-found errors. Unauthorized dataset tests use this helper instead of requiring only the permission-denied error. |
Scoped empty-response test internal/service/chat_pipeline_test.go |
The test assigns the knowledge base to user-1 and runs AsyncChat with a context scoped to that user and tenant. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: wangq8
Merge Risk: 
Minimal · up to 4c71b
-
The test updates are contract-correct and present no actionable merge-blocking risk.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Title check
-
Explanation
The title "fix: align chat permission tests across editions" matches the main change. The PR changes chat permission tests so denial assertions accept either the permission-denied error or the hidden-resource error, and it adds tenant context and owner to the successful pipeline test. The title is specific and short, and it names the change. It does not name the tenant context or owner change, but that detail is secondary.
Full details: Description check
-
Explanation
The description states the problem. Chat permission tests assume a denied cross-tenant resource returns a permission-denied error, but the enterprise edition returns a resource-not-found error. The successful chat pipeline test also lacks tenant context and dataset owner. The description states the fix: denial assertions accept either safe response, and the successful test gets an explicit tenant context and owner. It includes the Bug Fix type checkbox. It does not include a separate Summary heading from the repository template, so the template structure is only partly followed. The required information is present, so the check passes.
-
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 with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 5 functions across 3 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.
A rabbit checks each error sign,
Two hidden paths now both align.
A scoped context guides the chat,
The test runs true beneath its hat.
Soft paws mark the updates done,
Then hop away beneath the sun.
Comment @coderabbitai help to get the list of available commands.
What problem does this PR solve?
Chat permission tests assumed every denied cross-tenant resource returns
permission denied, while enterprise hides those resources asResource not found. The successful chat pipeline test also lacked the active tenant context and dataset owner.Make denial assertions accept either edition's safe response, and give the successful test an explicit tenant context and owner.
Type of change