🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

fix(resource): use resource title as audit record target name - #1833

Merged
AmanGIT07 merged 1 commit into
mainfrom
fix/audit-resource-target-title
Aug 3, 2026
Merged

fix(resource): use resource title as audit record target name#1833
AmanGIT07 merged 1 commit into
mainfrom
fix/audit-resource-target-title

Conversation

@AmanGIT07

Copy link
Copy Markdown
Contributor

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: createAuditRecord sets the target name from Title, falling back to Name when the title is empty.
  • core/resource/service_test.go: subtests covering the title case and the empty-title fallback.

Test Plan

  • Manual testing completed
  • Build and type checking passes
  • go test -race ./core/resource/... passes
  • golangci-lint run ./core/resource/... reports 0 issues

🤖 Generated with Claude Code

@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
frontier Ready Ready Preview Aug 3, 2026 8:53am

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: bfec3306-01f8-47b5-b051-797e4d54c53c

📥 Commits

Reviewing files that changed from the base of the PR and between bac5c0e and d4a540b.

📒 Files selected for processing (2)
  • core/resource/service.go
  • core/resource/service_test.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • core/resource/service_test.go
  • core/resource/service.go

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes

    • Audit records now display a resource’s title as the target name when available.
    • Records fall back to the resource name when no title is provided.
  • Tests

    • Added coverage for titled and untitled resources.

Walkthrough

The 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.

Changes

Resource audit target naming

Layer / File(s) Summary
Audit target selection and validation
core/resource/service.go, core/resource/service_test.go
Create audit records select Title when available and Name otherwise. Tests verify both paths.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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>
@coveralls

coveralls commented Aug 3, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 30799138158

Coverage increased (+0.005%) to 47.549%

Details

  • Coverage increased (+0.005%) from the base build.
  • Patch coverage: 5 of 5 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 39252
Covered Lines: 18664
Line Coverage: 47.55%
Coverage Strength: 15.42 hits per line

💛 - Coveralls

@AmanGIT07
AmanGIT07 merged commit c4b8ca5 into main Aug 3, 2026
10 of 11 checks passed
@AmanGIT07
AmanGIT07 deleted the fix/audit-resource-target-title branch August 3, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants