-
Notifications
You must be signed in to change notification settings - Fork 367
Add audit events to stacks #4733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
bd0dd53 to
1bc232d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds comprehensive audit event tracking for stack lifecycle operations (create, update, delete) in the Cloud Controller API. The implementation follows established patterns in the codebase for audit event recording.
Key Changes:
- Introduces a new
StackEventRepositoryto record audit events for stack operations - Modifies stack action classes (
StackCreate,StackUpdate,StackDelete) to acceptuser_audit_infoand record audit events - Adds three new event types to the audit events enumeration:
audit.stack.create,audit.stack.update, andaudit.stack.delete
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
app/repositories/stack_event_repository.rb |
New repository implementing methods to record stack create, update, and delete audit events with appropriate metadata |
app/repositories/event_types.rb |
Adds three new event type constants for stack lifecycle operations |
app/actions/stack_create.rb |
Updates constructor to accept user audit info and records audit event after stack creation |
app/actions/stack_update.rb |
Updates constructor to accept user audit info and records audit event within transaction during update |
app/actions/stack_delete.rb |
Updates constructor to accept user audit info and records audit event within transaction during deletion |
app/controllers/v3/stacks_controller.rb |
Passes user audit info to stack action constructors for all CRUD operations |
docs/v3/source/includes/resources/audit_events/_header.md.erb |
Documents the three new stack lifecycle audit event types |
spec/unit/repositories/stack_event_repository_spec.rb |
Comprehensive test coverage for all three event recording methods in the repository |
spec/unit/repositories/event_types_spec.rb |
Updates expected event types list to include the three new stack event types |
spec/unit/actions/stack_create_spec.rb |
Adds test verifying audit event creation during stack creation |
spec/unit/actions/stack_update_spec.rb |
Adds test verifying audit event creation during stack update |
spec/unit/actions/stack_delete_spec.rb |
Adds test verifying audit event creation during stack deletion |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tcdowney
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
evanfarrar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I like it.
Changes in cloud_controller_ng:
- Add audit events to stacks
PR: cloudfoundry/cloud_controller_ng#4733
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