chore: include principal_type in error logging#1524
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Coverage Report for CI Build 24184978634Coverage increased (+0.01%) to 41.293%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
📝 WalkthroughSummary by CodeRabbit
WalkthroughEnhanced error logging across three v1beta1connect API handlers by adding Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 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.
🧹 Nitpick comments (1)
internal/api/v1beta1connect/user.go (1)
512-513: Consider completingprincipal_typecoverage inListCurrentUserGroupserror branches.After the Line 512-Line 513 addition, the same function still has
principal_id-only logs at Line 519-Line 522 and Line 542-Line 545. Addingprincipal_typethere too would keep log fields uniform.Proposed consistency patch
- errorLogger.LogUnexpectedError(ctx, request, "ListCurrentUserGroups", err, - zap.String("principal_id", principal.ID), - zap.String("org_id", request.Msg.GetOrgId())) + errorLogger.LogUnexpectedError(ctx, request, "ListCurrentUserGroups", err, + zap.String("principal_id", principal.ID), + zap.String("principal_type", principal.Type), + zap.String("org_id", request.Msg.GetOrgId())) @@ - errorLogger.LogUnexpectedError(ctx, request, "ListCurrentUserGroups", err, - zap.String("principal_id", principal.ID), - zap.String("org_id", request.Msg.GetOrgId())) + errorLogger.LogUnexpectedError(ctx, request, "ListCurrentUserGroups", err, + zap.String("principal_id", principal.ID), + zap.String("principal_type", principal.Type), + zap.String("org_id", request.Msg.GetOrgId()))
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 26762ca9-82e3-4f6c-9bd8-13f1331dbb76
📒 Files selected for processing (3)
internal/api/v1beta1connect/preferences.gointernal/api/v1beta1connect/session.gointernal/api/v1beta1connect/user.go
Adds
principal_typein error logging alongsideprincipal_id