Make activity logs append-only at the model layer - #2568
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughActivity logs now reject model updates and deletes. Integration tests verify append-only behavior and confirm that mass pruning still removes old logs while preserving recent logs. ChangesActivity Log Immutability
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to Activity logs reject model-level updates and deletes while aged records remain removable through the supported pruning path. No merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
Adds
updating/deletingguards toActivityLog::boot()that throw, so audit entries can't be tampered with through the model. Pruning is unaffected becauseMassPrunabledeletes through the query builder without firing model events; a comment documents that coupling. Theactivity_log_subjectsFK already cascades, so pruning leaves no orphans.