feat: reach error on blocked tenant#245
Conversation
904e418 to
874f5a6
Compare
874f5a6 to
da7a62f
Compare
|
da7a62f to
738c87b
Compare
📝 WalkthroughWalkthroughGo version upgraded from 1.25.6 to 1.26.0 with tool directives refactored into a grouped block. gRPC session service modified to return Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@internal/grpc/session_test.go`:
- Around line 416-419: The test currently accesses pf.GetViolations()[0] without
ensuring the slice has elements which can panic; update the assertion to check
the slice length first (e.g. call require.NotEmpty(t, pf.GetViolations()) or
require.Len(t, pf.GetViolations(), 1)) before using pf.GetViolations()[0], then
keep the existing require.Equal on the violation type; reference the
PreconditionFailure value pf and its GetViolations() method when adding the
length check.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 3191fac6-783f-4200-bf14-2f2ddd925a9f
📒 Files selected for processing (4)
go.modinternal/grpc/session.gointernal/grpc/session_test.gointernal/grpc/violations.go



Return reach error details when the tenant is blocked
Summary by CodeRabbit
Bug Fixes
FailedPreconditionstatus and detailed violation information, instead of a successful response with an invalid session flag. This provides clearer and more specific feedback to clients about tenant access blocks.Chores