fix(resource): use resource title as audit record target name - #1833
Conversation
|
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 Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe resource service now uses a resource title for audit target names when present and falls back to the resource name when the title is empty. Tests cover both cases. ChangesResource audit target naming
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
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 |
Audit records for resource creation stored the resource's unique name, which callers often set to an ID. Store the title instead and fall back to the name when the title is empty. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
bac5c0e to
d4a540b
Compare
Coverage Report for CI Build 30799138158Coverage increased (+0.005%) to 47.549%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
Summary
Audit records for resource creation stored the resource's machine name, which callers often set to an ID. The record now stores the resource title as the target name and falls back to the name when the title is empty.
Changes
core/resource/service.go:createAuditRecordsets the target name fromTitle, falling back toNamewhen the title is empty.core/resource/service_test.go: subtests covering the title case and the empty-title fallback.Test Plan
go test -race ./core/resource/...passesgolangci-lint run ./core/resource/...reports 0 issues🤖 Generated with Claude Code