Skip to content

Conversation

@Samze
Copy link
Contributor

@Samze Samze commented Jan 5, 2026

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 main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

Copy link

Copilot AI left a 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 StackEventRepository to record audit events for stack operations
  • Modifies stack action classes (StackCreate, StackUpdate, StackDelete) to accept user_audit_info and record audit events
  • Adds three new event types to the audit events enumeration: audit.stack.create, audit.stack.update, and audit.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.

@Samze Samze marked this pull request as ready for review January 7, 2026 22:13
Copy link
Member

@tcdowney tcdowney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Member

@evanfarrar evanfarrar left a 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.

@Samze Samze merged commit 8150e76 into main Jan 8, 2026
22 of 24 checks passed
@Samze Samze deleted the audit_events_stacks branch January 8, 2026 22:14
ari-wg-gitbot added a commit to cloudfoundry/capi-release that referenced this pull request Jan 9, 2026
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>
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