Conversation
c3b57b4 to
0dd0e1d
Compare
There was a problem hiding this comment.
Pull request overview
This pull request adds comprehensive audit event logging for buildpack lifecycle operations (create, update, and delete). The implementation follows established patterns in the codebase and ensures that all buildpack management operations are properly tracked through audit events.
Key changes:
- Added buildpack audit event recording for create, update, and delete operations
- Created a new
BuildpackEventRepositoryfollowing existing repository patterns - Updated all three buildpack action classes to accept
user_audit_infoand record events - Added comprehensive test coverage for the new audit events
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
app/repositories/buildpack_event_repository.rb |
New repository implementing audit event recording methods for buildpack create, update, and delete operations |
app/repositories/event_types.rb |
Added three new event type constants for buildpack lifecycle events |
app/actions/buildpack_create.rb |
Updated to accept user_audit_info and record audit events after successful creation |
app/actions/buildpack_update.rb |
Updated to accept user_audit_info and record audit events after successful updates |
app/actions/buildpack_delete.rb |
Updated to accept user_audit_info and record audit events before deletion |
app/controllers/v3/buildpacks_controller.rb |
Updated to pass user_audit_info to all three action classes |
spec/unit/actions/buildpack_create_spec.rb |
Added test coverage for audit event creation with comprehensive assertions |
spec/unit/actions/buildpack_update_spec.rb |
Added test coverage for audit event updates with comprehensive assertions |
spec/unit/actions/buildpack_delete_spec.rb |
Added test coverage for audit event deletion with comprehensive assertions |
spec/unit/repositories/event_types_spec.rb |
Added buildpack event types to the expected event types list |
docs/v3/source/includes/resources/audit_events/_header.md.erb |
Added documentation for the new buildpack audit event types |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| BUILDPACK_CREATE = 'audit.buildpack.create'.freeze, | ||
| BUILDPACK_UPDATE = 'audit.buildpack.update'.freeze, | ||
| BUILDPACK_DELETE = 'audit.buildpack.delete'.freeze, |
There was a problem hiding this comment.
I think BUILDPACK_UPLOAD would be a big part of the buildpack narrative we'd want to include in audit logs: https://v3-apidocs.cloudfoundry.org/version/3.209.0/index.html#upload-buildpack-bits
There was a problem hiding this comment.
I'll approve this for now, but we should consider adding buildpack upload audit event in a future PR
There was a problem hiding this comment.
Will open a new PR for it 👍
Changes in cloud_controller_ng:
- Add buildpack audit events
PR: cloudfoundry/cloud_controller_ng#4741
Author: Sam Gunaratne <385176+Samze@users.noreply.github.com>
Thanks for contributing to cloud_controller_ng. To speed up the process of reviewing your pull request please provide us with:
A short explanation of the proposed change:
An explanation of the use cases your change solves
Links to any other associated PRs
I have reviewed the contributing guide
I have viewed, signed, and submitted the Contributor License Agreement
I have made this pull request to the
mainbranchI have run all the unit tests using
bundle exec rakeI have run CF Acceptance Tests