fix(membership): log audit record failures instead of dropping them#1770
fix(membership): log audit record failures instead of dropping them#1770AmanGIT07 wants to merge 2 commits into
Conversation
Audit record writes in the membership audit helpers discarded their error. Route them through a helper that logs the full record when the write fails. The member operation still succeeds. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughMembership audit persistence is centralized in a helper that logs repository failures with record and actor details. Organization, project, and group membership audit paths use the helper, and member creation tests verify audit failures remain non-fatal. ChangesMembership audit resilience
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 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.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: d26df683-675f-40e6-b51d-a492932219c0
📒 Files selected for processing (2)
core/membership/service.gocore/membership/service_test.go
Coverage Report for CI Build 29718688336Coverage increased (+0.02%) to 46.133%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
The repository enriches the actor from the request context after the service hands the record over, so the fallback log carried no actor. Read the same context value and log the actor id and type. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Summary
Audit record writes in the membership audit helpers discarded their error. They now go through a helper that logs the failure. The member operation still succeeds.
Changes
core/membership: route the seven audit record writes through a newcreateAuditRecordhelperAddOrganizationMemberTechnical Details
No caller-visible behavior change: the audit helpers stay fire-and-forget.
Test Plan
go test ./core/membership/passes